| 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 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 // Mask to pull WOW64 access flags out of REGSAM access. | 32 // Mask to pull WOW64 access flags out of REGSAM access. |
| 33 const REGSAM kWow64AccessMask = KEY_WOW64_32KEY | KEY_WOW64_64KEY; | 33 const REGSAM kWow64AccessMask = KEY_WOW64_32KEY | KEY_WOW64_64KEY; |
| 34 | 34 |
| 35 } // namespace | 35 } // namespace |
| 36 | 36 |
| 37 // Watches for modifications to a key. | 37 // Watches for modifications to a key. |
| 38 class RegKey::Watcher : public ObjectWatcher::Delegate { | 38 class RegKey::Watcher : public ObjectWatcher::Delegate { |
| 39 public: | 39 public: |
| 40 explicit Watcher(RegKey* owner) : owner_(owner) {} | 40 explicit Watcher(RegKey* owner) : owner_(owner) {} |
| 41 ~Watcher() {} | 41 ~Watcher() override {} |
| 42 | 42 |
| 43 bool StartWatching(HKEY key, const ChangeCallback& callback); | 43 bool StartWatching(HKEY key, const ChangeCallback& callback); |
| 44 | 44 |
| 45 // Implementation of ObjectWatcher::Delegate. | 45 // Implementation of ObjectWatcher::Delegate. |
| 46 void OnObjectSignaled(HANDLE object) override { | 46 void OnObjectSignaled(HANDLE object) override { |
| 47 DCHECK(watch_event_.IsValid() && watch_event_.Get() == object); | 47 DCHECK(watch_event_.IsValid() && watch_event_.Get() == object); |
| 48 ChangeCallback callback = callback_; | 48 ChangeCallback callback = callback_; |
| 49 callback_.Reset(); | 49 callback_.Reset(); |
| 50 callback.Run(); | 50 callback.Run(); |
| 51 } | 51 } |
| (...skipping 619 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 |