diff options
author | dmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-12 00:41:08 +0000 |
---|---|---|
committer | dmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-12 00:41:08 +0000 |
commit | 6fb8da6d97a3bbdb0df022ea201bf91aa36a001b (patch) | |
tree | 26d3b38ccb77f4fdb5dc2538c67e42703295bde5 /ppapi/proxy/plugin_globals.cc | |
parent | 5e93c47a282ed564e6a56af10f4097599fe41def (diff) | |
download | chromium_src-6fb8da6d97a3bbdb0df022ea201bf91aa36a001b.zip chromium_src-6fb8da6d97a3bbdb0df022ea201bf91aa36a001b.tar.gz chromium_src-6fb8da6d97a3bbdb0df022ea201bf91aa36a001b.tar.bz2 |
PPAPI: Remove threading options; it's always on
This also re-enables thread checking for the host side resource and var trackers. Before, checking was disabled everywhere.
BUG=159240,92909
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=186925
Reverted: https://src.chromium.org/viewvc/chrome?view=rev&revision=186939 due to build errors
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=187340
Review URL: https://chromiumcodereview.appspot.com/12378050
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@187427 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy/plugin_globals.cc')
-rw-r--r-- | ppapi/proxy/plugin_globals.cc | 42 |
1 files changed, 18 insertions, 24 deletions
diff --git a/ppapi/proxy/plugin_globals.cc b/ppapi/proxy/plugin_globals.cc index 2e18ac5f..3083832 100644 --- a/ppapi/proxy/plugin_globals.cc +++ b/ppapi/proxy/plugin_globals.cc @@ -49,40 +49,36 @@ PluginGlobals* PluginGlobals::plugin_globals_ = NULL; PluginGlobals::PluginGlobals() : ppapi::PpapiGlobals(), plugin_proxy_delegate_(NULL), - callback_tracker_(new CallbackTracker), - loop_for_main_thread_( - new MessageLoopResource(MessageLoopResource::ForMainThread())) { -#if defined(ENABLE_PEPPER_THREADING) - enable_threading_ = true; -#else - enable_threading_ = false; -#endif - + callback_tracker_(new CallbackTracker) { DCHECK(!plugin_globals_); plugin_globals_ = this; + + // ResourceTracker asserts that we have the lock when we add new resources, + // so we lock when creating the MessageLoopResource even though there is no + // chance of race conditions. + ProxyAutoLock lock; + loop_for_main_thread_ = + new MessageLoopResource(MessageLoopResource::ForMainThread()); } PluginGlobals::PluginGlobals(PerThreadForTest per_thread_for_test) : ppapi::PpapiGlobals(per_thread_for_test), plugin_proxy_delegate_(NULL), callback_tracker_(new CallbackTracker) { -#if defined(ENABLE_PEPPER_THREADING) - enable_threading_ = true; -#else - enable_threading_ = false; -#endif DCHECK(!plugin_globals_); } PluginGlobals::~PluginGlobals() { DCHECK(plugin_globals_ == this || !plugin_globals_); - // Release the main-thread message loop. We should have the last reference - // count, so this will delete the MessageLoop resource. We do this before - // we clear plugin_globals_, because the Resource destructor tries to access - // this PluginGlobals. - DCHECK(!loop_for_main_thread_ || loop_for_main_thread_->HasOneRef()); - loop_for_main_thread_ = NULL; - + { + ProxyAutoLock lock; + // Release the main-thread message loop. We should have the last reference + // count, so this will delete the MessageLoop resource. We do this before + // we clear plugin_globals_, because the Resource destructor tries to access + // this PluginGlobals. + DCHECK(!loop_for_main_thread_ || loop_for_main_thread_->HasOneRef()); + loop_for_main_thread_ = NULL; + } plugin_globals_ = NULL; } @@ -131,9 +127,7 @@ void PluginGlobals::PreCacheFontForFlash(const void* logfontw) { } base::Lock* PluginGlobals::GetProxyLock() { - if (enable_threading_) - return &proxy_lock_; - return NULL; + return &proxy_lock_; } void PluginGlobals::LogWithSource(PP_Instance instance, |