Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Unified Diff: third_party/protobuf/src/google/protobuf/stubs/shared_ptr.h

Issue 2561963002: base: Remove the string logging from CHECK(). (Closed)
Patch Set: checkstring: rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/protobuf/src/google/protobuf/stubs/shared_ptr.h
diff --git a/third_party/protobuf/src/google/protobuf/stubs/shared_ptr.h b/third_party/protobuf/src/google/protobuf/stubs/shared_ptr.h
index d250bf4d33850d0a48507d10d1bcfd181cc2d853..83b39ac98e5b94f0bbbcc35def5a869bc13f8ac7 100644
--- a/third_party/protobuf/src/google/protobuf/stubs/shared_ptr.h
+++ b/third_party/protobuf/src/google/protobuf/stubs/shared_ptr.h
@@ -428,11 +428,13 @@ class enable_shared_from_this {
shared_ptr<T> shared_from_this() {
// Behavior is undefined if the precondition isn't satisfied; we choose
// to die with a CHECK failure.
- CHECK(!weak_this_.expired()) << "No shared_ptr owns this object";
+ // No shared_ptr owns this object
+ CHECK(!weak_this_.expired());
return weak_this_.lock();
}
shared_ptr<const T> shared_from_this() const {
- CHECK(!weak_this_.expired()) << "No shared_ptr owns this object";
+ // No shared_ptr owns this object
+ CHECK(!weak_this_.expired());
return weak_this_.lock();
}
@@ -456,7 +458,8 @@ class enable_shared_from_this {
template<typename T>
void shared_ptr<T>::MaybeSetupWeakThis(enable_shared_from_this<T>* ptr) {
if (ptr) {
- CHECK(ptr->weak_this_.expired()) << "Object already owned by a shared_ptr";
+ // Object already owned by a shared_ptr
+ CHECK(ptr->weak_this_.expired());
ptr->weak_this_ = *this;
}
}

Powered by Google App Engine
This is Rietveld 408576698