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

Unified Diff: chrome/browser/extensions/extension_view_host.cc

Issue 1478863002: Handle cross-process transfers properly in ExtensionViewHost::OpenURLFromTab. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@isolate-extensions-OpenURLFromTab
Patch Set: Add test Created 5 years 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/browser/extensions/extension_view_host.cc
diff --git a/chrome/browser/extensions/extension_view_host.cc b/chrome/browser/extensions/extension_view_host.cc
index eca369a6ed7c47d5ee81fbd1e1037ac6243a0bfd..d0687d83123b5dd164685ef4516f37b3656a62b2 100644
--- a/chrome/browser/extensions/extension_view_host.cc
+++ b/chrome/browser/extensions/extension_view_host.cc
@@ -146,6 +146,16 @@ bool ExtensionViewHost::IsBackgroundPage() const {
WebContents* ExtensionViewHost::OpenURLFromTab(
WebContents* source,
const OpenURLParams& params) {
+ // Supporting CURRENT_TAB is necessary for renderer-initiated, cross-site
+ // frame navigations with --isolate-extensions or --site-per-process. These
+ // navigations cause cross-process transfers which utilize this function with
+ // CURRENT_TAB. This means that the navigation should happen in the same
+ // ExtensionViewHost window.
+ bool is_transfer =
+ params.transferred_global_request_id != content::GlobalRequestID();
+ if (params.disposition == CURRENT_TAB && is_transfer)
+ return WebContentsDelegate::OpenURLFromTab(host_contents(), params);
+
// Whitelist the dispositions we will allow to be opened.
switch (params.disposition) {
case SINGLETON_TAB:

Powered by Google App Engine
This is Rietveld 408576698