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

Unified Diff: base/memory/weak_ptr.h

Issue 11564003: Make WeakPtr use SequenceChecker instead of ThreadChecker (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync to head Created 7 years, 10 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 | base/memory/weak_ptr.cc » ('j') | base/memory/weak_ptr.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/weak_ptr.h
diff --git a/base/memory/weak_ptr.h b/base/memory/weak_ptr.h
index 7006fb63e0981468e30ac2c631e8d6c1ed645ef7..21951982428555f2e777b6205704bcd10ac64f2c 100644
--- a/base/memory/weak_ptr.h
+++ b/base/memory/weak_ptr.h
@@ -74,8 +74,8 @@
#include "base/base_export.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
+#include "base/sequence_checker.h"
#include "base/template_util.h"
-#include "base/threading/thread_checker.h"
namespace base {
@@ -97,14 +97,14 @@ class BASE_EXPORT WeakReference {
void Invalidate();
bool IsValid() const;
- void DetachFromThread() { thread_checker_.DetachFromThread(); }
+ void DetachFromThread();
private:
friend class base::RefCountedThreadSafe<Flag>;
~Flag();
- ThreadChecker thread_checker_;
+ SequenceChecker sequence_checker_;
bool is_valid_;
};
@@ -245,6 +245,9 @@ class WeakPtr : public internal::WeakPtrBase {
T* ptr_;
};
+// TODO(akalin): Make WeakPtrFactory and SupportsWeakPtr support
jar (doing other things) 2013/02/16 02:37:27 nit: Can you add a bug number.
+// binding to a SequencedTaskRunner instead of just a single thread.
+
// A class may extend from SupportsWeakPtr to expose weak pointers to itself.
// This is useful in cases where you want others to be able to get a weak
// pointer to your class. It also has the property that you don't need to
« no previous file with comments | « no previous file | base/memory/weak_ptr.cc » ('j') | base/memory/weak_ptr.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698