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

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: Fix a character literal type. 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.gyp » ('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 738ae9e2d314a608a3dec05d6d8c02293ad5e784..97ff58e1305ea12c91bfa5b68e50b580a7aaa085 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/environment.h"
@@ -12,6 +13,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"
@@ -179,6 +182,8 @@ int MainDllLoader::Launch(HINSTANCE instance) {
}
if (process_type_ == "watcher") {
+ chrome::RegisterPathProvider();
+
base::win::ScopedHandle parent_process;
base::win::ScopedHandle on_initialized_event;
if (!InterpretChromeWatcherCommandLine(cmd_line, &parent_process,
@@ -186,6 +191,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 +204,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 +270,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.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698