[Webkit-unassigned] [Bug 68978] message-event-constructor.html crashes and fails

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Oct 11 02:13:51 PDT 2011


--- Comment #5 from Kentaro Hara <haraken at chromium.org>  2011-10-11 02:13:51 PST ---
(In reply to comment #4)
> > static PassRefPtr<MessageEvent> create(PassOwnPtr<MessagePortArray> ports, PassRefPtr<SerializedScriptValue> data\
> > , const String& origin = "", const String& lastEventId = "", PassRefPtr<DOMWindow> source = 0);
> > 
> > This API can be called from the context that has SerializedScriptValue but cannot convert it into ScriptValue since the context does not have ExecState. For example, WebCore/workers/WorkerMessagingProxy.cpp and WebKit/chromium/src/WebWorkerImpl.cpp are using this API. In this case, we convert the SerializedScriptValue into ScriptValue when MessageEvent.data is called (At this point, we have ExecState).
> I got it.
> So it looks we should have a test that create and send an MessageEvent with non-serializable object data
> to worker thread, which enforces a tricky serialization.

I guess that it is impossible to write test cases where we send non-serializable data to a worker thread by postMessage() and then the worker thread constructs MessageEvent with SerializedScriptValue. This is because if we pass non-serializable data to postMessage(), postMessage() tries to serialize the non-serializable data, resulting in TypeError in browser or a crash in DRT. In other words, we cannot send non-serializable data to the worker thread by postMessage() in the first place, which makes impossible to write the test cases we want. 

Instead, I added ASSERT() to MessageEvent.dataXXXX() in order to guarantee that MessageEvent.dataXXXX() is not called for wrong type of data.

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list