summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chrome_browser_main.cc
diff options
context:
space:
mode:
authorerikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-28 12:39:59 +0000
committererikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-28 12:39:59 +0000
commitdd85d45bfb6d0253a088521ceca46405b39f18e2 (patch)
treece611af56fdf0befb5f2e724618cc1c9693a170b /chrome/browser/chrome_browser_main.cc
parent4ad65c3a4747321e98974fa27db4ebab895daaf7 (diff)
downloadchromium_src-dd85d45bfb6d0253a088521ceca46405b39f18e2.zip
chromium_src-dd85d45bfb6d0253a088521ceca46405b39f18e2.tar.gz
chromium_src-dd85d45bfb6d0253a088521ceca46405b39f18e2.tar.bz2
Simplify the ProcessSingleton API.
Instead of having multiple functions that take a callback to initialize a member variable, intitialize the member once during the constructor. This reduces the variability of the internal state of ProcessSingleton. BUG=170726, 170734 Review URL: https://chromiumcodereview.appspot.com/12668027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191131 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chrome_browser_main.cc')
-rw-r--r--chrome/browser/chrome_browser_main.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 15900ce..93042e2 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -480,8 +480,8 @@ bool ProcessSingletonNotificationCallback(
g_browser_process->PlatformSpecificCommandLineProcessing(command_line);
// TODO(erikwright): Consider removing this - AFAIK it is no longer used.
- // Handle the --uninstall-extension startup action. This needs to done here
- // in the process that is running with the target profile, otherwise the
+ // Handle the --uninstall-extension startup action. This needs to done here in
+ // the process that is running with the target profile, otherwise the
// uninstall will fail to unload and remove all components.
if (command_line.HasSwitch(switches::kUninstallExtension)) {
// The uninstall extension switch can't be combined with the profile
@@ -797,7 +797,8 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() {
// Android's first run is done in Java instead of native.
#if !defined(OS_ANDROID)
- process_singleton_.reset(new ProcessSingleton(user_data_dir_));
+ process_singleton_.reset(new ProcessSingleton(
+ user_data_dir_, base::Bind(&ProcessSingletonNotificationCallback)));
// Ensure ProcessSingleton won't process messages too early. It will be
// unlocked in PostBrowserStart().
process_singleton_->Lock(NULL);
@@ -1157,8 +1158,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
// new one. NotifyOtherProcess will currently give the other process up to
// 20 seconds to respond. Note that this needs to be done before we attempt
// to read the profile.
- notify_result_ = process_singleton_->NotifyOtherProcessOrCreate(
- base::Bind(&ProcessSingletonNotificationCallback));
+ notify_result_ = process_singleton_->NotifyOtherProcessOrCreate();
UMA_HISTOGRAM_ENUMERATION("NotifyOtherProcessOrCreate.Result",
notify_result_,
ProcessSingleton::NUM_NOTIFY_RESULTS);