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

Unified Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 7608015: When determining whether or not to swap processes on navigation, check the top frame's URL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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
Index: chrome/renderer/chrome_content_renderer_client.cc
diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc
index 759388adf7a80b9607e5a0df5390d40610a7b2bb..eb8a541c9ba5f6f80fd1d18ca75f82f2d375906a 100644
--- a/chrome/renderer/chrome_content_renderer_client.cc
+++ b/chrome/renderer/chrome_content_renderer_client.cc
@@ -671,13 +671,14 @@ bool ChromeContentRendererClient::CrossesExtensionExtents(WebFrame* frame,
const GURL& new_url) {
const ExtensionSet* extensions = extension_dispatcher_->extensions();
// If the URL is still empty, this is a window.open navigation. Check the
- // opener's URL.
+ // opener's URL. In all cases we use the top frame's URL (as opposed to our
+ // frame's) since that's what determines the type of process.
// TODO(abarth): This code is super sketchy! Are you sure looking at the
// opener is correct here? This appears to let me steal my opener's
// privileges if I can make my URL be "empty."
- GURL old_url(frame->document().url());
+ GURL old_url(frame->top()->document().url());
if (old_url.is_empty() && frame->opener())
- old_url = frame->opener()->document().url();
+ old_url = frame->top()->opener()->top()->document().url();
// If this is a reload, check whether it has the wrong process type. We
// should send it to the browser if it's an extension URL (e.g., hosted app)
« no previous file with comments | « chrome/browser/extensions/app_process_apitest.cc ('k') | chrome/test/data/extensions/api_test/app_process/path1/iframe.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698