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

Side by Side Diff: base/win/registry.cc

Issue 1001833005: Update from https://crrev.com/320343 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Supress Created 5 years, 9 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/win/object_watcher.h ('k') | base/win/scoped_bstr.h » ('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) 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 "base/win/registry.h" 5 #include "base/win/registry.h"
6 6
7 #include <shlwapi.h> 7 #include <shlwapi.h>
8 #include <algorithm> 8 #include <algorithm>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 203
204 // TODO(wfh): Remove this and other unsafe methods. See http://crbug.com/375400 204 // TODO(wfh): Remove this and other unsafe methods. See http://crbug.com/375400
205 void RegKey::Set(HKEY key) { 205 void RegKey::Set(HKEY key) {
206 if (key_ != key) { 206 if (key_ != key) {
207 Close(); 207 Close();
208 key_ = key; 208 key_ = key;
209 } 209 }
210 } 210 }
211 211
212 HKEY RegKey::Take() { 212 HKEY RegKey::Take() {
213 DCHECK(wow64access_ == 0); 213 DCHECK_EQ(wow64access_, 0u);
214 HKEY key = key_; 214 HKEY key = key_;
215 key_ = NULL; 215 key_ = NULL;
216 return key; 216 return key;
217 } 217 }
218 218
219 bool RegKey::HasValue(const wchar_t* name) const { 219 bool RegKey::HasValue(const wchar_t* name) const {
220 return RegQueryValueEx(key_, name, 0, NULL, NULL, NULL) == ERROR_SUCCESS; 220 return RegQueryValueEx(key_, name, 0, NULL, NULL, NULL) == ERROR_SUCCESS;
221 } 221 }
222 222
223 DWORD RegKey::GetValueCount() const { 223 DWORD RegKey::GetValueCount() const {
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 } else { 671 } else {
672 index_ = count - 1; 672 index_ = count - 1;
673 } 673 }
674 } 674 }
675 675
676 Read(); 676 Read();
677 } 677 }
678 678
679 } // namespace win 679 } // namespace win
680 } // namespace base 680 } // namespace base
OLDNEW
« no previous file with comments | « base/win/object_watcher.h ('k') | base/win/scoped_bstr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698