summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authortommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-12 10:51:21 +0000
committertommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-12 10:51:21 +0000
commitcd34c7edce57194b4bd49689f970dcde148bae6d (patch)
tree0e968530c533b3502928ade0567470a3b0a7ff9d /webkit
parent76ca072f3704bbba63aba1ab27b0ea2448de984f (diff)
downloadchromium_src-cd34c7edce57194b4bd49689f970dcde148bae6d.zip
chromium_src-cd34c7edce57194b4bd49689f970dcde148bae6d.tar.gz
chromium_src-cd34c7edce57194b4bd49689f970dcde148bae6d.tar.bz2
Revert 117399 - Make it possible to have 1 PpapiGlobals per thread. Update unit tests.
Reason for rever: Broke the sizes check on the mac clobber bot. 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 TBR=dmichael@chromium.org Review URL: http://codereview.chromium.org/9139054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117414 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/plugins/ppapi/host_globals.cc18
-rw-r--r--webkit/plugins/ppapi/host_globals.h12
2 files changed, 4 insertions, 26 deletions
diff --git a/webkit/plugins/ppapi/host_globals.cc b/webkit/plugins/ppapi/host_globals.cc
index 7705dcc..ab51983 100644
--- a/webkit/plugins/ppapi/host_globals.cc
+++ b/webkit/plugins/ppapi/host_globals.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -45,13 +45,8 @@ HostGlobals::HostGlobals() : ::ppapi::PpapiGlobals() {
host_globals_ = this;
}
-HostGlobals::HostGlobals(::ppapi::PpapiGlobals::ForTest for_test)
- : ::ppapi::PpapiGlobals(for_test) {
- DCHECK(!host_globals_);
-}
-
HostGlobals::~HostGlobals() {
- DCHECK(host_globals_ == this || !host_globals_);
+ DCHECK(host_globals_ == this);
host_globals_ = NULL;
}
@@ -121,11 +116,6 @@ PP_Module HostGlobals::GetModuleForInstance(PP_Instance instance) {
return inst->module()->pp_module();
}
-base::Lock* HostGlobals::GetProxyLock() {
- // We do not lock on the host side.
- return NULL;
-}
-
PP_Module HostGlobals::AddModule(PluginModule* module) {
#ifndef NDEBUG
// Make sure we're not adding one more than once.
@@ -207,9 +197,5 @@ PluginInstance* HostGlobals::GetInstance(PP_Instance instance) {
return found->second->instance;
}
-bool HostGlobals::IsHostGlobals() const {
- return true;
-}
-
} // namespace ppapi
} // namespace webkit
diff --git a/webkit/plugins/ppapi/host_globals.h b/webkit/plugins/ppapi/host_globals.h
index d0926bc..db840aa 100644
--- a/webkit/plugins/ppapi/host_globals.h
+++ b/webkit/plugins/ppapi/host_globals.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -22,16 +22,12 @@ class PluginModule;
class HostGlobals : public ::ppapi::PpapiGlobals {
public:
HostGlobals();
- HostGlobals(::ppapi::PpapiGlobals::ForTest);
virtual ~HostGlobals();
// Getter for the global singleton. Generally, you should use
// PpapiGlobals::Get() when possible. Use this only when you need some
// host-specific functionality.
- inline static HostGlobals* Get() {
- DCHECK(PpapiGlobals::Get()->IsHostGlobals());
- return static_cast<HostGlobals*>(PpapiGlobals::Get());
- }
+ inline static HostGlobals* Get() { return host_globals_; }
// PpapiGlobals implementation.
virtual ::ppapi::ResourceTracker* GetResourceTracker() OVERRIDE;
@@ -42,7 +38,6 @@ class HostGlobals : public ::ppapi::PpapiGlobals {
PP_Instance inst,
::ppapi::ApiID id) OVERRIDE;
virtual PP_Module GetModuleForInstance(PP_Instance instance) OVERRIDE;
- virtual base::Lock* GetProxyLock() OVERRIDE;
HostVarTracker* host_var_tracker() {
return &host_var_tracker_;
@@ -80,9 +75,6 @@ class HostGlobals : public ::ppapi::PpapiGlobals {
WEBKIT_PLUGINS_EXPORT PluginInstance* GetInstance(PP_Instance instance);
private:
- // PpapiGlobals overrides.
- virtual bool IsHostGlobals() const OVERRIDE;
-
// Per-instance data we track.
struct InstanceData;