summaryrefslogtreecommitdiffstats
path: root/extensions/renderer/guest_view
diff options
context:
space:
mode:
authorsammc <sammc@chromium.org>2015-01-28 20:17:06 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-29 04:17:49 +0000
commit438db6aecb5242715010c129ea508a80c16f9fa9 (patch)
treef3f26059815d6f846d238ee4b79ed65301bf2e72 /extensions/renderer/guest_view
parent65a326a734d413e2124c6782b2e32a81ceca74c1 (diff)
downloadchromium_src-438db6aecb5242715010c129ea508a80c16f9fa9.zip
chromium_src-438db6aecb5242715010c129ea508a80c16f9fa9.tar.gz
chromium_src-438db6aecb5242715010c129ea508a80c16f9fa9.tar.bz2
Use the main world script context for mime handler postMessage.
Previously, calling postMessage from an isolated world would use that world's context for calling the proxy frame's postMessage(). This resulted in "Illegal invocation" errors. This CL avoids this problem by using the main world script context when calling postMessage on the proxy frame. BUG=453184 Review URL: https://codereview.chromium.org/861073004 Cr-Commit-Position: refs/heads/master@{#313665}
Diffstat (limited to 'extensions/renderer/guest_view')
-rw-r--r--extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.cc b/extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.cc
index 59f8340..9a7a1bc 100644
--- a/extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.cc
+++ b/extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.cc
@@ -212,6 +212,8 @@ void MimeHandlerViewContainer::PostMessage(v8::Isolate* isolate,
if (!guest_proxy_frame)
return;
+ v8::Context::Scope context_scope(
+ render_frame()->GetWebFrame()->mainWorldScriptContext());
v8::Local<v8::Object> guest_proxy_window =
guest_proxy_frame->mainWorldScriptContext()->Global();
gin::Dictionary window_object(isolate, guest_proxy_window);