| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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 "components/policy/core/common/policy_loader_win.h" | 5 #include "components/policy/core/common/policy_loader_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <lm.h> // For limits. | 8 #include <lm.h> // For limits. |
| 9 #include <ntdsapi.h> // For Ds[Un]Bind | 9 #include <ntdsapi.h> // For Ds[Un]Bind |
| 10 #include <rpc.h> // For struct GUID | 10 #include <rpc.h> // For struct GUID |
| (...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 } | 667 } |
| 668 } | 668 } |
| 669 } | 669 } |
| 670 } | 670 } |
| 671 | 671 |
| 672 void PolicyLoaderWin::SetupWatches() { | 672 void PolicyLoaderWin::SetupWatches() { |
| 673 DCHECK(is_initialized_); | 673 DCHECK(is_initialized_); |
| 674 if (!user_policy_watcher_failed_ && | 674 if (!user_policy_watcher_failed_ && |
| 675 !user_policy_watcher_.GetWatchedObject() && | 675 !user_policy_watcher_.GetWatchedObject() && |
| 676 !user_policy_watcher_.StartWatching( | 676 !user_policy_watcher_.StartWatching( |
| 677 user_policy_changed_event_.handle(), this)) { | 677 user_policy_changed_event_.handle(), this, false)) { |
| 678 DLOG(WARNING) << "Failed to start watch for user policy change event"; | 678 DLOG(WARNING) << "Failed to start watch for user policy change event"; |
| 679 user_policy_watcher_failed_ = true; | 679 user_policy_watcher_failed_ = true; |
| 680 } | 680 } |
| 681 if (!machine_policy_watcher_failed_ && | 681 if (!machine_policy_watcher_failed_ && |
| 682 !machine_policy_watcher_.GetWatchedObject() && | 682 !machine_policy_watcher_.GetWatchedObject() && |
| 683 !machine_policy_watcher_.StartWatching( | 683 !machine_policy_watcher_.StartWatching( |
| 684 machine_policy_changed_event_.handle(), this)) { | 684 machine_policy_changed_event_.handle(), this, false)) { |
| 685 DLOG(WARNING) << "Failed to start watch for machine policy change event"; | 685 DLOG(WARNING) << "Failed to start watch for machine policy change event"; |
| 686 machine_policy_watcher_failed_ = true; | 686 machine_policy_watcher_failed_ = true; |
| 687 } | 687 } |
| 688 } | 688 } |
| 689 | 689 |
| 690 void PolicyLoaderWin::OnObjectSignaled(HANDLE object) { | 690 void PolicyLoaderWin::OnObjectSignaled(HANDLE object) { |
| 691 DCHECK(object == user_policy_changed_event_.handle() || | 691 DCHECK(object == user_policy_changed_event_.handle() || |
| 692 object == machine_policy_changed_event_.handle()) | 692 object == machine_policy_changed_event_.handle()) |
| 693 << "unexpected object signaled policy reload, obj = " | 693 << "unexpected object signaled policy reload, obj = " |
| 694 << std::showbase << std::hex << object; | 694 << std::showbase << std::hex << object; |
| 695 Reload(false); | 695 Reload(false); |
| 696 } | 696 } |
| 697 | 697 |
| 698 } // namespace policy | 698 } // namespace policy |
| OLD | NEW |