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 |