Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: chrome/app/breakpad_win.cc

Issue 8344004: base/win: Add documentation to RegKey::Read/Write functions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix indentation Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 // Since the configuration management infrastructure is not initialized at this 559 // Since the configuration management infrastructure is not initialized at this
560 // point, we read the corresponding registry key directly. The return status 560 // point, we read the corresponding registry key directly. The return status
561 // indicates whether policy data was successfully read. If it is true, |result| 561 // indicates whether policy data was successfully read. If it is true, |result|
562 // contains the value set by policy. 562 // contains the value set by policy.
563 static bool MetricsReportingControlledByPolicy(bool* result) { 563 static bool MetricsReportingControlledByPolicy(bool* result) {
564 std::wstring key_name = UTF8ToWide(policy::key::kMetricsReportingEnabled); 564 std::wstring key_name = UTF8ToWide(policy::key::kMetricsReportingEnabled);
565 DWORD value = 0; 565 DWORD value = 0;
566 // TODO(joshia): why hkcu_policy_key opens HKEY_LOCAL_MACHINE? 566 // TODO(joshia): why hkcu_policy_key opens HKEY_LOCAL_MACHINE?
567 base::win::RegKey hkcu_policy_key(HKEY_LOCAL_MACHINE, 567 base::win::RegKey hkcu_policy_key(HKEY_LOCAL_MACHINE,
568 policy::kRegistrySubKey, KEY_READ); 568 policy::kRegistrySubKey, KEY_READ);
569 if (hkcu_policy_key.ReadValueDW(key_name.c_str(), &value) == ERROR_SUCCESS) { 569 if (hkcu_policy_key.ReadValue(key_name.c_str(), &value) == ERROR_SUCCESS) {
570 *result = value != 0; 570 *result = value != 0;
571 return true; 571 return true;
572 } 572 }
573 573
574 base::win::RegKey hklm_policy_key(HKEY_CURRENT_USER, 574 base::win::RegKey hklm_policy_key(HKEY_CURRENT_USER,
575 policy::kRegistrySubKey, KEY_READ); 575 policy::kRegistrySubKey, KEY_READ);
576 if (hklm_policy_key.ReadValueDW(key_name.c_str(), &value) == ERROR_SUCCESS) { 576 if (hklm_policy_key.ReadValue(key_name.c_str(), &value) == ERROR_SUCCESS) {
577 *result = value != 0; 577 *result = value != 0;
578 return true; 578 return true;
579 } 579 }
580 580
581 return false; 581 return false;
582 } 582 }
583 583
584 static DWORD __stdcall InitCrashReporterThread(void* param) { 584 static DWORD __stdcall InitCrashReporterThread(void* param) {
585 scoped_ptr<CrashReporterInfo> info( 585 scoped_ptr<CrashReporterInfo> info(
586 reinterpret_cast<CrashReporterInfo*>(param)); 586 reinterpret_cast<CrashReporterInfo*>(param));
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 if (QueueUserWorkItem( 733 if (QueueUserWorkItem(
734 &InitCrashReporterThread, 734 &InitCrashReporterThread,
735 info, 735 info,
736 WT_EXECUTELONGFUNCTION) == 0) { 736 WT_EXECUTELONGFUNCTION) == 0) {
737 // We failed to queue to the worker pool, initialize in this thread. 737 // We failed to queue to the worker pool, initialize in this thread.
738 InitCrashReporterThread(info); 738 InitCrashReporterThread(info);
739 } 739 }
740 } 740 }
741 } 741 }
742 } 742 }
OLDNEW
« base/win/registry.h ('K') | « base/win/win_util.cc ('k') | chrome/app/client_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698