| 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 "chrome/browser/process_singleton.h" | 5 #include "chrome/browser/process_singleton.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <shellapi.h> | 8 #include <shellapi.h> |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 | 10 |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 enable_uploads = crash_reporter_client.GetCollectStatsConsent() && | 216 enable_uploads = crash_reporter_client.GetCollectStatsConsent() && |
| 217 !crash_reporter_client.IsRunningUnattended(); | 217 !crash_reporter_client.IsRunningUnattended(); |
| 218 } | 218 } |
| 219 | 219 |
| 220 if (!enable_uploads) | 220 if (!enable_uploads) |
| 221 return; | 221 return; |
| 222 | 222 |
| 223 // TODO(manzagop): add a metric for the number of captured hang reports, for | 223 // TODO(manzagop): add a metric for the number of captured hang reports, for |
| 224 // comparison with uploaded count? | 224 // comparison with uploaded count? |
| 225 | 225 |
| 226 // Only report on canary (or unspecified). | 226 // Only report on canary. |
| 227 const version_info::Channel channel = chrome::GetChannel(); | 227 if (chrome::GetChannel() != version_info::Channel::CANARY) { |
| 228 if (channel != version_info::Channel::UNKNOWN && | |
| 229 channel != version_info::Channel::CANARY) { | |
| 230 return; | 228 return; |
| 231 } | 229 } |
| 232 // TODO(manzagop): add a metric for the number of times this does not match. | 230 // TODO(manzagop): add a metric for the number of times this does not match. |
| 233 if (!EnsureTargetProcessValidForCapture(process)) | 231 if (!EnsureTargetProcessValidForCapture(process)) |
| 234 return; | 232 return; |
| 235 | 233 |
| 236 // Initialize a reporter, capture a report and shutdown the reporter. | 234 // Initialize a reporter, capture a report and shutdown the reporter. |
| 237 base::FilePath watcher_data_directory; | 235 base::FilePath watcher_data_directory; |
| 238 if (PathService::Get(chrome::DIR_WATCHER_DATA, &watcher_data_directory)) { | 236 if (PathService::Get(chrome::DIR_WATCHER_DATA, &watcher_data_directory)) { |
| 239 base::string16 endpoint = | 237 base::string16 endpoint = |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 return window_.hwnd() != NULL; | 433 return window_.hwnd() != NULL; |
| 436 } | 434 } |
| 437 | 435 |
| 438 void ProcessSingleton::Cleanup() { | 436 void ProcessSingleton::Cleanup() { |
| 439 } | 437 } |
| 440 | 438 |
| 441 void ProcessSingleton::OverrideShouldKillRemoteProcessCallbackForTesting( | 439 void ProcessSingleton::OverrideShouldKillRemoteProcessCallbackForTesting( |
| 442 const ShouldKillRemoteProcessCallback& display_dialog_callback) { | 440 const ShouldKillRemoteProcessCallback& display_dialog_callback) { |
| 443 should_kill_remote_process_callback_ = display_dialog_callback; | 441 should_kill_remote_process_callback_ = display_dialog_callback; |
| 444 } | 442 } |
| OLD | NEW |