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

Unified Diff: chrome/app/main_dll_loader_win.cc

Issue 2306613003: Restore the chrome watcher pending relocation (Closed)
Patch Set: Created 4 years, 3 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_elf/crash/crash_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/main_dll_loader_win.cc
diff --git a/chrome/app/main_dll_loader_win.cc b/chrome/app/main_dll_loader_win.cc
index 66a3034e91f9b728fc09f03b038b62dbb00c231b..e59ae115ba9cb97627abc2dac67513b336dc5697 100644
--- a/chrome/app/main_dll_loader_win.cc
+++ b/chrome/app/main_dll_loader_win.cc
@@ -203,6 +203,26 @@ void ChromeDllLoader::OnBeforeLaunch(const std::string& process_type,
const base::FilePath& dll_path) {
if (process_type.empty()) {
RecordDidRun(dll_path);
+
+ // Get the function that determines whether uploads are enabled.
+ typedef bool (*GetUploadsEnabledFunction)(void);
+ static GetUploadsEnabledFunction get_uploads_enabled = nullptr;
Sigurður Ásgeirsson 2016/09/01 15:30:36 You may want to check this with chrome-metrics fol
Alexei Svitkine (slow) 2016/09/01 15:40:26 Agreed. If you're just doing this to "save extra w
manzagop (departed) 2016/09/01 16:02:49 Done.
+ if (!get_uploads_enabled) {
+ get_uploads_enabled =
+ reinterpret_cast<GetUploadsEnabledFunction>(GetProcAddress(
+ GetModuleHandle(chrome::kChromeElfDllName), "GetUploadsEnabled"));
+ CHECK(get_uploads_enabled);
+ }
+
+ // Launch the watcher process if stats collection consent has been granted.
+ if (get_uploads_enabled()) {
+ base::FilePath exe_path;
+ if (PathService::Get(base::FILE_EXE, &exe_path)) {
+ chrome_watcher_client_.reset(new ChromeWatcherClient(
+ base::Bind(&GenerateChromeWatcherCommandLine, exe_path)));
+ chrome_watcher_client_->LaunchWatcher();
+ }
+ }
} else {
// Set non-browser processes up to be killed by the system after the browser
// goes away. The browser uses the default shutdown order, which is 0x280.
« no previous file with comments | « no previous file | chrome_elf/crash/crash_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698