| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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 "components/browser_watcher/watcher_metrics_provider_win.h" | 5 #include "components/browser_watcher/watcher_metrics_provider_win.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 | 210 |
| 211 } // namespace | 211 } // namespace |
| 212 | 212 |
| 213 const char WatcherMetricsProviderWin::kBrowserExitCodeHistogramName[] = | 213 const char WatcherMetricsProviderWin::kBrowserExitCodeHistogramName[] = |
| 214 "Stability.BrowserExitCodes"; | 214 "Stability.BrowserExitCodes"; |
| 215 | 215 |
| 216 WatcherMetricsProviderWin::WatcherMetricsProviderWin( | 216 WatcherMetricsProviderWin::WatcherMetricsProviderWin( |
| 217 const base::string16& registry_path, | 217 const base::string16& registry_path, |
| 218 const base::FilePath& user_data_dir, | 218 const base::FilePath& user_data_dir, |
| 219 const base::FilePath& crash_dir, | 219 const base::FilePath& crash_dir, |
| 220 const GetExecutableDetailsCallback& exe_details_cb, |
| 220 base::TaskRunner* io_task_runner) | 221 base::TaskRunner* io_task_runner) |
| 221 : recording_enabled_(false), | 222 : recording_enabled_(false), |
| 222 cleanup_scheduled_(false), | 223 cleanup_scheduled_(false), |
| 223 registry_path_(registry_path), | 224 registry_path_(registry_path), |
| 224 user_data_dir_(user_data_dir), | 225 user_data_dir_(user_data_dir), |
| 225 crash_dir_(crash_dir), | 226 crash_dir_(crash_dir), |
| 227 exe_details_cb_(exe_details_cb), |
| 226 io_task_runner_(io_task_runner), | 228 io_task_runner_(io_task_runner), |
| 227 weak_ptr_factory_(this) { | 229 weak_ptr_factory_(this) { |
| 228 DCHECK(io_task_runner_); | 230 DCHECK(io_task_runner_); |
| 229 } | 231 } |
| 230 | 232 |
| 231 WatcherMetricsProviderWin::~WatcherMetricsProviderWin() { | 233 WatcherMetricsProviderWin::~WatcherMetricsProviderWin() { |
| 232 } | 234 } |
| 233 | 235 |
| 234 void WatcherMetricsProviderWin::OnRecordingEnabled() { | 236 void WatcherMetricsProviderWin::OnRecordingEnabled() { |
| 235 recording_enabled_ = true; | 237 recording_enabled_ = true; |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 LOG(ERROR) << "Failed to initialize a CrashPad database."; | 309 LOG(ERROR) << "Failed to initialize a CrashPad database."; |
| 308 LogCollectionInitStatus(CRASHPAD_DATABASE_INIT_FAILED); | 310 LogCollectionInitStatus(CRASHPAD_DATABASE_INIT_FAILED); |
| 309 return; | 311 return; |
| 310 } | 312 } |
| 311 | 313 |
| 312 // Note: not caching the histogram pointer as this function isn't expected to | 314 // Note: not caching the histogram pointer as this function isn't expected to |
| 313 // be called multiple times. | 315 // be called multiple times. |
| 314 LogCollectionInitStatus(INIT_SUCCESS); | 316 LogCollectionInitStatus(INIT_SUCCESS); |
| 315 | 317 |
| 316 // TODO(manzagop): fix incorrect version attribution on update. | 318 // TODO(manzagop): fix incorrect version attribution on update. |
| 317 PostmortemReportCollector collector; | 319 PostmortemReportCollector collector(exe_details_cb_); |
| 318 collector.CollectAndSubmitForUpload(stability_dir, GetStabilityFilePattern(), | 320 collector.CollectAndSubmitForUpload(stability_dir, GetStabilityFilePattern(), |
| 319 excluded_debug_files, | 321 excluded_debug_files, |
| 320 crashpad_database.get()); | 322 crashpad_database.get()); |
| 321 } | 323 } |
| 322 | 324 |
| 323 } // namespace browser_watcher | 325 } // namespace browser_watcher |
| OLD | NEW |