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

Unified Diff: trunk/src/base/memory/weak_ptr.cc

Issue 20771002: Revert 213906 "base: Re-apply WeakPtr support for SequencedWorke..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 5 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 | « trunk/src/base/memory/weak_ptr.h ('k') | trunk/src/base/message_loop/message_pump_io_ios.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/base/memory/weak_ptr.cc
===================================================================
--- trunk/src/base/memory/weak_ptr.cc (revision 213937)
+++ trunk/src/base/memory/weak_ptr.cc (working copy)
@@ -10,21 +10,21 @@
WeakReference::Flag::Flag() : is_valid_(true) {
// Flags only become bound when checked for validity, or invalidated,
// so that we can check that later validity/invalidation operations on
- // the same Flag take place on the same sequenced thread.
- sequence_checker_.DetachFromSequence();
+ // the same Flag take place on the same thread.
+ thread_checker_.DetachFromThread();
}
void WeakReference::Flag::Invalidate() {
// The flag being invalidated with a single ref implies that there are no
// weak pointers in existence. Allow deletion on other thread in this case.
- DCHECK(sequence_checker_.CalledOnValidSequencedThread() || HasOneRef())
- << "WeakPtrs must be invalidated on the same sequenced thread.";
+ DCHECK(thread_checker_.CalledOnValidThread() || HasOneRef())
+ << "WeakPtrs must be checked and invalidated on the same thread.";
is_valid_ = false;
}
bool WeakReference::Flag::IsValid() const {
- DCHECK(sequence_checker_.CalledOnValidSequencedThread())
- << "WeakPtrs must be checked on the same sequenced thread.";
+ DCHECK(thread_checker_.CalledOnValidThread())
+ << "WeakPtrs must be checked and invalidated on the same thread.";
return is_valid_;
}
« no previous file with comments | « trunk/src/base/memory/weak_ptr.h ('k') | trunk/src/base/message_loop/message_pump_io_ios.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698