summaryrefslogtreecommitdiffstats
path: root/ppapi/proxy/plugin_globals.cc
diff options
context:
space:
mode:
authordmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-12 08:15:39 +0000
committerdmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-12 08:15:39 +0000
commit2916256f6eac115c39af90cdf391b52419f8cb7c (patch)
tree4c87ce1e40f26e271766502a29d37a22ce83f89f /ppapi/proxy/plugin_globals.cc
parent3442a664129c54f09ec39ece7bfad7750aca1128 (diff)
downloadchromium_src-2916256f6eac115c39af90cdf391b52419f8cb7c.zip
chromium_src-2916256f6eac115c39af90cdf391b52419f8cb7c.tar.gz
chromium_src-2916256f6eac115c39af90cdf391b52419f8cb7c.tar.bz2
Make it possible to have 1 PpapiGlobals per thread. Update unit tests.
This allows us to distinguish trackers in the unit tests, instead of all vars/resources going in 1 tracker. This should also allow us to unit-test PPB proxies. BUG= TEST= Review URL: http://codereview.chromium.org/9034035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117399 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy/plugin_globals.cc')
-rw-r--r--ppapi/proxy/plugin_globals.cc23
1 files changed, 21 insertions, 2 deletions
diff --git a/ppapi/proxy/plugin_globals.cc b/ppapi/proxy/plugin_globals.cc
index 664fbeb..360f221 100644
--- a/ppapi/proxy/plugin_globals.cc
+++ b/ppapi/proxy/plugin_globals.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -19,8 +19,15 @@ PluginGlobals::PluginGlobals()
plugin_globals_ = this;
}
+PluginGlobals::PluginGlobals(ForTest for_test)
+ : ppapi::PpapiGlobals(for_test),
+ plugin_proxy_delegate_(NULL),
+ callback_tracker_(new CallbackTracker) {
+ DCHECK(!plugin_globals_);
+}
+
PluginGlobals::~PluginGlobals() {
- DCHECK(plugin_globals_ == this);
+ DCHECK(plugin_globals_ == this || !plugin_globals_);
plugin_globals_ = NULL;
}
@@ -51,5 +58,17 @@ PP_Module PluginGlobals::GetModuleForInstance(PP_Instance instance) {
return 0;
}
+base::Lock* PluginGlobals::GetProxyLock() {
+#ifdef ENABLE_PEPPER_THREADING
+ return &proxy_lock_;
+#else
+ return NULL;
+#endif
+}
+
+bool PluginGlobals::IsPluginGlobals() const {
+ return true;
+}
+
} // namespace proxy
} // namespace ppapi