summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authordmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-14 10:05:33 +0000
committerdmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-14 10:05:33 +0000
commita5aeb7dbe8070d7396ee1a63e83969a33c4d357e (patch)
tree5fb28d8133463b5f577939c1cd2b199c76bf4c0f /ppapi
parent82b50a59225812132dfde623fc1f35b69c7c9af0 (diff)
downloadchromium_src-a5aeb7dbe8070d7396ee1a63e83969a33c4d357e.zip
chromium_src-a5aeb7dbe8070d7396ee1a63e83969a33c4d357e.tar.gz
chromium_src-a5aeb7dbe8070d7396ee1a63e83969a33c4d357e.tar.bz2
PPAPI: Unlock before calling PPP_Printing methods
BUG=92909,159240 TBR=brettw Review URL: https://chromiumcodereview.appspot.com/11361255 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167634 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/proxy/ppp_printing_proxy.cc28
1 files changed, 18 insertions, 10 deletions
diff --git a/ppapi/proxy/ppp_printing_proxy.cc b/ppapi/proxy/ppp_printing_proxy.cc
index 32123e8..b5d3a3e 100644
--- a/ppapi/proxy/ppp_printing_proxy.cc
+++ b/ppapi/proxy/ppp_printing_proxy.cc
@@ -124,10 +124,12 @@ bool PPP_Printing_Proxy::OnMessageReceived(const IPC::Message& msg) {
void PPP_Printing_Proxy::OnPluginMsgQuerySupportedFormats(PP_Instance instance,
uint32_t* result) {
- if (ppp_printing_impl_)
- *result = ppp_printing_impl_->QuerySupportedFormats(instance);
- else
+ if (ppp_printing_impl_) {
+ *result = CallWhileUnlocked(ppp_printing_impl_->QuerySupportedFormats,
+ instance);
+ } else {
*result = 0;
+ }
}
void PPP_Printing_Proxy::OnPluginMsgBegin(PP_Instance instance,
@@ -140,8 +142,11 @@ void PPP_Printing_Proxy::OnPluginMsgBegin(PP_Instance instance,
return;
memcpy(&settings, &settings_string[0], sizeof(settings));
- if (ppp_printing_impl_)
- *result = ppp_printing_impl_->Begin(instance, &settings);
+ if (ppp_printing_impl_) {
+ *result = CallWhileUnlocked(ppp_printing_impl_->Begin,
+ instance,
+ const_cast<const PP_PrintSettings_Dev*>(&settings));
+ }
}
void PPP_Printing_Proxy::OnPluginMsgPrintPages(
@@ -151,7 +156,8 @@ void PPP_Printing_Proxy::OnPluginMsgPrintPages(
if (!ppp_printing_impl_ || pages.empty())
return;
- PP_Resource plugin_resource = ppp_printing_impl_->PrintPages(
+ PP_Resource plugin_resource = CallWhileUnlocked(
+ ppp_printing_impl_->PrintPages,
instance, &pages[0], static_cast<uint32_t>(pages.size()));
ResourceTracker* resource_tracker = PpapiGlobals::Get()->GetResourceTracker();
Resource* resource_object = resource_tracker->GetResource(plugin_resource);
@@ -166,15 +172,17 @@ void PPP_Printing_Proxy::OnPluginMsgPrintPages(
void PPP_Printing_Proxy::OnPluginMsgEnd(PP_Instance instance) {
if (ppp_printing_impl_)
- ppp_printing_impl_->End(instance);
+ CallWhileUnlocked(ppp_printing_impl_->End, instance);
}
void PPP_Printing_Proxy::OnPluginMsgIsScalingDisabled(PP_Instance instance,
bool* result) {
- if (ppp_printing_impl_)
- *result = PP_ToBool(ppp_printing_impl_->IsScalingDisabled(instance));
- else
+ if (ppp_printing_impl_) {
+ *result = PP_ToBool(CallWhileUnlocked(ppp_printing_impl_->IsScalingDisabled,
+ instance));
+ } else {
*result = false;
+ }
}
} // namespace proxy