diff options
author | rlp@chromium.org <rlp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-15 00:59:12 +0000 |
---|---|---|
committer | rlp@chromium.org <rlp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-15 00:59:12 +0000 |
commit | 4c7c8f9736d77de3de54feb1cbc271613cc1ee3a (patch) | |
tree | 6328d3cc00ebfcdb7f66581d4c798d30793ae6b8 /chrome | |
parent | 67887b7d4d45538767af5c790f981087a198159c (diff) | |
download | chromium_src-4c7c8f9736d77de3de54feb1cbc271613cc1ee3a.zip chromium_src-4c7c8f9736d77de3de54feb1cbc271613cc1ee3a.tar.gz chromium_src-4c7c8f9736d77de3de54feb1cbc271613cc1ee3a.tar.bz2 |
Putting checks for the existence of the browser process in the background_mode_manager constructor. Also checking for the browser process during shutdown.
BUG=90114
TEST=passes existing, does not crash on repro steps
Review URL: http://codereview.chromium.org/7888034
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101207 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/background/background_mode_manager.cc | 5 | ||||
-rw-r--r-- | chrome/browser/ui/browser_list.cc | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/chrome/browser/background/background_mode_manager.cc b/chrome/browser/background/background_mode_manager.cc index e6cd8a0d..045f086 100644 --- a/chrome/browser/background/background_mode_manager.cc +++ b/chrome/browser/background/background_mode_manager.cc @@ -12,6 +12,7 @@ #include "chrome/browser/background/background_application_list_model.h" #include "chrome/browser/background/background_mode_manager.h" #include "chrome/browser/browser_process.h" +#include "chrome/browser/browser_shutdown.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/status_icons/status_icon.h" @@ -135,6 +136,10 @@ BackgroundModeManager::BackgroundModeManager(CommandLine* command_line) keep_alive_for_startup_(false), keep_alive_for_test_(false), current_command_id_(0) { + // We should never start up if there is no browser process or if we are + // currently quitting. + CHECK(g_browser_process != NULL); + CHECK(!browser_shutdown::IsTryingToQuit()); // If background mode is currently disabled, just exit - don't listen for any // notifications. if (IsBackgroundModePermanentlyDisabled(command_line)) diff --git a/chrome/browser/ui/browser_list.cc b/chrome/browser/ui/browser_list.cc index 37b5425..b1245da 100644 --- a/chrome/browser/ui/browser_list.cc +++ b/chrome/browser/ui/browser_list.cc @@ -571,6 +571,12 @@ void BrowserList::StartKeepAlive() { void BrowserList::EndKeepAlive() { DCHECK_GT(keep_alive_count_, 0); keep_alive_count_--; + + DCHECK(g_browser_process); + // Although we should have a browser process, if there is none, + // there is nothing to do. + if (!g_browser_process) return; + // Allow the app to shutdown again. if (!WillKeepAlive()) { g_browser_process->ReleaseModule(); |