diff options
author | sammc <sammc@chromium.org> | 2015-01-28 20:17:06 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-29 04:17:49 +0000 |
commit | 438db6aecb5242715010c129ea508a80c16f9fa9 (patch) | |
tree | f3f26059815d6f846d238ee4b79ed65301bf2e72 /extensions/renderer/guest_view | |
parent | 65a326a734d413e2124c6782b2e32a81ceca74c1 (diff) | |
download | chromium_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.cc | 2 |
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); |