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

Unified Diff: base/message_loop/message_loop.h

Issue 301943003: Fixed example in MessageLoop::ReleaseSoon comment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed order in description Created 6 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_loop/message_loop.h
diff --git a/base/message_loop/message_loop.h b/base/message_loop/message_loop.h
index 25891c5dc7c7c4866a5b865b8b1cc13f9092daaa..165299d53d0fb70220ab97e80c0a043cffbd7a42 100644
--- a/base/message_loop/message_loop.h
+++ b/base/message_loop/message_loop.h
@@ -208,15 +208,16 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
// released on a particular thread.
//
// A common pattern is to manually increment the object's reference count
- // (AddRef), issue a ReleaseSoon, then clear the pointer. The reference count
+ // (AddRef), clear the pointer, then issue a ReleaseSoon. The reference count
// is incremented manually to ensure clearing the pointer does not trigger a
// delete and to account for the upcoming decrement (ReleaseSoon). For
// example:
//
// scoped_refptr<Foo> foo = ...
- // foo.AddRef();
- // message_loop->ReleaseSoon(foo.get());
+ // foo->AddRef();
+ // Foo* raw_foo = foo.get();
// foo = NULL;
+ // message_loop->ReleaseSoon(raw_foo);
//
// NOTE: This method may be called on any thread. The object will be
// released (and thus possibly deleted) on the thread that executes
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698