diff options
author | dmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-14 18:05:39 +0000 |
---|---|---|
committer | dmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-14 18:05:39 +0000 |
commit | 2ef706e47ff06fb0509f660475e12392f6b40a72 (patch) | |
tree | 79af67b204457912f3735619d8a2c52b6edf903e /ppapi/proxy/ppp_class_proxy.cc | |
parent | bd9ea1bc4abd3dea19674737d963d6a50272ad45 (diff) | |
download | chromium_src-2ef706e47ff06fb0509f660475e12392f6b40a72.zip chromium_src-2ef706e47ff06fb0509f660475e12392f6b40a72.tar.gz chromium_src-2ef706e47ff06fb0509f660475e12392f6b40a72.tar.bz2 |
PPAPI: Add unlocking for PPP calls and callbacks. Add more locking.
With this patch, ppapi_tests pass locally when building with enable_pepper_threading=1. (They didn't before).
TODO: Test more calls off the main thread, make sync completion callbacks work.
BUG=92909
TEST=
Review URL: http://codereview.chromium.org/9391006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121901 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy/ppp_class_proxy.cc')
-rw-r--r-- | ppapi/proxy/ppp_class_proxy.cc | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/ppapi/proxy/ppp_class_proxy.cc b/ppapi/proxy/ppp_class_proxy.cc index 0ff8973..91f44cb 100644 --- a/ppapi/proxy/ppp_class_proxy.cc +++ b/ppapi/proxy/ppp_class_proxy.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -8,6 +8,7 @@ #include "ppapi/c/dev/ppp_class_deprecated.h" #include "ppapi/proxy/dispatcher.h" #include "ppapi/proxy/ppapi_messages.h" +#include "ppapi/shared_impl/proxy_lock.h" #include "ppapi/proxy/serialized_var.h" #include "ppapi/shared_impl/api_id.h" @@ -243,23 +244,28 @@ void PPP_Class_Proxy::OnMsgHasProperty(int64 ppp_class, int64 object, SerializedVarReceiveInput property, SerializedVarOutParam exception, bool* result) { - *result = ToPPPClass(ppp_class)->HasProperty(ToUserData(object), - property.Get(dispatcher()), exception.OutParam(dispatcher())); + *result = CallWhileUnlocked(ToPPPClass(ppp_class)->HasProperty, + ToUserData(object), + property.Get(dispatcher()), + exception.OutParam(dispatcher())); } void PPP_Class_Proxy::OnMsgHasMethod(int64 ppp_class, int64 object, SerializedVarReceiveInput property, SerializedVarOutParam exception, bool* result) { - *result = ToPPPClass(ppp_class)->HasMethod(ToUserData(object), - property.Get(dispatcher()), exception.OutParam(dispatcher())); + *result = CallWhileUnlocked(ToPPPClass(ppp_class)->HasMethod, + ToUserData(object), + property.Get(dispatcher()), + exception.OutParam(dispatcher())); } void PPP_Class_Proxy::OnMsgGetProperty(int64 ppp_class, int64 object, SerializedVarReceiveInput property, SerializedVarOutParam exception, SerializedVarReturnValue result) { - result.Return(dispatcher(), ToPPPClass(ppp_class)->GetProperty( + result.Return(dispatcher(), CallWhileUnlocked( + ToPPPClass(ppp_class)->GetProperty, ToUserData(object), property.Get(dispatcher()), exception.OutParam(dispatcher()))); } @@ -276,7 +282,7 @@ void PPP_Class_Proxy::OnMsgSetProperty(int64 ppp_class, int64 object, SerializedVarReceiveInput property, SerializedVarReceiveInput value, SerializedVarOutParam exception) { - ToPPPClass(ppp_class)->SetProperty( + CallWhileUnlocked(ToPPPClass(ppp_class)->SetProperty, ToUserData(object), property.Get(dispatcher()), value.Get(dispatcher()), exception.OutParam(dispatcher())); } @@ -284,7 +290,7 @@ void PPP_Class_Proxy::OnMsgSetProperty(int64 ppp_class, int64 object, void PPP_Class_Proxy::OnMsgRemoveProperty(int64 ppp_class, int64 object, SerializedVarReceiveInput property, SerializedVarOutParam exception) { - ToPPPClass(ppp_class)->RemoveProperty( + CallWhileUnlocked(ToPPPClass(ppp_class)->RemoveProperty, ToUserData(object), property.Get(dispatcher()), exception.OutParam(dispatcher())); } @@ -297,7 +303,7 @@ void PPP_Class_Proxy::OnMsgCall( SerializedVarReturnValue result) { uint32_t arg_count = 0; PP_Var* args = arg_vector.Get(dispatcher(), &arg_count); - result.Return(dispatcher(), ToPPPClass(ppp_class)->Call( + result.Return(dispatcher(), CallWhileUnlocked(ToPPPClass(ppp_class)->Call, ToUserData(object), method_name.Get(dispatcher()), arg_count, args, exception.OutParam(dispatcher()))); } @@ -309,12 +315,13 @@ void PPP_Class_Proxy::OnMsgConstruct( SerializedVarReturnValue result) { uint32_t arg_count = 0; PP_Var* args = arg_vector.Get(dispatcher(), &arg_count); - result.Return(dispatcher(), ToPPPClass(ppp_class)->Construct( + result.Return(dispatcher(), CallWhileUnlocked( + ToPPPClass(ppp_class)->Construct, ToUserData(object), arg_count, args, exception.OutParam(dispatcher()))); } void PPP_Class_Proxy::OnMsgDeallocate(int64 ppp_class, int64 object) { - ToPPPClass(ppp_class)->Deallocate(ToUserData(object)); + CallWhileUnlocked(ToPPPClass(ppp_class)->Deallocate, ToUserData(object)); } } // namespace proxy |