Commit ae2652f5 authored by Evan Stade's avatar Evan Stade Committed by Commit Bot

Remove unnecessary Profile parameters from BackgroundContentsService

The passed profile always matches |profile_|, so just remove it.

Bug: none
Change-Id: I29940c6ab54e9e9dbd7b1ed1833ab8893a2212d6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1832611Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701568}
parent 29b1bb2b
...@@ -126,7 +126,7 @@ class CrashNotificationDelegate : public message_center::NotificationDelegate { ...@@ -126,7 +126,7 @@ class CrashNotificationDelegate : public message_center::NotificationDelegate {
BackgroundContentsService* service = BackgroundContentsService* service =
BackgroundContentsServiceFactory::GetForProfile(profile); BackgroundContentsServiceFactory::GetForProfile(profile);
if (!service->GetAppBackgroundContents(extension_id)) if (!service->GetAppBackgroundContents(extension_id))
service->LoadBackgroundContentsForExtension(profile, extension_id); service->LoadBackgroundContentsForExtension(extension_id);
} else if (is_platform_app) { } else if (is_platform_app) {
apps::AppLoadService::Get(profile)->RestartApplication(extension_id); apps::AppLoadService::Get(profile)->RestartApplication(extension_id);
} else { } else {
...@@ -327,8 +327,8 @@ void BackgroundContentsService::StartObserving() { ...@@ -327,8 +327,8 @@ void BackgroundContentsService::StartObserving() {
} }
void BackgroundContentsService::OnExtensionSystemReady() { void BackgroundContentsService::OnExtensionSystemReady() {
LoadBackgroundContentsFromManifests(profile_); LoadBackgroundContentsFromManifests();
LoadBackgroundContentsFromPrefs(profile_); LoadBackgroundContentsFromPrefs();
SendChangeNotification(); SendChangeNotification();
} }
...@@ -358,8 +358,7 @@ void BackgroundContentsService::OnExtensionLoaded( ...@@ -358,8 +358,7 @@ void BackgroundContentsService::OnExtensionLoaded(
// Now load the manifest-specified background page. If service isn't // Now load the manifest-specified background page. If service isn't
// ready, then the background page will be loaded from the // ready, then the background page will be loaded from the
// EXTENSIONS_READY callback. // EXTENSIONS_READY callback.
LoadBackgroundContents(profile, LoadBackgroundContents(BackgroundInfo::GetBackgroundURL(extension),
BackgroundInfo::GetBackgroundURL(extension),
"background", extension->id()); "background", extension->id());
} }
} }
...@@ -434,8 +433,7 @@ void BackgroundContentsService::OnExtensionUninstalled( ...@@ -434,8 +433,7 @@ void BackgroundContentsService::OnExtensionUninstalled(
} }
void BackgroundContentsService::RestartForceInstalledExtensionOnCrash( void BackgroundContentsService::RestartForceInstalledExtensionOnCrash(
const Extension* extension, const Extension* extension) {
Profile* profile) {
int restart_delay = restart_delay_in_ms_; int restart_delay = restart_delay_in_ms_;
// If the extension was a component extension, use exponential backoff when // If the extension was a component extension, use exponential backoff when
...@@ -461,13 +459,12 @@ void BackgroundContentsService::RestartForceInstalledExtensionOnCrash( ...@@ -461,13 +459,12 @@ void BackgroundContentsService::RestartForceInstalledExtensionOnCrash(
} }
base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
FROM_HERE, base::BindOnce(&ReloadExtension, extension->id(), profile), FROM_HERE, base::BindOnce(&ReloadExtension, extension->id(), profile_),
base::TimeDelta::FromMilliseconds(restart_delay)); base::TimeDelta::FromMilliseconds(restart_delay));
} }
// Loads all background contents whose urls have been stored in prefs. // Loads all background contents whose urls have been stored in prefs.
void BackgroundContentsService::LoadBackgroundContentsFromPrefs( void BackgroundContentsService::LoadBackgroundContentsFromPrefs() {
Profile* profile) {
if (!prefs_) if (!prefs_)
return; return;
const base::DictionaryValue* contents = const base::DictionaryValue* contents =
...@@ -475,7 +472,7 @@ void BackgroundContentsService::LoadBackgroundContentsFromPrefs( ...@@ -475,7 +472,7 @@ void BackgroundContentsService::LoadBackgroundContentsFromPrefs(
if (!contents) if (!contents)
return; return;
extensions::ExtensionRegistry* extension_registry = extensions::ExtensionRegistry* extension_registry =
extensions::ExtensionRegistry::Get(profile); extensions::ExtensionRegistry::Get(profile_);
DCHECK(extension_registry); DCHECK(extension_registry);
for (base::DictionaryValue::Iterator it(*contents); !it.IsAtEnd(); for (base::DictionaryValue::Iterator it(*contents); !it.IsAtEnd();
it.Advance()) { it.Advance()) {
...@@ -494,7 +491,7 @@ void BackgroundContentsService::LoadBackgroundContentsFromPrefs( ...@@ -494,7 +491,7 @@ void BackgroundContentsService::LoadBackgroundContentsFromPrefs(
// load the next one. // load the next one.
continue; continue;
} }
LoadBackgroundContentsFromDictionary(profile, it.key(), contents); LoadBackgroundContentsFromDictionary(it.key(), contents);
} }
} }
...@@ -520,15 +517,14 @@ void BackgroundContentsService::MaybeClearBackoffEntry( ...@@ -520,15 +517,14 @@ void BackgroundContentsService::MaybeClearBackoffEntry(
} }
void BackgroundContentsService::LoadBackgroundContentsForExtension( void BackgroundContentsService::LoadBackgroundContentsForExtension(
Profile* profile,
const std::string& extension_id) { const std::string& extension_id) {
// First look if the manifest specifies a background page. // First look if the manifest specifies a background page.
const Extension* extension = const Extension* extension =
extensions::ExtensionRegistry::Get(profile)->GetExtensionById( extensions::ExtensionRegistry::Get(profile_)->GetExtensionById(
extension_id, extensions::ExtensionRegistry::ENABLED); extension_id, extensions::ExtensionRegistry::ENABLED);
DCHECK(!extension || extension->is_hosted_app()); DCHECK(!extension || extension->is_hosted_app());
if (extension && BackgroundInfo::HasBackgroundPage(extension)) { if (extension && BackgroundInfo::HasBackgroundPage(extension)) {
LoadBackgroundContents(profile, BackgroundInfo::GetBackgroundURL(extension), LoadBackgroundContents(BackgroundInfo::GetBackgroundURL(extension),
"background", extension->id()); "background", extension->id());
return; return;
} }
...@@ -540,15 +536,14 @@ void BackgroundContentsService::LoadBackgroundContentsForExtension( ...@@ -540,15 +536,14 @@ void BackgroundContentsService::LoadBackgroundContentsForExtension(
prefs_->GetDictionary(prefs::kRegisteredBackgroundContents); prefs_->GetDictionary(prefs::kRegisteredBackgroundContents);
if (!contents) if (!contents)
return; return;
LoadBackgroundContentsFromDictionary(profile, extension_id, contents); LoadBackgroundContentsFromDictionary(extension_id, contents);
} }
void BackgroundContentsService::LoadBackgroundContentsFromDictionary( void BackgroundContentsService::LoadBackgroundContentsFromDictionary(
Profile* profile,
const std::string& extension_id, const std::string& extension_id,
const base::DictionaryValue* contents) { const base::DictionaryValue* contents) {
extensions::ExtensionService* extensions_service = extensions::ExtensionService* extensions_service =
extensions::ExtensionSystem::Get(profile)->extension_service(); extensions::ExtensionSystem::Get(profile_)->extension_service();
DCHECK(extensions_service); DCHECK(extensions_service);
const base::DictionaryValue* dict; const base::DictionaryValue* dict;
...@@ -560,24 +555,21 @@ void BackgroundContentsService::LoadBackgroundContentsFromDictionary( ...@@ -560,24 +555,21 @@ void BackgroundContentsService::LoadBackgroundContentsFromDictionary(
std::string url; std::string url;
dict->GetString(kUrlKey, &url); dict->GetString(kUrlKey, &url);
dict->GetString(kFrameNameKey, &frame_name); dict->GetString(kFrameNameKey, &frame_name);
LoadBackgroundContents(profile, GURL(url), frame_name, extension_id); LoadBackgroundContents(GURL(url), frame_name, extension_id);
} }
void BackgroundContentsService::LoadBackgroundContentsFromManifests( void BackgroundContentsService::LoadBackgroundContentsFromManifests() {
Profile* profile) {
for (const scoped_refptr<const extensions::Extension>& extension : for (const scoped_refptr<const extensions::Extension>& extension :
extensions::ExtensionRegistry::Get(profile)->enabled_extensions()) { extensions::ExtensionRegistry::Get(profile_)->enabled_extensions()) {
if (extension->is_hosted_app() && if (extension->is_hosted_app() &&
BackgroundInfo::HasBackgroundPage(extension.get())) { BackgroundInfo::HasBackgroundPage(extension.get())) {
LoadBackgroundContents(profile, LoadBackgroundContents(BackgroundInfo::GetBackgroundURL(extension.get()),
BackgroundInfo::GetBackgroundURL(extension.get()),
"background", extension->id()); "background", extension->id());
} }
} }
} }
void BackgroundContentsService::LoadBackgroundContents( void BackgroundContentsService::LoadBackgroundContents(
Profile* profile,
const GURL& url, const GURL& url,
const std::string& frame_name, const std::string& frame_name,
const std::string& application_id) { const std::string& application_id) {
...@@ -590,8 +582,8 @@ void BackgroundContentsService::LoadBackgroundContents( ...@@ -590,8 +582,8 @@ void BackgroundContentsService::LoadBackgroundContents(
DVLOG(1) << "Loading background content url: " << url; DVLOG(1) << "Loading background content url: " << url;
BackgroundContents* contents = CreateBackgroundContents( BackgroundContents* contents = CreateBackgroundContents(
SiteInstance::CreateForURL(profile, url), nullptr, MSG_ROUTING_NONE, SiteInstance::CreateForURL(profile_, url), nullptr, MSG_ROUTING_NONE,
MSG_ROUTING_NONE, MSG_ROUTING_NONE, profile, frame_name, application_id, MSG_ROUTING_NONE, MSG_ROUTING_NONE, frame_name, application_id,
std::string(), nullptr); std::string(), nullptr);
contents->CreateRenderViewSoon(url); contents->CreateRenderViewSoon(url);
...@@ -603,7 +595,6 @@ BackgroundContents* BackgroundContentsService::CreateBackgroundContents( ...@@ -603,7 +595,6 @@ BackgroundContents* BackgroundContentsService::CreateBackgroundContents(
int32_t routing_id, int32_t routing_id,
int32_t main_frame_route_id, int32_t main_frame_route_id,
int32_t main_frame_widget_route_id, int32_t main_frame_widget_route_id,
Profile* profile,
const std::string& frame_name, const std::string& frame_name,
const std::string& application_id, const std::string& application_id,
const std::string& partition_id, const std::string& partition_id,
...@@ -617,7 +608,7 @@ BackgroundContents* BackgroundContentsService::CreateBackgroundContents( ...@@ -617,7 +608,7 @@ BackgroundContents* BackgroundContentsService::CreateBackgroundContents(
// to external listeners. // to external listeners.
BackgroundContentsOpenedDetails details = {contents, frame_name, BackgroundContentsOpenedDetails details = {contents, frame_name,
application_id}; application_id};
BackgroundContentsOpened(&details, profile); BackgroundContentsOpened(&details);
for (auto& observer : observers_) for (auto& observer : observers_)
observer.OnBackgroundContentsOpened(details); observer.OnBackgroundContentsOpened(details);
...@@ -680,15 +671,14 @@ void BackgroundContentsService::ShutdownAssociatedBackgroundContents( ...@@ -680,15 +671,14 @@ void BackgroundContentsService::ShutdownAssociatedBackgroundContents(
} }
void BackgroundContentsService::BackgroundContentsOpened( void BackgroundContentsService::BackgroundContentsOpened(
BackgroundContentsOpenedDetails* details, BackgroundContentsOpenedDetails* details) {
Profile* profile) {
// Add the passed object to our list. Should not already be tracked. // Add the passed object to our list. Should not already be tracked.
DCHECK(!IsTracked(details->contents)); DCHECK(!IsTracked(details->contents));
DCHECK(!details->application_id.empty()); DCHECK(!details->application_id.empty());
contents_map_[details->application_id].contents = details->contents; contents_map_[details->application_id].contents = details->contents;
contents_map_[details->application_id].frame_name = details->frame_name; contents_map_[details->application_id].frame_name = details->frame_name;
CloseBalloon(details->application_id, profile); CloseBalloon(details->application_id, profile_);
} }
// Used by test code and debug checks to verify whether a given // Used by test code and debug checks to verify whether a given
...@@ -796,6 +786,6 @@ void BackgroundContentsService::HandleExtensionCrashed( ...@@ -796,6 +786,6 @@ void BackgroundContentsService::HandleExtensionCrashed(
ShowBalloon(extension, profile_); ShowBalloon(extension, profile_);
} else { } else {
// Restart the extension. // Restart the extension.
RestartForceInstalledExtensionOnCrash(extension, profile_); RestartForceInstalledExtensionOnCrash(extension);
} }
} }
...@@ -118,16 +118,13 @@ class BackgroundContentsService : private content::NotificationObserver, ...@@ -118,16 +118,13 @@ class BackgroundContentsService : private content::NotificationObserver,
// Creates a new BackgroundContents using the passed |site| and // Creates a new BackgroundContents using the passed |site| and
// the |route_id| and begins tracking the object internally so it can be // the |route_id| and begins tracking the object internally so it can be
// shutdown if the parent application is uninstalled. // shutdown if the parent application is uninstalled.
// A BACKGROUND_CONTENTS_OPENED notification will be generated with the passed // Observers will receive a OnBackgroundContentsOpened call.
// |frame_name| and |application_id| values, using the passed |profile| as the
// Source.
BackgroundContents* CreateBackgroundContents( BackgroundContents* CreateBackgroundContents(
scoped_refptr<content::SiteInstance> site, scoped_refptr<content::SiteInstance> site,
content::RenderFrameHost* opener, content::RenderFrameHost* opener,
int32_t route_id, int32_t route_id,
int32_t main_frame_route_id, int32_t main_frame_route_id,
int32_t main_frame_widget_route_id, int32_t main_frame_widget_route_id,
Profile* profile,
const std::string& frame_name, const std::string& frame_name,
const std::string& application_id, const std::string& application_id,
const std::string& partition_id, const std::string& partition_id,
...@@ -137,8 +134,7 @@ class BackgroundContentsService : private content::NotificationObserver, ...@@ -137,8 +134,7 @@ class BackgroundContentsService : private content::NotificationObserver,
// If the manifest doesn't specify one, then load the BackgroundContents // If the manifest doesn't specify one, then load the BackgroundContents
// registered in the pref. This is typically used to reload a crashed // registered in the pref. This is typically used to reload a crashed
// background page. // background page.
void LoadBackgroundContentsForExtension(Profile* profile, void LoadBackgroundContentsForExtension(const std::string& extension_id);
const std::string& extension_id);
private: private:
friend class BackgroundContentsServiceTest; friend class BackgroundContentsServiceTest;
...@@ -172,34 +168,30 @@ class BackgroundContentsService : private content::NotificationObserver, ...@@ -172,34 +168,30 @@ class BackgroundContentsService : private content::NotificationObserver,
// Restarts a force-installed app/extension after a crash. // Restarts a force-installed app/extension after a crash.
void RestartForceInstalledExtensionOnCrash( void RestartForceInstalledExtensionOnCrash(
const extensions::Extension* extension, const extensions::Extension* extension);
Profile* profile);
// Loads all registered BackgroundContents at startup. // Loads all registered BackgroundContents at startup.
void LoadBackgroundContentsFromPrefs(Profile* profile); void LoadBackgroundContentsFromPrefs();
// Load a BackgroundContent; the settings are read from the provided // Load a BackgroundContent; the settings are read from the provided
// dictionary. // dictionary.
void LoadBackgroundContentsFromDictionary( void LoadBackgroundContentsFromDictionary(
Profile* profile,
const std::string& extension_id, const std::string& extension_id,
const base::DictionaryValue* contents); const base::DictionaryValue* contents);
// Load the manifest-specified BackgroundContents for all apps for the // Load the manifest-specified BackgroundContents for all apps for the
// profile. // profile.
void LoadBackgroundContentsFromManifests(Profile* profile); void LoadBackgroundContentsFromManifests();
// Creates a single BackgroundContents associated with the specified |appid|, // Creates a single BackgroundContents associated with the specified |appid|,
// creates an associated RenderView with the name specified by |frame_name|, // creates an associated RenderView with the name specified by |frame_name|,
// and navigates to the passed |url|. // and navigates to the passed |url|.
void LoadBackgroundContents(Profile* profile, void LoadBackgroundContents(const GURL& url,
const GURL& url,
const std::string& frame_name, const std::string& frame_name,
const std::string& appid); const std::string& appid);
// Invoked when a new BackgroundContents is opened. // Invoked when a new BackgroundContents is opened.
void BackgroundContentsOpened(BackgroundContentsOpenedDetails* details, void BackgroundContentsOpened(BackgroundContentsOpenedDetails* details);
Profile* profile);
// Registers the |contents->GetURL()| to be run at startup. Only happens for // Registers the |contents->GetURL()| to be run at startup. Only happens for
// the first navigation after window.open() (future calls to // the first navigation after window.open() (future calls to
......
...@@ -68,15 +68,14 @@ class BackgroundContentsServiceTest : public testing::Test { ...@@ -68,15 +68,14 @@ class BackgroundContentsServiceTest : public testing::Test {
class MockBackgroundContents : public BackgroundContents { class MockBackgroundContents : public BackgroundContents {
public: public:
MockBackgroundContents(BackgroundContentsService* service, MockBackgroundContents(BackgroundContentsService* service,
Profile* profile,
const std::string& id) const std::string& id)
: service_(service), appid_(id), profile_(profile) {} : service_(service), appid_(id) {}
MockBackgroundContents(BackgroundContentsService* service, Profile* profile) explicit MockBackgroundContents(BackgroundContentsService* service)
: MockBackgroundContents(service, profile, "app_id") {} : MockBackgroundContents(service, "app_id") {}
void SendOpenedNotification() { void SendOpenedNotification() {
BackgroundContentsOpenedDetails details = {this, "background", appid_}; BackgroundContentsOpenedDetails details = {this, "background", appid_};
service_->BackgroundContentsOpened(&details, profile_); service_->BackgroundContentsOpened(&details);
} }
void Navigate(GURL url) { void Navigate(GURL url) {
...@@ -104,9 +103,6 @@ class MockBackgroundContents : public BackgroundContents { ...@@ -104,9 +103,6 @@ class MockBackgroundContents : public BackgroundContents {
// The ID of our parent application // The ID of our parent application
std::string appid_; std::string appid_;
// Parent profile
Profile* profile_;
DISALLOW_COPY_AND_ASSIGN(MockBackgroundContents); DISALLOW_COPY_AND_ASSIGN(MockBackgroundContents);
}; };
...@@ -154,8 +150,7 @@ TEST_F(BackgroundContentsServiceTest, Create) { ...@@ -154,8 +150,7 @@ TEST_F(BackgroundContentsServiceTest, Create) {
TEST_F(BackgroundContentsServiceTest, BackgroundContentsCreateDestroy) { TEST_F(BackgroundContentsServiceTest, BackgroundContentsCreateDestroy) {
TestingProfile profile; TestingProfile profile;
BackgroundContentsService service(&profile, command_line_.get()); BackgroundContentsService service(&profile, command_line_.get());
MockBackgroundContents* contents = MockBackgroundContents* contents = new MockBackgroundContents(&service);
new MockBackgroundContents(&service, &profile);
EXPECT_FALSE(service.IsTracked(contents)); EXPECT_FALSE(service.IsTracked(contents));
contents->SendOpenedNotification(); contents->SendOpenedNotification();
EXPECT_TRUE(service.IsTracked(contents)); EXPECT_TRUE(service.IsTracked(contents));
...@@ -172,7 +167,7 @@ TEST_F(BackgroundContentsServiceTest, BackgroundContentsUrlAdded) { ...@@ -172,7 +167,7 @@ TEST_F(BackgroundContentsServiceTest, BackgroundContentsUrlAdded) {
GURL url2("http://a/"); GURL url2("http://a/");
{ {
std::unique_ptr<MockBackgroundContents> contents( std::unique_ptr<MockBackgroundContents> contents(
new MockBackgroundContents(&service, &profile)); new MockBackgroundContents(&service));
EXPECT_EQ(0U, GetPrefs(&profile)->size()); EXPECT_EQ(0U, GetPrefs(&profile)->size());
contents->SendOpenedNotification(); contents->SendOpenedNotification();
...@@ -194,8 +189,7 @@ TEST_F(BackgroundContentsServiceTest, BackgroundContentsUrlAddedAndClosed) { ...@@ -194,8 +189,7 @@ TEST_F(BackgroundContentsServiceTest, BackgroundContentsUrlAddedAndClosed) {
BackgroundContentsService service(&profile, command_line_.get()); BackgroundContentsService service(&profile, command_line_.get());
GURL url("http://a/"); GURL url("http://a/");
MockBackgroundContents* contents = MockBackgroundContents* contents = new MockBackgroundContents(&service);
new MockBackgroundContents(&service, &profile);
EXPECT_EQ(0U, GetPrefs(&profile)->size()); EXPECT_EQ(0U, GetPrefs(&profile)->size());
contents->SendOpenedNotification(); contents->SendOpenedNotification();
contents->Navigate(url); contents->Navigate(url);
...@@ -216,7 +210,7 @@ TEST_F(BackgroundContentsServiceTest, RestartBackgroundContents) { ...@@ -216,7 +210,7 @@ TEST_F(BackgroundContentsServiceTest, RestartBackgroundContents) {
GURL url("http://a/"); GURL url("http://a/");
{ {
std::unique_ptr<MockBackgroundContents> contents( std::unique_ptr<MockBackgroundContents> contents(
new MockBackgroundContents(&service, &profile, "appid")); new MockBackgroundContents(&service, "appid"));
contents->SendOpenedNotification(); contents->SendOpenedNotification();
contents->Navigate(url); contents->Navigate(url);
EXPECT_EQ(1U, GetPrefs(&profile)->size()); EXPECT_EQ(1U, GetPrefs(&profile)->size());
...@@ -229,7 +223,7 @@ TEST_F(BackgroundContentsServiceTest, RestartBackgroundContents) { ...@@ -229,7 +223,7 @@ TEST_F(BackgroundContentsServiceTest, RestartBackgroundContents) {
// Reopen the BackgroundContents to the same URL, we should not register the // Reopen the BackgroundContents to the same URL, we should not register the
// URL again. // URL again.
std::unique_ptr<MockBackgroundContents> contents( std::unique_ptr<MockBackgroundContents> contents(
new MockBackgroundContents(&service, &profile, "appid")); new MockBackgroundContents(&service, "appid"));
contents->SendOpenedNotification(); contents->SendOpenedNotification();
contents->Navigate(url); contents->Navigate(url);
EXPECT_EQ(1U, GetPrefs(&profile)->size()); EXPECT_EQ(1U, GetPrefs(&profile)->size());
...@@ -245,9 +239,9 @@ TEST_F(BackgroundContentsServiceTest, TestApplicationIDLinkage) { ...@@ -245,9 +239,9 @@ TEST_F(BackgroundContentsServiceTest, TestApplicationIDLinkage) {
EXPECT_EQ(NULL, service.GetAppBackgroundContents("appid")); EXPECT_EQ(NULL, service.GetAppBackgroundContents("appid"));
MockBackgroundContents* contents = MockBackgroundContents* contents =
new MockBackgroundContents(&service, &profile, "appid"); new MockBackgroundContents(&service, "appid");
std::unique_ptr<MockBackgroundContents> contents2( std::unique_ptr<MockBackgroundContents> contents2(
new MockBackgroundContents(&service, &profile, "appid2")); new MockBackgroundContents(&service, "appid2"));
contents->SendOpenedNotification(); contents->SendOpenedNotification();
EXPECT_EQ(contents, service.GetAppBackgroundContents(contents->appid())); EXPECT_EQ(contents, service.GetAppBackgroundContents(contents->appid()));
contents2->SendOpenedNotification(); contents2->SendOpenedNotification();
......
...@@ -270,8 +270,8 @@ bool DriveWebContentsManager::ShouldCreateWebContents( ...@@ -270,8 +270,8 @@ bool DriveWebContentsManager::ShouldCreateWebContents(
BackgroundContents* contents = BackgroundContents* contents =
background_contents_service->CreateBackgroundContents( background_contents_service->CreateBackgroundContents(
content::SiteInstance::Create(profile_), nullptr, MSG_ROUTING_NONE, content::SiteInstance::Create(profile_), nullptr, MSG_ROUTING_NONE,
MSG_ROUTING_NONE, MSG_ROUTING_NONE, profile_, frame_name, app_id_, MSG_ROUTING_NONE, MSG_ROUTING_NONE, frame_name, app_id_, partition_id,
partition_id, session_storage_namespace); session_storage_namespace);
contents->web_contents()->GetController().LoadURL( contents->web_contents()->GetController().LoadURL(
target_url, target_url,
......
...@@ -2858,8 +2858,8 @@ BackgroundContents* Browser::CreateBackgroundContents( ...@@ -2858,8 +2858,8 @@ BackgroundContents* Browser::CreateBackgroundContents(
if (allow_js_access) { if (allow_js_access) {
return service->CreateBackgroundContents( return service->CreateBackgroundContents(
source_site_instance, opener, route_id, main_frame_route_id, source_site_instance, opener, route_id, main_frame_route_id,
main_frame_widget_route_id, profile_, frame_name, extension->id(), main_frame_widget_route_id, frame_name, extension->id(), partition_id,
partition_id, session_storage_namespace); session_storage_namespace);
} }
// If script access is not allowed, create the the background contents in a // If script access is not allowed, create the the background contents in a
...@@ -2868,8 +2868,8 @@ BackgroundContents* Browser::CreateBackgroundContents( ...@@ -2868,8 +2868,8 @@ BackgroundContents* Browser::CreateBackgroundContents(
// process. // process.
BackgroundContents* contents = service->CreateBackgroundContents( BackgroundContents* contents = service->CreateBackgroundContents(
content::SiteInstance::Create(source_site_instance->GetBrowserContext()), content::SiteInstance::Create(source_site_instance->GetBrowserContext()),
nullptr, MSG_ROUTING_NONE, MSG_ROUTING_NONE, MSG_ROUTING_NONE, profile_, nullptr, MSG_ROUTING_NONE, MSG_ROUTING_NONE, MSG_ROUTING_NONE, frame_name,
frame_name, extension->id(), partition_id, session_storage_namespace); extension->id(), partition_id, session_storage_namespace);
// When a separate process is used, the original renderer cannot access the // When a separate process is used, the original renderer cannot access the
// new window later, thus we need to navigate the window now. // new window later, thus we need to navigate the window now.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment