Bug 1455071 - Allow synthetic clone buffers to contain transferables, r=jorendorff
authorSteve Fink <sfink@mozilla.com>
Mon, 16 Apr 2018 12:44:35 -0700
changeset 467971 897e368bab8ccdbd81c0b8272cd4f2df8746d36c
parent 467970 912d129db081b9d7cce5d239645b7859d74eac6f
child 467972 9f5ed3cd4d9123ced9db9f89d649e674ead35fe8
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
bugs1455071
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1455071 - Allow synthetic clone buffers to contain transferables, r=jorendorff
js/src/builtin/TestingFunctions.cpp
--- a/js/src/builtin/TestingFunctions.cpp
+++ b/js/src/builtin/TestingFunctions.cpp
@@ -3093,19 +3093,17 @@ Deserialize(JSContext* cx, unsigned argc
                             "(transferables already consumed?)");
         return false;
     }
 
     bool hasTransferable;
     if (!JS_StructuredCloneHasTransferables(*obj->data(), &hasTransferable))
         return false;
 
-    if (obj->isSynthetic() &&
-        (scope != JS::StructuredCloneScope::DifferentProcess || hasTransferable))
-    {
+    if (obj->isSynthetic() && scope != JS::StructuredCloneScope::DifferentProcess) {
         JS_ReportErrorASCII(cx, "clone buffer data is synthetic but may contain pointers");
         return false;
     }
 
     RootedValue deserialized(cx);
     if (!JS_ReadStructuredClone(cx, *obj->data(),
                                 JS_STRUCTURED_CLONE_VERSION,
                                 scope,