OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/app/breakpad_win.h" | 5 #include "chrome/app/breakpad_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 #include <tchar.h> | 9 #include <tchar.h> |
10 | 10 |
11 #include <algorithm> | 11 #include <algorithm> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/base_switches.h" | 14 #include "base/base_switches.h" |
15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
16 #include "base/environment.h" | 16 #include "base/environment.h" |
17 #include "base/file_util.h" | 17 #include "base/file_util.h" |
18 #include "base/file_version_info.h" | 18 #include "base/file_version_info.h" |
19 #include "base/registry.h" | |
20 #include "base/scoped_ptr.h" | 19 #include "base/scoped_ptr.h" |
21 #include "base/string_split.h" | 20 #include "base/string_split.h" |
22 #include "base/string_util.h" | 21 #include "base/string_util.h" |
23 #include "base/utf_string_conversions.h" | 22 #include "base/utf_string_conversions.h" |
24 #include "base/win_util.h" | 23 #include "base/win_util.h" |
| 24 #include "base/win/registry.h" |
25 #include "breakpad/src/client/windows/handler/exception_handler.h" | 25 #include "breakpad/src/client/windows/handler/exception_handler.h" |
26 #include "chrome/app/hard_error_handler_win.h" | 26 #include "chrome/app/hard_error_handler_win.h" |
27 #include "chrome/common/child_process_logging.h" | 27 #include "chrome/common/child_process_logging.h" |
28 #include "chrome/common/chrome_switches.h" | 28 #include "chrome/common/chrome_switches.h" |
29 #include "chrome/common/env_vars.h" | 29 #include "chrome/common/env_vars.h" |
30 #include "chrome/common/result_codes.h" | 30 #include "chrome/common/result_codes.h" |
31 #include "chrome/common/policy_constants.h" | 31 #include "chrome/common/policy_constants.h" |
32 #include "chrome/installer/util/google_chrome_sxs_distribution.h" | 32 #include "chrome/installer/util/google_chrome_sxs_distribution.h" |
33 #include "chrome/installer/util/google_update_settings.h" | 33 #include "chrome/installer/util/google_update_settings.h" |
34 #include "chrome/installer/util/install_util.h" | 34 #include "chrome/installer/util/install_util.h" |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 } | 425 } |
426 | 426 |
427 // Determine whether configuration management allows loading the crash reporter. | 427 // Determine whether configuration management allows loading the crash reporter. |
428 // Since the configuration management infrastructure is not initialized at this | 428 // Since the configuration management infrastructure is not initialized at this |
429 // point, we read the corresponding registry key directly. The return status | 429 // point, we read the corresponding registry key directly. The return status |
430 // indicates whether policy data was successfully read. If it is true, |result| | 430 // indicates whether policy data was successfully read. If it is true, |result| |
431 // contains the value set by policy. | 431 // contains the value set by policy. |
432 static bool MetricsReportingControlledByPolicy(bool* result) { | 432 static bool MetricsReportingControlledByPolicy(bool* result) { |
433 std::wstring key_name = UTF8ToWide(policy::key::kMetricsReportingEnabled); | 433 std::wstring key_name = UTF8ToWide(policy::key::kMetricsReportingEnabled); |
434 DWORD value; | 434 DWORD value; |
435 RegKey hkcu_policy_key(HKEY_LOCAL_MACHINE, policy::kRegistrySubKey, KEY_READ); | 435 base::win::RegKey hkcu_policy_key(HKEY_LOCAL_MACHINE, |
| 436 policy::kRegistrySubKey, KEY_READ); |
436 if (hkcu_policy_key.ReadValueDW(key_name.c_str(), &value)) { | 437 if (hkcu_policy_key.ReadValueDW(key_name.c_str(), &value)) { |
437 *result = value != 0; | 438 *result = value != 0; |
438 return true; | 439 return true; |
439 } | 440 } |
440 | 441 |
441 RegKey hklm_policy_key(HKEY_CURRENT_USER, policy::kRegistrySubKey, KEY_READ); | 442 base::win::RegKey hklm_policy_key(HKEY_CURRENT_USER, |
| 443 policy::kRegistrySubKey, KEY_READ); |
442 if (hklm_policy_key.ReadValueDW(key_name.c_str(), &value)) { | 444 if (hklm_policy_key.ReadValueDW(key_name.c_str(), &value)) { |
443 *result = value != 0; | 445 *result = value != 0; |
444 return true; | 446 return true; |
445 } | 447 } |
446 | 448 |
447 return false; | 449 return false; |
448 } | 450 } |
449 | 451 |
450 static DWORD __stdcall InitCrashReporterThread(void* param) { | 452 static DWORD __stdcall InitCrashReporterThread(void* param) { |
451 scoped_ptr<CrashReporterInfo> info( | 453 scoped_ptr<CrashReporterInfo> info( |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 if (QueueUserWorkItem( | 582 if (QueueUserWorkItem( |
581 &InitCrashReporterThread, | 583 &InitCrashReporterThread, |
582 info, | 584 info, |
583 WT_EXECUTELONGFUNCTION) == 0) { | 585 WT_EXECUTELONGFUNCTION) == 0) { |
584 // We failed to queue to the worker pool, initialize in this thread. | 586 // We failed to queue to the worker pool, initialize in this thread. |
585 InitCrashReporterThread(info); | 587 InitCrashReporterThread(info); |
586 } | 588 } |
587 } | 589 } |
588 } | 590 } |
589 } | 591 } |
OLD | NEW |