Changeset 225656 in webkit


Ignore:
Timestamp:
Dec 7, 2017 4:56:18 PM (6 years ago)
Author:
gskachkov@gmail.com
Message:

WebAssembly: sending module to iframe fails
https://bugs.webkit.org/show_bug.cgi?id=179263

Reviewed by JF Bastien.

Source/WebCore:

Allow use WebAssembly.Module as input parameters for postMessage
in window and iframe object.

Tests: wasm/iframe-postmessage.html

wasm/window-postmessage.html

  • bindings/js/SerializedScriptValue.cpp:

(WebCore::CloneSerializer::dumpIfTerminal):

  • bindings/js/SerializedScriptValue.h:
  • page/DOMWindow.cpp:

(WebCore::DOMWindow::postMessage):

LayoutTests:

  • platform/ios-simulator/TestExpectations:
  • platform/win/TestExpectations:
  • resources/wasm-builder.js: Renamed from LayoutTests/workers/wasm-resources/builder.js.
  • wasm/iframe-parent-postmessage-expected.txt: Added.
  • wasm/iframe-parent-postmessage.html: Added.
  • wasm/iframe-postmessage-expected.txt: Added.
  • wasm/iframe-postmessage.html: Added.
  • wasm/resources/frame-parent.html: Added.
  • wasm/resources/frame.html: Added.
  • wasm/resources/load_wasm.js: Added.

(createWasmModule):

  • wasm/window-postmessage-expected.txt: Added.
  • wasm/window-postmessage.html: Added.
  • workers/wasm-mem-post-message.html:
Location:
trunk
Files:
11 added
8 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r225653 r225656  
     12017-12-07  Oleksandr Skachkov  <gskachkov@gmail.com>
     2
     3        WebAssembly: sending module to iframe fails
     4        https://bugs.webkit.org/show_bug.cgi?id=179263
     5
     6        Reviewed by JF Bastien.
     7
     8        * platform/ios-simulator/TestExpectations:
     9        * platform/win/TestExpectations:
     10        * resources/wasm-builder.js: Renamed from LayoutTests/workers/wasm-resources/builder.js.
     11        * wasm/iframe-parent-postmessage-expected.txt: Added.
     12        * wasm/iframe-parent-postmessage.html: Added.
     13        * wasm/iframe-postmessage-expected.txt: Added.
     14        * wasm/iframe-postmessage.html: Added.
     15        * wasm/resources/frame-parent.html: Added.
     16        * wasm/resources/frame.html: Added.
     17        * wasm/resources/load_wasm.js: Added.
     18        (createWasmModule):
     19        * wasm/window-postmessage-expected.txt: Added.
     20        * wasm/window-postmessage.html: Added.
     21        * workers/wasm-mem-post-message.html:
     22
    1232017-12-07  Matt Lewis  <jlewis3@apple.com>
    224
  • trunk/LayoutTests/platform/ios-simulator/TestExpectations

    r225317 r225656  
    5353http/tests/security/contentSecurityPolicy/WebAssembly-blocked-in-subframe.html [ Failure ]
    5454http/tests/security/contentSecurityPolicy/WebAssembly-blocked.html [ Failure ]
     55wasm/iframe-postmessage.html [ Skip ]
     56wasm/iframe-parent-postmessage.html [ Skip ]
     57wasm/window-postmessage.html [ Skip ]
    5558
    5659# WebGL tests which need triaging https://bugs.webkit.org/b/174100
  • trunk/LayoutTests/platform/win/TestExpectations

    r225641 r225656  
    36743674workers/wasm-long-compile.html [ Skip ]
    36753675workers/wasm-mem-post-message.html [ Skip ]
     3676wasm/iframe-postmessage.html [ Skip ]
     3677wasm/iframe-parent-postmessage.html [ Skip ]
     3678wasm/window-postmessage.html [ Skip ]
    36763679
    36773680# Animated image throttling behaves differently on WK1.
  • trunk/LayoutTests/workers/wasm-mem-post-message.html

    r217052 r225656  
    11<html>
    22  <head>
    3     <script src="./wasm-resources/builder.js"></script>
     3    <script src="../resources/wasm-builder.js"></script>
    44    <script src="../resources/js-test-pre.js"></script>
    55</head>
  • trunk/Source/WebCore/ChangeLog

    r225654 r225656  
     12017-12-07  Oleksandr Skachkov  <gskachkov@gmail.com>
     2
     3        WebAssembly: sending module to iframe fails
     4        https://bugs.webkit.org/show_bug.cgi?id=179263
     5
     6        Reviewed by JF Bastien.
     7
     8        Allow use WebAssembly.Module as input parameters for postMessage
     9        in window and iframe object.
     10
     11        Tests: wasm/iframe-postmessage.html
     12               wasm/window-postmessage.html
     13
     14        * bindings/js/SerializedScriptValue.cpp:
     15        (WebCore::CloneSerializer::dumpIfTerminal):
     16        * bindings/js/SerializedScriptValue.h:
     17        * page/DOMWindow.cpp:
     18        (WebCore::DOMWindow::postMessage):
     19
    1202017-12-07  Joseph Pecoraro  <pecoraro@apple.com>
    221
  • trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp

    r224309 r225656  
    10671067#if ENABLE(WEBASSEMBLY)
    10681068            if (JSWebAssemblyModule* module = jsDynamicDowncast<JSWebAssemblyModule*>(vm, obj)) {
    1069                 if (m_context != SerializationContext::WorkerPostMessage)
     1069                if (m_context != SerializationContext::WorkerPostMessage && m_context != SerializationContext::WindowPostMessage)
    10701070                    return false;
    10711071
  • trunk/Source/WebCore/bindings/js/SerializedScriptValue.h

    r223905 r225656  
    5252
    5353enum class SerializationErrorMode { NonThrowing, Throwing };
    54 enum class SerializationContext { Default, WorkerPostMessage };
     54enum class SerializationContext { Default, WorkerPostMessage, WindowPostMessage };
    5555
    5656using ArrayBufferContentsArray = Vector<JSC::ArrayBufferContents>;
  • trunk/Source/WebCore/page/DOMWindow.cpp

    r225650 r225656  
    929929
    930930    Vector<RefPtr<MessagePort>> ports;
    931     auto message = SerializedScriptValue::create(state, messageValue, WTFMove(transfer), ports);
     931    auto message = SerializedScriptValue::create(state, messageValue, WTFMove(transfer), ports, SerializationContext::WindowPostMessage);
    932932    if (message.hasException())
    933933        return message.releaseException();
Note: See TracChangeset for help on using the changeset viewer.