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

Unified Diff: chrome/browser/chromeos/first_run/drive_first_run_controller.cc

Issue 2882513005: Propagate opener to BackgroundsContents. (Closed)
Patch Set: Tweaked the comment in DriveWebContentsManager::ShouldCreateWebContents Created 3 years, 6 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/browser/chromeos/first_run/drive_first_run_controller.cc
diff --git a/chrome/browser/chromeos/first_run/drive_first_run_controller.cc b/chrome/browser/chromeos/first_run/drive_first_run_controller.cc
index b69a68859675b7daa28a7ffcdd0944ccd015f911..2c77717b4cbfe87df9fbcd5f68b2886282387f8f 100644
--- a/chrome/browser/chromeos/first_run/drive_first_run_controller.cc
+++ b/chrome/browser/chromeos/first_run/drive_first_run_controller.cc
@@ -163,6 +163,7 @@ class DriveWebContentsManager : public content::WebContentsObserver,
// content::WebContentsDelegate overrides:
bool ShouldCreateWebContents(
content::WebContents* web_contents,
+ content::RenderFrameHost* opener,
content::SiteInstance* source_site_instance,
int32_t route_id,
int32_t main_frame_route_id,
@@ -276,6 +277,7 @@ void DriveWebContentsManager::DidFailLoad(
bool DriveWebContentsManager::ShouldCreateWebContents(
content::WebContents* web_contents,
+ content::RenderFrameHost* opener,
content::SiteInstance* source_site_instance,
int32_t route_id,
int32_t main_frame_route_id,
@@ -306,11 +308,14 @@ bool DriveWebContentsManager::ShouldCreateWebContents(
base::UTF8ToUTF16(app_id_))) {
return false;
}
- // We are creating a new SiteInstance (and thus a new renderer process) here,
- // so we must not use |route_id|, etc, which are IDs in a different process.
+ // drive_first_run/app/manifest.json sets allow_js_access to false and
+ // therefore we are creating a new SiteInstance (and thus a new renderer
+ // process) here, so we must use MSG_ROUTING_NONE and we cannot pass the
+ // opener (similarily to how allow_js_access:false is handled in
+ // Browser::MaybeCreateBackgroundContents).
BackgroundContents* contents =
background_contents_service->CreateBackgroundContents(
- content::SiteInstance::Create(profile_), MSG_ROUTING_NONE,
+ content::SiteInstance::Create(profile_), nullptr, MSG_ROUTING_NONE,
MSG_ROUTING_NONE, MSG_ROUTING_NONE, profile_, frame_name,
base::ASCIIToUTF16(app_id_), partition_id, session_storage_namespace);

Powered by Google App Engine
This is Rietveld 408576698