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 13 matching lines...) Expand all Loading... |
24 #include "base/basictypes.h" | 24 #include "base/basictypes.h" |
25 #include "base/bind.h" | 25 #include "base/bind.h" |
26 #include "base/files/file_util.h" | 26 #include "base/files/file_util.h" |
27 #include "base/json/json_reader.h" | 27 #include "base/json/json_reader.h" |
28 #include "base/json/json_writer.h" | 28 #include "base/json/json_writer.h" |
29 #include "base/lazy_instance.h" | 29 #include "base/lazy_instance.h" |
30 #include "base/logging.h" | 30 #include "base/logging.h" |
31 #include "base/memory/scoped_ptr.h" | 31 #include "base/memory/scoped_ptr.h" |
32 #include "base/metrics/histogram.h" | 32 #include "base/metrics/histogram.h" |
33 #include "base/metrics/sparse_histogram.h" | 33 #include "base/metrics/sparse_histogram.h" |
34 #include "base/profiler/scoped_profile.h" | 34 #include "base/profiler/scoped_tracker.h" |
35 #include "base/scoped_native_library.h" | 35 #include "base/scoped_native_library.h" |
36 #include "base/sequenced_task_runner.h" | 36 #include "base/sequenced_task_runner.h" |
37 #include "base/stl_util.h" | 37 #include "base/stl_util.h" |
38 #include "base/strings/string16.h" | 38 #include "base/strings/string16.h" |
39 #include "base/strings/string_util.h" | 39 #include "base/strings/string_util.h" |
40 #include "base/values.h" | 40 #include "base/values.h" |
41 #include "base/win/win_util.h" | 41 #include "base/win/win_util.h" |
42 #include "base/win/windows_version.h" | 42 #include "base/win/windows_version.h" |
43 #include "components/json_schema/json_schema_constants.h" | 43 #include "components/json_schema/json_schema_constants.h" |
44 #include "components/policy/core/common/policy_bundle.h" | 44 #include "components/policy/core/common/policy_bundle.h" |
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 if (!machine_policy_watcher_failed_ && | 674 if (!machine_policy_watcher_failed_ && |
675 !machine_policy_watcher_.GetWatchedObject() && | 675 !machine_policy_watcher_.GetWatchedObject() && |
676 !machine_policy_watcher_.StartWatching( | 676 !machine_policy_watcher_.StartWatching( |
677 machine_policy_changed_event_.handle(), this)) { | 677 machine_policy_changed_event_.handle(), this)) { |
678 DLOG(WARNING) << "Failed to start watch for machine policy change event"; | 678 DLOG(WARNING) << "Failed to start watch for machine policy change event"; |
679 machine_policy_watcher_failed_ = true; | 679 machine_policy_watcher_failed_ = true; |
680 } | 680 } |
681 } | 681 } |
682 | 682 |
683 void PolicyLoaderWin::OnObjectSignaled(HANDLE object) { | 683 void PolicyLoaderWin::OnObjectSignaled(HANDLE object) { |
684 // TODO(vadimt): Remove ScopedProfile below once crbug.com/418183 is fixed. | 684 // TODO(vadimt): Remove ScopedTracker below once crbug.com/418183 is fixed. |
685 tracked_objects::ScopedProfile tracking_profile( | 685 tracked_objects::ScopedTracker tracking_profile( |
686 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 686 FROM_HERE_WITH_EXPLICIT_FUNCTION("PolicyLoaderWin_OnObjectSignaled")); |
687 "PolicyLoaderWin_OnObjectSignaled")); | |
688 | 687 |
689 DCHECK(object == user_policy_changed_event_.handle() || | 688 DCHECK(object == user_policy_changed_event_.handle() || |
690 object == machine_policy_changed_event_.handle()) | 689 object == machine_policy_changed_event_.handle()) |
691 << "unexpected object signaled policy reload, obj = " | 690 << "unexpected object signaled policy reload, obj = " |
692 << std::showbase << std::hex << object; | 691 << std::showbase << std::hex << object; |
693 Reload(false); | 692 Reload(false); |
694 } | 693 } |
695 | 694 |
696 } // namespace policy | 695 } // namespace policy |
OLD | NEW |