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

Unified Diff: base/memory/ref_counted.h

Issue 10874054: Add WARN_UNUSED_RESULT to scoped_refptr::release. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Don't assign NULL to pointer to scoped_refptr. Created 8 years, 4 months 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
« no previous file with comments | « no previous file | chrome/browser/sync/glue/browser_thread_model_worker_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/ref_counted.h
diff --git a/base/memory/ref_counted.h b/base/memory/ref_counted.h
index 35f515d23b8aed446d25882d77dc12b3858967f5..ba7e657389d1d88e9cdfe75282ee17e250ec2fde 100644
--- a/base/memory/ref_counted.h
+++ b/base/memory/ref_counted.h
@@ -9,6 +9,7 @@
#include "base/atomic_ref_count.h"
#include "base/base_export.h"
+#include "base/compiler_specific.h"
#include "base/threading/thread_collision_warner.h"
namespace base {
@@ -260,7 +261,7 @@ class scoped_refptr {
// If this object holds a NULL pointer, the return value is NULL.
// After this operation, this object will hold a NULL pointer,
// and will not own the object any more.
- T* release() {
+ T* release() WARN_UNUSED_RESULT {
T* retVal = ptr_;
ptr_ = NULL;
return retVal;
« no previous file with comments | « no previous file | chrome/browser/sync/glue/browser_thread_model_worker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698