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

Unified Diff: ppapi/proxy/ppb_testing_proxy.cc

Issue 9361065: reland 121901, PPAPI: Add unlocking for PPP calls and callbacks... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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/proxy/ppb_message_loop_proxy.cc ('k') | ppapi/proxy/ppb_var_deprecated_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_testing_proxy.cc
diff --git a/ppapi/proxy/ppb_testing_proxy.cc b/ppapi/proxy/ppb_testing_proxy.cc
index d1f5cec651209bf66a2ce773235554e5c0ff164c..b8c9ce07d3afb86a866fe26d4ccd89448197d25b 100644
--- a/ppapi/proxy/ppb_testing_proxy.cc
+++ b/ppapi/proxy/ppb_testing_proxy.cc
@@ -10,13 +10,14 @@
#include "ppapi/proxy/plugin_dispatcher.h"
#include "ppapi/proxy/ppapi_messages.h"
#include "ppapi/shared_impl/ppapi_globals.h"
+#include "ppapi/shared_impl/proxy_lock.h"
#include "ppapi/shared_impl/resource.h"
#include "ppapi/shared_impl/resource_tracker.h"
#include "ppapi/thunk/enter.h"
#include "ppapi/thunk/ppb_input_event_api.h"
using ppapi::thunk::EnterInstance;
-using ppapi::thunk::EnterResource;
+using ppapi::thunk::EnterResourceNoLock;
using ppapi::thunk::PPB_InputEvent_API;
namespace ppapi {
@@ -27,6 +28,7 @@ namespace {
PP_Bool ReadImageData(PP_Resource graphics_2d,
PP_Resource image,
const PP_Point* top_left) {
+ ProxyAutoLock lock;
Resource* image_object =
PpapiGlobals::Get()->GetResourceTracker()->GetResource(image);
if (!image_object)
@@ -51,14 +53,17 @@ PP_Bool ReadImageData(PP_Resource graphics_2d,
void RunMessageLoop(PP_Instance instance) {
MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current());
+ // TODO(dmichael): We should probably assert that this is the main thread.
MessageLoop::current()->Run();
}
void QuitMessageLoop(PP_Instance instance) {
+ // TODO(dmichael): We should probably assert that this is the main thread.
MessageLoop::current()->QuitNow();
}
uint32_t GetLiveObjectsForInstance(PP_Instance instance_id) {
+ ProxyAutoLock lock;
PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance_id);
if (!dispatcher)
return static_cast<uint32_t>(-1);
@@ -74,10 +79,11 @@ PP_Bool IsOutOfProcess() {
}
void SimulateInputEvent(PP_Instance instance_id, PP_Resource input_event) {
+ ProxyAutoLock lock;
PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance_id);
if (!dispatcher)
return;
- EnterResource<PPB_InputEvent_API> enter(input_event, false);
+ EnterResourceNoLock<PPB_InputEvent_API> enter(input_event, false);
if (enter.failed())
return;
@@ -97,6 +103,7 @@ PP_Var GetDocumentURL(PP_Instance instance, PP_URLComponents_Dev* components) {
// host-side tracker when running out-of-process, to make sure the proxy does
// not leak host-side vars.
uint32_t GetLiveVars(PP_Var live_vars[], uint32_t array_size) {
+ ProxyAutoLock lock;
std::vector<PP_Var> vars =
PpapiGlobals::Get()->GetVarTracker()->GetLiveVars();
for (size_t i = 0u;
« no previous file with comments | « ppapi/proxy/ppb_message_loop_proxy.cc ('k') | ppapi/proxy/ppb_var_deprecated_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698