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

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: Fix test. Cleanup. Move proxy lock to globals. Created 8 years, 12 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
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;

Powered by Google App Engine
This is Rietveld 408576698