| OLD | NEW | 
|---|
| 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  Loading... | 
| 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  Loading... | 
| 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 | 
| OLD | NEW | 
|---|