Index: trunk/src/ppapi/shared_impl/var_tracker.h |
=================================================================== |
--- trunk/src/ppapi/shared_impl/var_tracker.h (revision 189681) |
+++ trunk/src/ppapi/shared_impl/var_tracker.h (working copy) |
@@ -10,9 +10,8 @@ |
#include "base/basictypes.h" |
#include "base/hash_tables.h" |
#include "base/memory/ref_counted.h" |
-#include "base/memory/scoped_ptr.h" |
#include "base/shared_memory.h" |
-#include "base/threading/thread_checker.h" |
+#include "base/threading/non_thread_safe.h" |
#include "ppapi/c/pp_instance.h" |
#include "ppapi/c/pp_module.h" |
#include "ppapi/c/pp_resource.h" |
@@ -37,14 +36,16 @@ |
// This class maintains the "track_with_no_reference_count" but doesn't do |
// anything with it other than call virtual functions. The interesting parts |
// are added by the PluginObjectVar derived from this class. |
-class PPAPI_SHARED_EXPORT VarTracker { |
+class PPAPI_SHARED_EXPORT VarTracker |
+#ifdef ENABLE_PEPPER_THREADING |
+ : NON_EXPORTED_BASE(public base::NonThreadSafeDoNothing) { |
+#else |
+ // TODO(dmichael): Remove the thread checking when calls are allowed off the |
+ // main thread (crbug.com/92909). |
+ : NON_EXPORTED_BASE(public base::NonThreadSafe) { |
+#endif |
public: |
- // A SINGLE_THREADED VarTracker will use a thread-checker to make sure it's |
- // always invoked on the same thread on which it was constructed. A |
- // THREAD_SAFE VarTracker will check that the ProxyLock is held. See |
- // CheckThreadingPreconditions() for more details. |
- enum ThreadMode { SINGLE_THREADED, THREAD_SAFE }; |
- explicit VarTracker(ThreadMode thread_mode); |
+ VarTracker(); |
virtual ~VarTracker(); |
// Called by the Var object to add a new var to the tracker. |
@@ -147,10 +148,6 @@ |
ADD_VAR_CREATE_WITH_NO_REFERENCE |
}; |
- // On the host-side, make sure we are called on the right thread. On the |
- // plugin side, make sure we have the proxy lock. |
- void CheckThreadingPreconditions() const; |
- |
// Implementation of AddVar that allows the caller to specify whether the |
// initial refcount of the added object will be 0 or 1. |
// |
@@ -201,12 +198,6 @@ |
uint32 size_in_bytes, |
base::SharedMemoryHandle handle) = 0; |
- // On the host side, we want to check that we are only called on the main |
- // thread. This is to protect us from accidentally using the tracker from |
- // other threads (especially the IO thread). On the plugin side, the tracker |
- // is protected by the proxy lock and is thread-safe, so this will be NULL. |
- scoped_ptr<base::ThreadChecker> thread_checker_; |
- |
DISALLOW_COPY_AND_ASSIGN(VarTracker); |
}; |