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..57dde570870eb08309ac94cd9eaacc5620749aea 100644 |
--- a/webkit/plugins/ppapi/host_globals.h |
+++ b/webkit/plugins/ppapi/host_globals.h |
@@ -22,12 +22,17 @@ 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() { |
+ if (host_globals_) |
+ return host_globals_; |
+ return static_cast<HostGlobals*>(PpapiGlobals::Get()); |
+ } |
// PpapiGlobals implementation. |
virtual ::ppapi::ResourceTracker* GetResourceTracker() OVERRIDE; |