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

Unified Diff: webkit/plugins/ppapi/message_channel.cc

Issue 8340019: Try a workaround for initMessageEvent bug. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update the Note. Created 9 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/message_channel.cc
diff --git a/webkit/plugins/ppapi/message_channel.cc b/webkit/plugins/ppapi/message_channel.cc
index e49ada69c679668e4ef1c441df0bf8a76e1aae9f..caee008cfd14a9c74ae594029d8de13febcc81d9 100644
--- a/webkit/plugins/ppapi/message_channel.cc
+++ b/webkit/plugins/ppapi/message_channel.cc
@@ -306,26 +306,19 @@ bool MessageChannel::EvaluateOnMessageInvoker() {
const char invoke_onmessage_js[] =
"(function(window, module_instance, message_data) {"
" if (module_instance) {"
- " var message_event = window.document.createEvent('MessageEvent');"
- " message_event.initMessageEvent('message'," // type
- " false," // canBubble
- " false," // cancelable
- " message_data," // data
- " ''," // origin [*]
- " ''," // lastEventId
- " null," // source [*]
- " []);" // ports
+ " var message_event = new MessageEvent('message', "
+ " { data: message_data });"
" module_instance.dispatchEvent(message_event);"
" }"
"})";
- // [*] Note that the |origin| is only specified for cross-document and server-
- // sent messages, while |source| is only specified for cross-document
- // messages:
- // http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html
- // This currently behaves like Web Workers. On Firefox, Chrome, and Safari
- // at least, postMessage on Workers does not provide the origin or source.
- // TODO(dmichael): Add origin if we change to a more iframe-like origin
- // policy (see crbug.com/81537)
+ // Note that we purposely omit |origin| and |source|. The |origin| is only
+ // specified for cross-document and server-sent messages, while |source| is
+ // only specified for cross-document messages:
+ // http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html
+ // This currently behaves like Web Workers. On Firefox, Chrome, and Safari
+ // at least, postMessage on Workers does not provide the origin or source.
+ // TODO(dmichael): Add origin if we change to a more iframe-like origin
+ // policy (see crbug.com/81537)
NPString function_string = { invoke_onmessage_js,
sizeof(invoke_onmessage_js)-1 };
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698