| 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 |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 } | 388 } |
| 389 | 389 |
| 390 // Determine whether configuration management allows loading the crash reporter. | 390 // Determine whether configuration management allows loading the crash reporter. |
| 391 // Since the configuration management infrastructure is not initialized at this | 391 // Since the configuration management infrastructure is not initialized at this |
| 392 // point, we read the corresponding registry key directly. The return status | 392 // point, we read the corresponding registry key directly. The return status |
| 393 // indicates whether policy data was successfully read. If it is true, |result| | 393 // indicates whether policy data was successfully read. If it is true, |result| |
| 394 // contains the value set by policy. | 394 // contains the value set by policy. |
| 395 static bool MetricsReportingControlledByPolicy(bool* result) { | 395 static bool MetricsReportingControlledByPolicy(bool* result) { |
| 396 std::wstring key_name = UTF8ToWide(policy::key::kMetricsReportingEnabled); | 396 std::wstring key_name = UTF8ToWide(policy::key::kMetricsReportingEnabled); |
| 397 DWORD value; | 397 DWORD value; |
| 398 RegKey hkcu_policy_key(HKEY_LOCAL_MACHINE, policy::kRegistrySubKey); | 398 RegKey hkcu_policy_key(HKEY_LOCAL_MACHINE, policy::kRegistrySubKey, KEY_READ); |
| 399 if (hkcu_policy_key.ReadValueDW(key_name.c_str(), &value)) { | 399 if (hkcu_policy_key.ReadValueDW(key_name.c_str(), &value)) { |
| 400 *result = value != 0; | 400 *result = value != 0; |
| 401 return true; | 401 return true; |
| 402 } | 402 } |
| 403 | 403 |
| 404 RegKey hklm_policy_key(HKEY_CURRENT_USER, policy::kRegistrySubKey); | 404 RegKey hklm_policy_key(HKEY_CURRENT_USER, policy::kRegistrySubKey, KEY_READ); |
| 405 if (hklm_policy_key.ReadValueDW(key_name.c_str(), &value)) { | 405 if (hklm_policy_key.ReadValueDW(key_name.c_str(), &value)) { |
| 406 *result = value != 0; | 406 *result = value != 0; |
| 407 return true; | 407 return true; |
| 408 } | 408 } |
| 409 | 409 |
| 410 return false; | 410 return false; |
| 411 } | 411 } |
| 412 | 412 |
| 413 static DWORD __stdcall InitCrashReporterThread(void* param) { | 413 static DWORD __stdcall InitCrashReporterThread(void* param) { |
| 414 scoped_ptr<CrashReporterInfo> info( | 414 scoped_ptr<CrashReporterInfo> info( |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 if (QueueUserWorkItem( | 543 if (QueueUserWorkItem( |
| 544 &InitCrashReporterThread, | 544 &InitCrashReporterThread, |
| 545 info, | 545 info, |
| 546 WT_EXECUTELONGFUNCTION) == 0) { | 546 WT_EXECUTELONGFUNCTION) == 0) { |
| 547 // We failed to queue to the worker pool, initialize in this thread. | 547 // We failed to queue to the worker pool, initialize in this thread. |
| 548 InitCrashReporterThread(info); | 548 InitCrashReporterThread(info); |
| 549 } | 549 } |
| 550 } | 550 } |
| 551 } | 551 } |
| 552 } | 552 } |
| OLD | NEW |