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

Unified Diff: ppapi/proxy/plugin_globals.h

Issue 10790078: PPAPI: Make PPB_MessageLoop_Dev::GetForMainThread work (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: review comments Created 8 years, 4 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/ppapi_sources.gypi ('k') | ppapi/proxy/plugin_globals.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/plugin_globals.h
diff --git a/ppapi/proxy/plugin_globals.h b/ppapi/proxy/plugin_globals.h
index e3424b0c845fde7c843d8923bf9b44b17a59d8cb..2bbc3f95916192fe2503e8d71c874c613ffc13fa 100644
--- a/ppapi/proxy/plugin_globals.h
+++ b/ppapi/proxy/plugin_globals.h
@@ -18,6 +18,7 @@
namespace ppapi {
namespace proxy {
+class MessageLoopResource;
class PluginProxyDelegate;
class PPAPI_PROXY_EXPORT PluginGlobals : public PpapiGlobals {
@@ -86,6 +87,11 @@ class PPAPI_PROXY_EXPORT PluginGlobals : public PpapiGlobals {
msg_loop_slot_.reset(slot);
}
+ // Return the special Resource that represents the MessageLoop for the main
+ // thread. This Resource is not associated with any instance, and lives as
+ // long as the plugin.
+ MessageLoopResource* loop_for_main_thread();
+
// The embedder should call this function when the name of the plugin module
// is known. This will be used for error logging.
void set_plugin_name(const std::string& name) { plugin_name_ = name; }
@@ -106,6 +112,9 @@ class PPAPI_PROXY_EXPORT PluginGlobals : public PpapiGlobals {
base::Lock proxy_lock_;
scoped_ptr<base::ThreadLocalStorage::Slot> msg_loop_slot_;
+ // Note that loop_for_main_thread's constructor sets msg_loop_slot_, so it
+ // must be initialized after msg_loop_slot_ (hence the order here).
+ scoped_refptr<MessageLoopResource> loop_for_main_thread_;
// Name of the plugin used for error logging. This will be empty until
// set_plugin_name is called.
« no previous file with comments | « ppapi/ppapi_sources.gypi ('k') | ppapi/proxy/plugin_globals.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698