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

Unified Diff: chrome/chrome_watcher/chrome_watcher_main.cc

Issue 1630923002: Remove PRODUCT_STRING_PATH from chrome_constants.h on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@c2_rm_PSP_profile_resetter
Patch Set: merge up to r379824 Created 4 years, 9 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
Index: chrome/chrome_watcher/chrome_watcher_main.cc
diff --git a/chrome/chrome_watcher/chrome_watcher_main.cc b/chrome/chrome_watcher/chrome_watcher_main.cc
index 18f4b5ab245fd150c3fa157af784c4c66ea892b1..545312f8c04942006c36f27f3eb2aa9535627ccc 100644
--- a/chrome/chrome_watcher/chrome_watcher_main.cc
+++ b/chrome/chrome_watcher/chrome_watcher_main.cc
@@ -62,14 +62,13 @@ const int kDelayTimeSeconds = 30;
// an exit funnel, for reporting the next time Chrome runs.
class BrowserMonitor {
public:
- BrowserMonitor(base::RunLoop* run_loop, const base::char16* registry_path);
+ BrowserMonitor(base::StringPiece16 registry_path, base::RunLoop* run_loop);
~BrowserMonitor();
// Initiates the asynchronous monitoring process, returns true on success.
// |on_initialized_event| will be signaled immediately before blocking on the
// exit of |process|.
- bool StartWatching(const base::char16* registry_path,
- base::Process process,
+ bool StartWatching(base::Process process,
base::win::ScopedHandle on_initialized_event);
private:
@@ -100,8 +99,8 @@ class BrowserMonitor {
DISALLOW_COPY_AND_ASSIGN(BrowserMonitor);
};
-BrowserMonitor::BrowserMonitor(base::RunLoop* run_loop,
- const base::char16* registry_path)
+BrowserMonitor::BrowserMonitor(base::StringPiece16 registry_path,
+ base::RunLoop* run_loop)
: exit_code_watcher_(registry_path),
end_session_watcher_window_(
base::Bind(&BrowserMonitor::OnEndSessionMessage,
@@ -109,14 +108,12 @@ BrowserMonitor::BrowserMonitor(base::RunLoop* run_loop,
background_thread_("BrowserWatcherThread"),
browser_exited_(true, false), // manual reset, initially non-signalled.
run_loop_(run_loop),
- main_thread_(base::ThreadTaskRunnerHandle::Get()) {
-}
+ main_thread_(base::ThreadTaskRunnerHandle::Get()) {}
BrowserMonitor::~BrowserMonitor() {
}
bool BrowserMonitor::StartWatching(
- const base::char16* registry_path,
base::Process process,
base::win::ScopedHandle on_initialized_event) {
if (!exit_code_watcher_.Initialize(std::move(process)))
@@ -188,7 +185,6 @@ void BrowserMonitor::BrowserExited() {
}
void OnWindowEvent(
- const base::string16& registry_path,
base::Process process,
const base::Callback<void(const base::Process&)>& on_hung_callback,
browser_watcher::WindowHangMonitor::WindowEvent window_event) {
@@ -414,9 +410,9 @@ extern "C" int WatcherMain(const base::char16* registry_path,
msg_loop.set_thread_name("WatcherMainThread");
base::RunLoop run_loop;
- BrowserMonitor monitor(&run_loop, registry_path);
- if (!monitor.StartWatching(registry_path, process.Duplicate(),
- std::move(on_initialized_event))) {
+ BrowserMonitor monitor(registry_path, &run_loop);
+ if (!monitor.StartWatching(process.Duplicate(),
+ std::move(on_initialized_event)) {
return 1;
}
@@ -424,8 +420,8 @@ extern "C" int WatcherMain(const base::char16* registry_path,
// Scoped to force |hang_monitor| destruction before Kasko is shut down.
browser_watcher::WindowHangMonitor hang_monitor(
base::TimeDelta::FromSeconds(60), base::TimeDelta::FromSeconds(20),
- base::Bind(&OnWindowEvent, registry_path,
- base::Passed(process.Duplicate()), on_hung_callback));
+ base::Bind(&OnWindowEvent, base::Passed(process.Duplicate()),
+ on_hung_callback));
hang_monitor.Initialize(process.Duplicate());
run_loop.Run();

Powered by Google App Engine
This is Rietveld 408576698