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

Unified Diff: chrome/app/chrome_exe_main_win.cc

Issue 14617003: Make chrome.exe rendezvous with existing chrome process earlier. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/chrome_process_finder_win.h » ('j') | chrome/chrome_browser.gypi » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/chrome_exe_main_win.cc
diff --git a/chrome/app/chrome_exe_main_win.cc b/chrome/app/chrome_exe_main_win.cc
index 237784d5649622f84f7821ae38db1fe21b19d090..c4264511d031c9856809a7769d9cf7a92d2dc8c1 100644
--- a/chrome/app/chrome_exe_main_win.cc
+++ b/chrome/app/chrome_exe_main_win.cc
@@ -7,9 +7,13 @@
#include "base/at_exit.h"
#include "base/command_line.h"
+#include "base/files/file_path.h"
#include "chrome/app/breakpad_win.h"
#include "chrome/app/client_util.h"
#include "chrome/app/metro_driver_win.h"
+#include "chrome/browser/chrome_process_finder_win.h"
+#include "chrome/common/chrome_paths_internal.h"
+#include "chrome/common/chrome_switches.h"
#include "content/public/app/startup_helper_win.h"
#include "content/public/common/result_codes.h"
#include "sandbox/win/src/sandbox_factory.h"
@@ -34,12 +38,29 @@ int RunChrome(HINSTANCE instance) {
return rc;
}
+bool AttemptFastNotify() {
+ // We only support the fast path for the default user data dir.
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUserDataDir))
pastarmovj 2013/05/01 10:54:09 You have to check that the UserDataDir policy is n
koz (OOO until 15th September) 2013/05/09 01:47:42 Done.
+ return false;
+
+ base::FilePath udd;
cpu_(ooo_6.6-7.5) 2013/04/30 19:33:37 udd -> data_dir
koz (OOO until 15th September) 2013/05/09 01:47:42 Done.
+ if (!chrome::GetDefaultUserDataDirectory(&udd))
+ return false;
+ HWND chrome = chrome::FindRunningChromeWindow(udd);
+ if (chrome && chrome::AttemptToNotifyRunningChrome(chrome))
+ return true;
+ return false;
+}
+
int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prev, wchar_t*, int) {
// Initialize the commandline singleton from the environment.
CommandLine::Init(0, NULL);
// The exit manager is in charge of calling the dtors of singletons.
base::AtExitManager exit_manager;
+ if (AttemptFastNotify())
+ return 0;
+
MetroDriver metro_driver;
if (metro_driver.in_metro_mode())
return metro_driver.RunInMetro(instance, &RunChrome);
« no previous file with comments | « no previous file | chrome/browser/chrome_process_finder_win.h » ('j') | chrome/chrome_browser.gypi » ('J')

Powered by Google App Engine
This is Rietveld 408576698