diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-19 20:42:52 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-19 20:42:52 +0000 |
commit | 3dab5052298c6f98f7ba11ad6d939ec48c94a5a7 (patch) | |
tree | c24385257217893a4bd344afa4e44d1d550b44d0 /chrome/renderer/extensions | |
parent | 3486ec6dd26c1e40766afa1b54afbc727b00d5d6 (diff) | |
download | chromium_src-3dab5052298c6f98f7ba11ad6d939ec48c94a5a7.zip chromium_src-3dab5052298c6f98f7ba11ad6d939ec48c94a5a7.tar.gz chromium_src-3dab5052298c6f98f7ba11ad6d939ec48c94a5a7.tar.bz2 |
Revert 59889 - Fix regression introduced by
http://src.chromium.org/viewvc/chrome?view=rev&revision=57788
Add a delegate interface so that chromium have more fine-grained control over
whether a V8 extension is injected into a script context. This is the
chromium-side change of webkit bug
https://bugs.webkit.org/show_bug.cgi?id=45721
BUG=37290
TEST=covered by unit tests
Review URL: http://codereview.chromium.org/3398001
TBR=mpcomplete@chromium.org
Review URL: http://codereview.chromium.org/3464003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59906 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/extensions')
-rw-r--r-- | chrome/renderer/extensions/event_bindings.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/chrome/renderer/extensions/event_bindings.cc b/chrome/renderer/extensions/event_bindings.cc index e0beb68..54edbb4 100644 --- a/chrome/renderer/extensions/event_bindings.cc +++ b/chrome/renderer/extensions/event_bindings.cc @@ -262,11 +262,18 @@ void EventBindings::HandleContextCreated(WebFrame* frame, bool content_script) { GURL url = ds->request().url(); std::string extension_id = ExtensionRendererInfo::GetIdByURL(url); - if (!ExtensionRendererInfo::ExtensionBindingsAllowed(url) && + // Note: because process isolation doesn't work correcly with redirects, + // it is possible that a page that IS in an extension process won't have + // bindings setup for it, so we must also check IsExtensionProcess, otherwise + // we'll attempt to invoke a JS function that doesn't exist. + // Fixing crbug.com/53610 should fix this as well. + RenderThread* current_thread = RenderThread::current(); + if ((!current_thread || + !current_thread->IsExtensionProcess() || + !ExtensionRendererInfo::ExtensionBindingsAllowed(url)) && !content_script) { - // This context is a regular non-extension web page or an unprivileged - // chrome app. Ignore it. We only care about content scripts and extension - // frames. + // This context is a regular non-extension web page. Ignore it. We only + // care about content scripts and extension frames. // (Unless we're in unit tests, in which case we don't care what the URL // is). DCHECK(frame_context.IsEmpty() || frame_context == context); |