clang-format

pull/13357/head
Mark D. Roth 8 years ago
parent 3228489f0b
commit d3984c32c8
  1. 1
      src/core/lib/support/debug_location.h
  2. 4
      src/core/lib/support/reference_counted.cc
  3. 4
      src/core/lib/support/reference_counted_ptr.h
  4. 4
      test/core/support/reference_counted_ptr_test.cc
  5. 4
      test/core/support/reference_counted_test.cc

@ -28,6 +28,7 @@ class DebugLocation {
bool Log() const { return true; } bool Log() const { return true; }
const char* file() const { return file_; } const char* file() const { return file_; }
int line() const { return line_; } int line() const { return line_; }
private: private:
const char* file_; const char* file_;
const int line_; const int line_;

@ -34,9 +34,7 @@ void ReferenceCounted::Ref(const DebugLocation& location, const char* reason) {
Ref(); Ref();
} }
void ReferenceCounted::Ref() { void ReferenceCounted::Ref() { gpr_ref(&refs_); }
gpr_ref(&refs_);
}
bool ReferenceCounted::Unref(const DebugLocation& location, bool ReferenceCounted::Unref(const DebugLocation& location,
const char* reason) { const char* reason) {

@ -33,9 +33,7 @@ class ReferenceCountedPtr {
ReferenceCountedPtr() {} ReferenceCountedPtr() {}
// If value is non-null, we take ownership of a ref to it. // If value is non-null, we take ownership of a ref to it.
explicit ReferenceCountedPtr(T* value) { explicit ReferenceCountedPtr(T* value) { value_ = value; }
value_ = value;
}
// Move support. // Move support.
ReferenceCountedPtr(ReferenceCountedPtr&& other) { ReferenceCountedPtr(ReferenceCountedPtr&& other) {

@ -41,9 +41,7 @@ class Foo : public ReferenceCounted {
int value_; int value_;
}; };
TEST(ReferenceCountedPtr, DefaultConstructor) { TEST(ReferenceCountedPtr, DefaultConstructor) { ReferenceCountedPtr<Foo> foo; }
ReferenceCountedPtr<Foo> foo;
}
TEST(ReferenceCountedPtr, ExplicitConstructorEmpty) { TEST(ReferenceCountedPtr, ExplicitConstructorEmpty) {
ReferenceCountedPtr<Foo> foo(nullptr); ReferenceCountedPtr<Foo> foo(nullptr);

@ -31,9 +31,7 @@ class Foo : public ReferenceCounted {
Foo() : ReferenceCounted(nullptr) {} Foo() : ReferenceCounted(nullptr) {}
}; };
TEST(ReferenceCounted, StackAllocated) { TEST(ReferenceCounted, StackAllocated) { Foo foo; }
Foo foo;
}
TEST(ReferenceCounted, StackAllocatedWithExtraRef) { TEST(ReferenceCounted, StackAllocatedWithExtraRef) {
Foo foo; Foo foo;

Loading…
Cancel
Save