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

Unified Diff: base/memory/weak_ptr.cc

Issue 18501008: base: Change WeakPtr to use SequenceChecker instead of ThreadChecker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adapt to upstream changes 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
Index: base/memory/weak_ptr.cc
diff --git a/base/memory/weak_ptr.cc b/base/memory/weak_ptr.cc
index a22f61aa2ba47e0a8417e40734a23353c96b2eb6..41127728bc314e056f698a72312beadfaa807177 100644
--- a/base/memory/weak_ptr.cc
+++ b/base/memory/weak_ptr.cc
@@ -11,20 +11,20 @@ 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 thread.
Wez 2013/07/11 21:00:11 nit: thread -> sequence
tommycli 2013/07/11 21:39:13 Done.
- thread_checker_.DetachFromThread();
+ sequence_checker_.DetachFromSequence();
}
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(thread_checker_.CalledOnValidThread() || HasOneRef())
- << "WeakPtrs must be checked and invalidated on the same thread.";
+ DCHECK(sequence_checker_.CalledOnValidSequencedThread() || HasOneRef())
+ << "WeakPtrs must be checked and invalidated on the same sequence.";
akalin 2013/07/11 19:31:23 sequence -> sequenced thread?
tommycli 2013/07/11 21:39:13 Done.
is_valid_ = false;
}
bool WeakReference::Flag::IsValid() const {
- DCHECK(thread_checker_.CalledOnValidThread())
- << "WeakPtrs must be checked and invalidated on the same thread.";
+ DCHECK(sequence_checker_.CalledOnValidSequencedThread())
+ << "WeakPtrs must be checked and invalidated on the same sequence.";
akalin 2013/07/11 19:31:23 here too
tommycli 2013/07/11 21:39:13 Done.
return is_valid_;
}

Powered by Google App Engine
This is Rietveld 408576698