Chromium Code Reviews| 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. |