From 2b19f4922db21a77d43808a1f1b2e9475348b1d7 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Tue, 16 Jan 2018 15:10:27 -0800 Subject: [PATCH] Code review changes. --- src/core/lib/support/orphanable.h | 9 +++++++-- src/core/lib/support/ref_counted_ptr.h | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/core/lib/support/orphanable.h b/src/core/lib/support/orphanable.h index 63eda2e08b0..2f537573fd4 100644 --- a/src/core/lib/support/orphanable.h +++ b/src/core/lib/support/orphanable.h @@ -31,11 +31,16 @@ namespace grpc_core { -// A base class for orphanable objects. +// A base class for orphanable objects, which have one external owner +// but are not necessarily destroyed immediately when the external owner +// gives up ownership. Instead, the owner calls the object's Orphan() +// method, and the object then takes responsibility for its own cleanup +// and destruction. class Orphanable { public: // Gives up ownership of the object. The implementation must arrange - // to destroy the object without further interaction from the caller. + // to eventually destroy the object without further interaction from the + // caller. virtual void Orphan() GRPC_ABSTRACT; // Not copyable or movable. diff --git a/src/core/lib/support/ref_counted_ptr.h b/src/core/lib/support/ref_counted_ptr.h index 8c8606ca0a1..76ff0bba668 100644 --- a/src/core/lib/support/ref_counted_ptr.h +++ b/src/core/lib/support/ref_counted_ptr.h @@ -79,11 +79,11 @@ class RefCountedPtr { bool operator==(const RefCountedPtr& other) const { return value_ == other.value_; } - bool operator==(T* other) const { return value_ == other; } + bool operator==(const T* other) const { return value_ == other; } bool operator!=(const RefCountedPtr& other) const { return value_ != other.value_; } - bool operator!=(T* other) const { return value_ != other; } + bool operator!=(const T* other) const { return value_ != other; } private: T* value_ = nullptr;