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

Unified Diff: webkit/plugins/ppapi/host_globals.h

Issue 9034035: Make it possible to have 1 PpapiGlobals per thread. Update unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review comments. Created 8 years, 11 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 | « ppapi/shared_impl/var_tracker.cc ('k') | webkit/plugins/ppapi/host_globals.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/host_globals.h
diff --git a/webkit/plugins/ppapi/host_globals.h b/webkit/plugins/ppapi/host_globals.h
index db840aa85ed3c618935cf1e2ed71f063f525e027..9820bf8017d2f658ae5189a8d658b55f561cbb84 100644
--- a/webkit/plugins/ppapi/host_globals.h
+++ b/webkit/plugins/ppapi/host_globals.h
@@ -22,12 +22,16 @@ 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() { return host_globals_; }
+ inline static HostGlobals* Get() {
+ DCHECK(PpapiGlobals::Get()->IsHostGlobals());
+ return static_cast<HostGlobals*>(PpapiGlobals::Get());
+ }
// PpapiGlobals implementation.
virtual ::ppapi::ResourceTracker* GetResourceTracker() OVERRIDE;
@@ -38,6 +42,7 @@ 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_;
@@ -75,6 +80,9 @@ 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;
« no previous file with comments | « ppapi/shared_impl/var_tracker.cc ('k') | webkit/plugins/ppapi/host_globals.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698