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

Unified Diff: chrome/app/client_util.cc

Issue 886613002: Introduce the ability to wait for the watcher process to initialize. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review feedback. Created 5 years, 10 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 | « chrome/app/chrome_watcher_command_line_win.cc ('k') | chrome/chrome_exe.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/client_util.cc
diff --git a/chrome/app/client_util.cc b/chrome/app/client_util.cc
index 1be8bf063cfdd8e6c19554bdeac53ade398e0691..d577aab2d62f149ba4c712617096d4d4a54ccef8 100644
--- a/chrome/app/client_util.cc
+++ b/chrome/app/client_util.cc
@@ -21,6 +21,7 @@
#include "base/win/scoped_handle.h"
#include "base/win/windows_version.h"
#include "chrome/app/chrome_crash_reporter_client.h"
+#include "chrome/app/chrome_watcher_client_win.h"
#include "chrome/app/chrome_watcher_command_line_win.h"
#include "chrome/app/client_util.h"
#include "chrome/app/image_pre_reader_win.h"
@@ -33,7 +34,6 @@
#include "chrome/installer/util/google_update_settings.h"
#include "chrome/installer/util/install_util.h"
#include "chrome/installer/util/util_constants.h"
-#include "components/browser_watcher/watcher_client_win.h"
#include "components/crash/app/breakpad_win.h"
#include "components/crash/app/crash_reporter_client.h"
#include "components/metrics/client_info.h"
@@ -179,10 +179,12 @@ int MainDllLoader::Launch(HINSTANCE instance) {
}
if (process_type_ == "watcher") {
- base::win::ScopedHandle parent_process =
- InterpretChromeWatcherCommandLine(cmd_line);
- if (!parent_process.IsValid())
+ base::win::ScopedHandle parent_process;
+ base::win::ScopedHandle on_initialized_event;
+ if (!InterpretChromeWatcherCommandLine(cmd_line, &parent_process,
+ &on_initialized_event)) {
return chrome::RESULT_CODE_UNSUPPORTED_PARAM;
+ }
// Intentionally leaked.
HMODULE watcher_dll = Load(&version, &file);
@@ -193,7 +195,7 @@ int MainDllLoader::Launch(HINSTANCE instance) {
reinterpret_cast<ChromeWatcherMainFunction>(
::GetProcAddress(watcher_dll, kChromeWatcherDLLEntrypoint));
return watcher_main(chrome::kBrowserExitCodesRegistryPath,
- parent_process.Take());
+ parent_process.Take(), on_initialized_event.Take());
}
// Initialize the sandbox services.
@@ -260,8 +262,7 @@ void ChromeDllLoader::OnBeforeLaunch(const std::string& process_type,
if (g_chrome_crash_client.Get().GetCollectStatsConsent()) {
base::char16 exe_path[MAX_PATH];
::GetModuleFileNameW(nullptr, exe_path, arraysize(exe_path));
-
- browser_watcher::WatcherClient watcher_client(base::Bind(
+ ChromeWatcherClient watcher_client(base::Bind(
&GenerateChromeWatcherCommandLine, base::FilePath(exe_path)));
watcher_client.LaunchWatcher();
}
« no previous file with comments | « chrome/app/chrome_watcher_command_line_win.cc ('k') | chrome/chrome_exe.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698