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

Unified Diff: ppapi/proxy/ppb_instance_proxy.cc

Issue 16140011: Don't send PP_Vars/V8 values with cycles across PostMessage (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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/handle_converter.cc ('k') | ppapi/proxy/raw_var_data.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_instance_proxy.cc
diff --git a/ppapi/proxy/ppb_instance_proxy.cc b/ppapi/proxy/ppb_instance_proxy.cc
index 4009a19f0db93df1599051dd8ca3eedf3e21ced1..e3948f06aafff92afb3f569434592a47a7954a01 100644
--- a/ppapi/proxy/ppb_instance_proxy.cc
+++ b/ppapi/proxy/ppb_instance_proxy.cc
@@ -56,6 +56,10 @@ namespace proxy {
namespace {
+const char kSerializationError[] = "Failed to convert a PostMessage "
+ "argument from a PP_Var to a Javascript value. It may have cycles or be of "
+ "an unsupported type.";
+
InterfaceProxy* CreateInstanceProxy(Dispatcher* dispatcher) {
return new PPB_Instance_Proxy(dispatcher);
}
@@ -933,6 +937,12 @@ void PPB_Instance_Proxy::OnHostMsgPostMessage(
PP_Instance instance,
SerializedVarReceiveInput message) {
EnterInstanceNoLock enter(instance);
+ if (!message.is_valid_var()) {
+ PpapiGlobals::Get()->LogWithSource(
+ instance, PP_LOGLEVEL_ERROR, std::string(), kSerializationError);
+ return;
+ }
+
if (enter.succeeded())
enter.functions()->PostMessage(instance,
message.GetForInstance(dispatcher(),
« no previous file with comments | « ppapi/proxy/handle_converter.cc ('k') | ppapi/proxy/raw_var_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698