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

Unified Diff: ppapi/shared_impl/ppapi_globals.h

Issue 10910099: PPAPI: Make CompletionCallbacks work right on background threads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 8 years, 1 month 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/proxy/ppb_testing_proxy.cc ('k') | ppapi/shared_impl/ppapi_globals.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « ppapi/proxy/ppb_testing_proxy.cc ('k') | ppapi/shared_impl/ppapi_globals.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698