| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <windows.h> // NOLINT | 5 #include <windows.h> // NOLINT |
| 6 #include <shlwapi.h> // NOLINT | 6 #include <shlwapi.h> // NOLINT |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <userenv.h> // NOLINT | 8 #include <userenv.h> // NOLINT |
| 9 | 9 |
| 10 #include "chrome/app/main_dll_loader_win.h" | 10 #include "chrome/app/main_dll_loader_win.h" |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 scoped_ptr<KaskoClient> kasko_client_; | 216 scoped_ptr<KaskoClient> kasko_client_; |
| 217 #endif | 217 #endif |
| 218 }; | 218 }; |
| 219 | 219 |
| 220 void ChromeDllLoader::OnBeforeLaunch(const std::string& process_type, | 220 void ChromeDllLoader::OnBeforeLaunch(const std::string& process_type, |
| 221 const base::FilePath& dll_path) { | 221 const base::FilePath& dll_path) { |
| 222 if (process_type.empty()) { | 222 if (process_type.empty()) { |
| 223 RecordDidRun(dll_path); | 223 RecordDidRun(dll_path); |
| 224 | 224 |
| 225 // Launch the watcher process if stats collection consent has been granted. | 225 // Launch the watcher process if stats collection consent has been granted. |
| 226 #if defined(GOOGLE_CHROME_BUILD) | 226 if (crash_reporter::GetUploadsEnabled()) { |
| 227 const bool stats_collection_consent = | |
| 228 GoogleUpdateSettings::GetCollectStatsConsent(); | |
| 229 #else | |
| 230 const bool stats_collection_consent = false; | |
| 231 #endif | |
| 232 if (stats_collection_consent) { | |
| 233 base::FilePath exe_path; | 227 base::FilePath exe_path; |
| 234 if (PathService::Get(base::FILE_EXE, &exe_path)) { | 228 if (PathService::Get(base::FILE_EXE, &exe_path)) { |
| 235 chrome_watcher_client_.reset(new ChromeWatcherClient( | 229 chrome_watcher_client_.reset(new ChromeWatcherClient( |
| 236 base::Bind(&GenerateChromeWatcherCommandLine, exe_path))); | 230 base::Bind(&GenerateChromeWatcherCommandLine, exe_path))); |
| 237 if (chrome_watcher_client_->LaunchWatcher()) { | 231 if (chrome_watcher_client_->LaunchWatcher()) { |
| 238 #if BUILDFLAG(ENABLE_KASKO) | 232 #if BUILDFLAG(ENABLE_KASKO) |
| 239 kasko::api::MinidumpType minidump_type = kasko::api::SMALL_DUMP_TYPE; | 233 kasko::api::MinidumpType minidump_type = kasko::api::SMALL_DUMP_TYPE; |
| 240 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 234 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 241 switches::kFullMemoryCrashReport)) { | 235 switches::kFullMemoryCrashReport)) { |
| 242 minidump_type = kasko::api::FULL_DUMP_TYPE; | 236 minidump_type = kasko::api::FULL_DUMP_TYPE; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 } | 290 } |
| 297 }; | 291 }; |
| 298 | 292 |
| 299 MainDllLoader* MakeMainDllLoader() { | 293 MainDllLoader* MakeMainDllLoader() { |
| 300 #if defined(GOOGLE_CHROME_BUILD) | 294 #if defined(GOOGLE_CHROME_BUILD) |
| 301 return new ChromeDllLoader(); | 295 return new ChromeDllLoader(); |
| 302 #else | 296 #else |
| 303 return new ChromiumDllLoader(); | 297 return new ChromiumDllLoader(); |
| 304 #endif | 298 #endif |
| 305 } | 299 } |
| OLD | NEW |