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

Side by Side Diff: base/registry.cc

Issue 3100001: Cleanup Registry API part 2: (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: Created 10 years, 4 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
« no previous file with comments | « base/registry.h ('k') | chrome/installer/util/create_reg_key_work_item.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/registry.h" 5 #include "base/registry.h"
6 6
7 #include <shlwapi.h> 7 #include <shlwapi.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 10
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 if (rootkey) { 138 if (rootkey) {
139 if (access & (KEY_SET_VALUE | KEY_CREATE_SUB_KEY | KEY_CREATE_LINK)) 139 if (access & (KEY_SET_VALUE | KEY_CREATE_SUB_KEY | KEY_CREATE_LINK))
140 Create(rootkey, subkey, access); 140 Create(rootkey, subkey, access);
141 else 141 else
142 Open(rootkey, subkey, access); 142 Open(rootkey, subkey, access);
143 } else { 143 } else {
144 DCHECK(!subkey); 144 DCHECK(!subkey);
145 } 145 }
146 } 146 }
147 147
148 RegKey::~RegKey() {
149 Close();
150 }
151
148 void RegKey::Close() { 152 void RegKey::Close() {
149 StopWatching(); 153 StopWatching();
150 if (key_) { 154 if (key_) {
151 ::RegCloseKey(key_); 155 ::RegCloseKey(key_);
152 key_ = NULL; 156 key_ = NULL;
153 } 157 }
154 } 158 }
155 159
156 bool RegKey::Create(HKEY rootkey, const wchar_t* subkey, REGSAM access) { 160 bool RegKey::Create(HKEY rootkey, const wchar_t* subkey, REGSAM access) {
157 DWORD disposition_value; 161 DWORD disposition_value;
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 367
364 bool RegKey::HasChanged() { 368 bool RegKey::HasChanged() {
365 if (watch_event_) { 369 if (watch_event_) {
366 if (WaitForSingleObject(watch_event_, 0) == WAIT_OBJECT_0) { 370 if (WaitForSingleObject(watch_event_, 0) == WAIT_OBJECT_0) {
367 StartWatching(); 371 StartWatching();
368 return true; 372 return true;
369 } 373 }
370 } 374 }
371 return false; 375 return false;
372 } 376 }
OLDNEW
« no previous file with comments | « base/registry.h ('k') | chrome/installer/util/create_reg_key_work_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698