73 lines
3.2 KiB
Diff
73 lines
3.2 KiB
Diff
diff --git chrome/browser/browser_process.h chrome/browser/browser_process.h
|
|
index 9c5260579cf05..021b4bc3c5499 100644
|
|
--- chrome/browser/browser_process.h
|
|
+++ chrome/browser/browser_process.h
|
|
@@ -202,9 +202,9 @@ class BrowserProcess {
|
|
virtual DownloadStatusUpdater* download_status_updater() = 0;
|
|
virtual DownloadRequestLimiter* download_request_limiter() = 0;
|
|
|
|
+#if BUILDFLAG(ENABLE_BACKGROUND_MODE)
|
|
// Returns the object that manages background applications.
|
|
virtual BackgroundModeManager* background_mode_manager() = 0;
|
|
-#if BUILDFLAG(ENABLE_BACKGROUND_MODE)
|
|
virtual void set_background_mode_manager_for_test(
|
|
std::unique_ptr<BackgroundModeManager> manager) = 0;
|
|
#endif
|
|
diff --git chrome/browser/browser_process_impl.cc chrome/browser/browser_process_impl.cc
|
|
index 73dc09a7ee5af..f7ab03c788969 100644
|
|
--- chrome/browser/browser_process_impl.cc
|
|
+++ chrome/browser/browser_process_impl.cc
|
|
@@ -1032,18 +1032,14 @@ DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() {
|
|
return download_request_limiter_.get();
|
|
}
|
|
|
|
-BackgroundModeManager* BrowserProcessImpl::background_mode_manager() {
|
|
#if BUILDFLAG(ENABLE_BACKGROUND_MODE)
|
|
+BackgroundModeManager* BrowserProcessImpl::background_mode_manager() {
|
|
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
|
if (!background_mode_manager_)
|
|
CreateBackgroundModeManager();
|
|
return background_mode_manager_.get();
|
|
-#else
|
|
- return nullptr;
|
|
-#endif
|
|
}
|
|
|
|
-#if BUILDFLAG(ENABLE_BACKGROUND_MODE)
|
|
void BrowserProcessImpl::set_background_mode_manager_for_test(
|
|
std::unique_ptr<BackgroundModeManager> manager) {
|
|
background_mode_manager_ = std::move(manager);
|
|
diff --git chrome/browser/browser_process_impl.h chrome/browser/browser_process_impl.h
|
|
index 701b6cc46045c..6ea15c988c15b 100644
|
|
--- chrome/browser/browser_process_impl.h
|
|
+++ chrome/browser/browser_process_impl.h
|
|
@@ -184,8 +184,8 @@ class BrowserProcessImpl : public BrowserProcess,
|
|
void SetApplicationLocale(const std::string& actual_locale) override;
|
|
DownloadStatusUpdater* download_status_updater() override;
|
|
DownloadRequestLimiter* download_request_limiter() override;
|
|
- BackgroundModeManager* background_mode_manager() override;
|
|
#if BUILDFLAG(ENABLE_BACKGROUND_MODE)
|
|
+ BackgroundModeManager* background_mode_manager() override;
|
|
void set_background_mode_manager_for_test(
|
|
std::unique_ptr<BackgroundModeManager> manager) override;
|
|
#endif
|
|
diff --git chrome/browser/lifetime/browser_close_manager.cc chrome/browser/lifetime/browser_close_manager.cc
|
|
index 1fbc225de7b84..55847e48ed0c2 100644
|
|
--- chrome/browser/lifetime/browser_close_manager.cc
|
|
+++ chrome/browser/lifetime/browser_close_manager.cc
|
|
@@ -157,12 +157,14 @@ void BrowserCloseManager::CloseBrowsers() {
|
|
// exit can restore all browsers open before exiting.
|
|
ProfileManager::ShutdownSessionServices();
|
|
#endif
|
|
+#if BUILDFLAG(ENABLE_BACKGROUND_MODE)
|
|
if (!browser_shutdown::IsTryingToQuit()) {
|
|
BackgroundModeManager* background_mode_manager =
|
|
g_browser_process->background_mode_manager();
|
|
if (background_mode_manager)
|
|
background_mode_manager->SuspendBackgroundMode();
|
|
}
|
|
+#endif
|
|
|
|
// Make a copy of the BrowserList to simplify the case where we need to
|
|
// destroy a Browser during the loop.
|