This is tested by webintents/web-intents-obj-constructor.html: // Ports, if present, must be put in |transfer|. var badchannel = new MessageChannel(); badchannel.port2.onMessage = function() { debug("* got message"); } badPortIntentObj = {"action":"action1", "type":"text/plain+badport", "data":badchannel.port1}; shouldThrow("new WebKitIntent(badPortIntentObj)", "'Error: DATA_CLONE_ERR: DOM Exception 25'"); Unfortunately, this check fails with JSC because the serialization will succeed. I can fix this as follows: --- a/Source/WebCore/bindings/js/SerializedScriptValue.cpp +++ b/Source/WebCore/bindings/js/SerializedScriptValue.cpp @@ -627,21 +627,22 @@ private: write(UString(flags, flagCount)); return true; } if (obj->inherits(&JSMessagePort::s_info)) { ObjectPool::iterator index = m_transferredMessagePorts.find(obj); if (index != m_transferredMessagePorts.end()) { write(MessagePortReferenceTag); write(index->second); return true; } - return false; + code = ValidationError; + return true; } However, I'm not 100% sure this is the right way to fix it.
I added Dmitry Lomov in CC since this part of the code was added by him in Bug 70658 and I need guidance.
Created attachment 143815 [details] Patch
(In reply to comment #1) > I added Dmitry Lomov in CC since this part of the code was added by him in Bug 70658 and I need guidance. I think he is a lot less active these days. You/ll likely be better off finding someone else familiar with that area of the code.
Any thought about this patch?
This looks plausible, but I don't know this code well enough to review it. Perhaps jsbell or haraken might be able to review your patch.
Comment on attachment 143815 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=143815&action=review > Source/WebCore/ChangeLog:11 > + matches the behavior of the V8 implementation. This behavior is tested > + by webintents/web-intents-obj-constructor.html. Would you add a test case for your change? I am afraid that the fact that there is no update in the test result of web-intents-obj-constructor.html indicates that the test is not testing your change.
> Would you add a test case for your change? I am afraid that the fact that there is no update in the test result of web-intents-obj-constructor.html indicates that the test is not testing your change. WebIntents is not yet enabled for JSC. This patch is part of a series to get it working in JSC. One its working, the test will exercise this patch.
Comment on attachment 143815 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=143815&action=review > Source/WebCore/bindings/js/SerializedScriptValue.cpp:638 > + code = ValidationError; It appears that v8/SerializedScriptValue.cpp returns DataCloneError in this case.
(In reply to comment #7) > > Would you add a test case for your change? I am afraid that the fact that there is no update in the test result of web-intents-obj-constructor.html indicates that the test is not testing your change. > > WebIntents is not yet enabled for JSC. This patch is part of a series to get it working in JSC. One its working, the test will exercise this patch. Actually, Web Intents have been enabled by default on EFL port for a few days now, on top on JSC. The reason I cannot unskip the web-intents-obj-constructor.html test with this patch is because Bug 86841 is not closed yet. The web-intents-obj-constructor.html expects the number of MessagePorts in the Intent to be printed but our port does not support it yet. If you prefer, I can work on Bug 86841 first, and land this patch afterwards so that the web-intents-obj-constructor.html test case can be unskipped for EFL port at the same time.
(In reply to comment #9) > (In reply to comment #7) > If you prefer, I can work on Bug 86841 first, and land this patch afterwards so that the web-intents-obj-constructor.html test case can be unskipped for EFL port at the same time. If it is not difficult for you, that would be best. Otherwise, it would be OK to land this patch first without enabling the test (Now I understand your situation:-).
(In reply to comment #8) > (From update of attachment 143815 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=143815&action=review > > > Source/WebCore/bindings/js/SerializedScriptValue.cpp:638 > > + code = ValidationError; > > It appears that v8/SerializedScriptValue.cpp returns DataCloneError in this case. JSC and V8 use different enums for error codes. JSC does not have a DataCloneError and it uses ValidationError instead for the cases where V8 uses DataCloneError.
Created attachment 144927 [details] Patch Same patch but now I can actually unskip the test case (dependency patch has just landed).
Created attachment 144932 [details] Patch Rebase on master.
The ews-style bot apparently hasn't realized the dependency has landed yet because the patch applies cleanly on master.
Comment on attachment 144932 [details] Patch Yeah, the style bot runs quickly. Based on the discussion between you and Kentaro, it sounds like this patch is ready to go.
Comment on attachment 144932 [details] Patch Clearing flags on attachment: 144932 Committed r119027: <http://trac.webkit.org/changeset/119027>
All reviewed patches have been landed. Closing bug.
fast/events/message-port-multi.html needs new baseline after this patch. I'll fix this in Bug 87949.