Index: ppapi/proxy/ppb_message_loop_proxy.cc |
diff --git a/ppapi/proxy/ppb_message_loop_proxy.cc b/ppapi/proxy/ppb_message_loop_proxy.cc |
index c0e9ae174da68d63a333206b30a9e62698c864c6..0062fb7a84f937fa365eae675da6f431f5789d73 100644 |
--- a/ppapi/proxy/ppb_message_loop_proxy.cc |
+++ b/ppapi/proxy/ppb_message_loop_proxy.cc |
@@ -198,6 +198,7 @@ void MessageLoopResource::ReleaseMessageLoop(void* value) { |
// ----------------------------------------------------------------------------- |
PP_Resource Create(PP_Instance instance) { |
+ ProxyAutoLock lock; |
// Validate the instance. |
PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance); |
if (!dispatcher) |
@@ -206,10 +207,12 @@ PP_Resource Create(PP_Instance instance) { |
} |
PP_Resource GetForMainThread() { |
+ ProxyAutoLock lock; |
return PluginGlobals::Get()->loop_for_main_thread()->GetReference(); |
} |
PP_Resource GetCurrent() { |
+ ProxyAutoLock lock; |
Resource* resource = MessageLoopResource::GetCurrent(); |
if (resource) |
return resource->GetReference(); |