Index: ppapi/proxy/plugin_globals.h |
diff --git a/ppapi/proxy/plugin_globals.h b/ppapi/proxy/plugin_globals.h |
index e3424b0c845fde7c843d8923bf9b44b17a59d8cb..696eb2e67b7ab510934b6713867e749dd284005a 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 { |
@@ -79,6 +80,10 @@ class PPAPI_PROXY_EXPORT PluginGlobals : public PpapiGlobals { |
base::ThreadLocalStorage::Slot* msg_loop_slot() { |
return msg_loop_slot_.get(); |
} |
+ // 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(); |
bbudge
2012/08/29 22:26:58
This looks out of place between the get and set fo
dmichael (off chromium)
2012/08/30 15:59:10
Good point, done. I also had the body in the wrong
|
// Sets the message loop slot, takes ownership of the given heap-alloated |
// pointer. |
@@ -106,6 +111,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. |