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

Unified Diff: chrome/app/client_util.cc

Issue 901673002: Instantiate a Kasko reporter inside the Chrome watcher process, when SyzyASAN instrumented. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ship_kasko
Patch Set: Various tweaks. 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 | « DEPS ('k') | chrome/chrome_exe.gypi » ('j') | chrome/chrome_exe.gypi » ('J')
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 d577aab2d62f149ba4c712617096d4d4a54ccef8..34ecfbda3a1a4ad5994a5dfe3e185e9181b20260 100644
--- a/chrome/app/client_util.cc
+++ b/chrome/app/client_util.cc
@@ -5,6 +5,7 @@
#include <windows.h>
#include <shlwapi.h>
+#include "base/base_paths.h"
#include "base/command_line.h"
#include "base/compiler_specific.h"
#include "base/debug/trace_event.h"
@@ -13,6 +14,7 @@
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
+#include "base/path_service.h"
#include "base/strings/string16.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
@@ -27,6 +29,7 @@
#include "chrome/app/image_pre_reader_win.h"
#include "chrome/chrome_watcher/chrome_watcher_main_api.h"
#include "chrome/common/chrome_constants.h"
+#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_result_codes.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/env_vars.h"
@@ -186,6 +189,10 @@ int MainDllLoader::Launch(HINSTANCE instance) {
return chrome::RESULT_CODE_UNSUPPORTED_PARAM;
}
+ base::FilePath watcher_data_directory;
+ if (!PathService::Get(chrome::DIR_WATCHER_DATA, &watcher_data_directory))
+ return chrome::RESULT_CODE_MISSING_DATA;
+
// Intentionally leaked.
HMODULE watcher_dll = Load(&version, &file);
if (!watcher_dll)
@@ -195,7 +202,8 @@ int MainDllLoader::Launch(HINSTANCE instance) {
reinterpret_cast<ChromeWatcherMainFunction>(
::GetProcAddress(watcher_dll, kChromeWatcherDLLEntrypoint));
return watcher_main(chrome::kBrowserExitCodesRegistryPath,
- parent_process.Take(), on_initialized_event.Take());
+ parent_process.Take(), on_initialized_event.Take(),
+ watcher_data_directory.value().c_str());
}
// Initialize the sandbox services.
@@ -260,11 +268,14 @@ void ChromeDllLoader::OnBeforeLaunch(const std::string& process_type,
// Launch the watcher process if stats collection consent has been granted.
if (g_chrome_crash_client.Get().GetCollectStatsConsent()) {
- base::char16 exe_path[MAX_PATH];
- ::GetModuleFileNameW(nullptr, exe_path, arraysize(exe_path));
- ChromeWatcherClient watcher_client(base::Bind(
- &GenerateChromeWatcherCommandLine, base::FilePath(exe_path)));
- watcher_client.LaunchWatcher();
+ base::FilePath exe_path;
+ if (PathService::Get(base::FILE_EXE, &exe_path)) {
+ ChromeWatcherClient watcher_client(
+ base::Bind(&GenerateChromeWatcherCommandLine, exe_path));
+ watcher_client.LaunchWatcher();
+ } else {
+ NOTREACHED();
+ }
}
}
}
« no previous file with comments | « DEPS ('k') | chrome/chrome_exe.gypi » ('j') | chrome/chrome_exe.gypi » ('J')

Powered by Google App Engine
This is Rietveld 408576698