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

Unified Diff: ppapi/proxy/ppb_var_deprecated_proxy.cc

Issue 6625045: Prevent Pepper plugin reentrncy for synchronous messages. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 9 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_var_deprecated_proxy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_var_deprecated_proxy.cc
===================================================================
--- ppapi/proxy/ppb_var_deprecated_proxy.cc (revision 77850)
+++ ppapi/proxy/ppb_var_deprecated_proxy.cc (working copy)
@@ -10,6 +10,7 @@
#include "ppapi/c/dev/ppb_var_deprecated.h"
#include "ppapi/c/pp_var.h"
#include "ppapi/c/ppb_core.h"
+#include "ppapi/proxy/host_dispatcher.h"
#include "ppapi/proxy/plugin_dispatcher.h"
#include "ppapi/proxy/plugin_var_tracker.h"
#include "ppapi/proxy/ppapi_messages.h"
@@ -347,6 +348,7 @@
SerializedVarReceiveInput name,
SerializedVarOutParam exception,
PP_Bool* result) {
+ SetAllowPluginReentrancy();
*result = BoolToPPBool(ppb_var_target()->HasProperty(
var.Get(dispatcher()),
name.Get(dispatcher()),
@@ -358,6 +360,7 @@
SerializedVarReceiveInput name,
SerializedVarOutParam exception,
PP_Bool* result) {
+ SetAllowPluginReentrancy();
*result = BoolToPPBool(ppb_var_target()->HasMethod(
var.Get(dispatcher()),
name.Get(dispatcher()),
@@ -369,6 +372,7 @@
SerializedVarReceiveInput name,
SerializedVarOutParam exception,
SerializedVarReturnValue result) {
+ SetAllowPluginReentrancy();
result.Return(dispatcher(), ppb_var_target()->GetProperty(
var.Get(dispatcher()), name.Get(dispatcher()),
exception.OutParam(dispatcher())));
@@ -378,6 +382,7 @@
SerializedVarReceiveInput var,
SerializedVarVectorOutParam props,
SerializedVarOutParam exception) {
+ SetAllowPluginReentrancy();
ppb_var_target()->GetAllPropertyNames(var.Get(dispatcher()),
props.CountOutParam(), props.ArrayOutParam(dispatcher()),
exception.OutParam(dispatcher()));
@@ -388,6 +393,7 @@
SerializedVarReceiveInput name,
SerializedVarReceiveInput value,
SerializedVarOutParam exception) {
+ SetAllowPluginReentrancy();
ppb_var_target()->SetProperty(var.Get(dispatcher()),
name.Get(dispatcher()),
value.Get(dispatcher()),
@@ -399,6 +405,7 @@
SerializedVarReceiveInput name,
SerializedVarOutParam exception,
PP_Bool* result) {
+ SetAllowPluginReentrancy();
ppb_var_target()->RemoveProperty(var.Get(dispatcher()),
name.Get(dispatcher()),
exception.OutParam(dispatcher()));
@@ -413,6 +420,7 @@
SerializedVarVectorReceiveInput arg_vector,
SerializedVarOutParam exception,
SerializedVarReturnValue result) {
+ SetAllowPluginReentrancy();
uint32_t arg_count = 0;
PP_Var* args = arg_vector.Get(dispatcher(), &arg_count);
result.Return(dispatcher(), ppb_var_target()->Call(
@@ -427,6 +435,7 @@
SerializedVarVectorReceiveInput arg_vector,
SerializedVarOutParam exception,
SerializedVarReturnValue result) {
+ SetAllowPluginReentrancy();
uint32_t arg_count = 0;
PP_Var* args = arg_vector.Get(dispatcher(), &arg_count);
result.Return(dispatcher(), ppb_var_target()->Construct(
@@ -447,9 +456,17 @@
int64 ppp_class,
int64 class_data,
SerializedVarReturnValue result) {
+ SetAllowPluginReentrancy();
result.Return(dispatcher(), PPP_Class_Proxy::CreateProxiedObject(
ppb_var_target(), dispatcher(), instance, ppp_class, class_data));
}
+void PPB_Var_Deprecated_Proxy::SetAllowPluginReentrancy() {
+ if (dispatcher()->IsPlugin())
+ NOTREACHED();
+ else
+ static_cast<HostDispatcher*>(dispatcher())->set_allow_plugin_reentrancy();
+}
+
} // namespace proxy
} // namespace pp
« no previous file with comments | « ppapi/proxy/ppb_var_deprecated_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698