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

Unified Diff: trunk/src/ppapi/shared_impl/var_tracker.h

Issue 12920003: Revert 189518 "PPAPI: Remove threading options; it's always on" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 9 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/ppapi/shared_impl/test_globals.cc ('k') | trunk/src/ppapi/shared_impl/var_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « trunk/src/ppapi/shared_impl/test_globals.cc ('k') | trunk/src/ppapi/shared_impl/var_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698