Index: ppapi/shared_impl/ppapi_globals.h |
diff --git a/ppapi/shared_impl/ppapi_globals.h b/ppapi/shared_impl/ppapi_globals.h |
index e95cf48b2392def80cbf9ab4b59b130b54ebe9df..b03d35c9bd87de5b19b45ac1fc0a1e28a50c9fab 100644 |
--- a/ppapi/shared_impl/ppapi_globals.h |
+++ b/ppapi/shared_impl/ppapi_globals.h |
@@ -24,6 +24,7 @@ class MessageLoopProxy; |
namespace ppapi { |
class CallbackTracker; |
+class MessageLoopShared; |
class ResourceTracker; |
class VarTracker; |
@@ -35,6 +36,7 @@ class ResourceCreationAPI; |
// Abstract base class |
class PPAPI_SHARED_EXPORT PpapiGlobals { |
public: |
+ // Must be created on the main thread. |
PpapiGlobals(); |
// This constructor is to be used only for making a PpapiGlobal for testing |
@@ -42,7 +44,7 @@ class PPAPI_SHARED_EXPORT PpapiGlobals { |
// tests that use this feature, the "test" PpapiGlobals should be constructed |
// using this method. See SetPpapiGlobalsOnThreadForTest for more information. |
struct ForTest {}; |
- PpapiGlobals(ForTest); |
+ explicit PpapiGlobals(ForTest); |
virtual ~PpapiGlobals(); |
@@ -71,6 +73,7 @@ class PPAPI_SHARED_EXPORT PpapiGlobals { |
virtual VarTracker* GetVarTracker() = 0; |
virtual CallbackTracker* GetCallbackTrackerForInstance( |
PP_Instance instance) = 0; |
+ |
virtual base::Lock* GetProxyLock() = 0; |
// Logs the given string to the JS console. If "source" is empty, the name of |
@@ -103,11 +106,15 @@ class PPAPI_SHARED_EXPORT PpapiGlobals { |
// failure. |
virtual PP_Module GetModuleForInstance(PP_Instance instance) = 0; |
- // Returns the base::MessageLoopProxy for the main thread. Note that this must |
- // be called on the main thread the first time so that it can initialize |
- // its static data. |
+ // Returns the base::MessageLoopProxy for the main thread. This is set in the |
+ // constructor, so PpapiGlobals must be created on the main thread. |
base::MessageLoopProxy* GetMainThreadMessageLoop(); |
+ // Return the MessageLoopShared of the current thread, if any. This will |
+ // always return NULL on the host side, where PPB_MessageLoop is not |
+ // supported. |
+ virtual MessageLoopShared* GetCurrentMessageLoop() = 0; |
+ |
// Returns the command line for the process. |
virtual std::string GetCmdLine() = 0; |
@@ -127,7 +134,7 @@ class PPAPI_SHARED_EXPORT PpapiGlobals { |
static PpapiGlobals* ppapi_globals_; |
- scoped_refptr<base::MessageLoopProxy> message_loop_proxy_; |
+ scoped_refptr<base::MessageLoopProxy> main_loop_proxy_; |
DISALLOW_COPY_AND_ASSIGN(PpapiGlobals); |
}; |