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

Side by Side Diff: components/policy/core/common/async_policy_loader.cc

Issue 858303003: Removing FakePolicyWatcher and introducing FakeAsyncPolicyLoader. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing... Created 5 years, 11 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/async_policy_loader.h" 5 #include "components/policy/core/common/async_policy_loader.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/sequenced_task_runner.h" 9 #include "base/sequenced_task_runner.h"
10 #include "components/policy/core/common/policy_bundle.h" 10 #include "components/policy/core/common/policy_bundle.h"
(...skipping 10 matching lines...) Expand all
21 // makes it possible to batch quasi-simultaneous changes. 21 // makes it possible to batch quasi-simultaneous changes.
22 const int kSettleIntervalSeconds = 5; 22 const int kSettleIntervalSeconds = 5;
23 23
24 // The time interval for rechecking policy. This is the fallback in case the 24 // The time interval for rechecking policy. This is the fallback in case the
25 // implementation never detects changes. 25 // implementation never detects changes.
26 const int kReloadIntervalSeconds = 15 * 60; 26 const int kReloadIntervalSeconds = 15 * 60;
27 27
28 } // namespace 28 } // namespace
29 29
30 AsyncPolicyLoader::AsyncPolicyLoader( 30 AsyncPolicyLoader::AsyncPolicyLoader(
31 scoped_refptr<base::SequencedTaskRunner> task_runner) 31 const scoped_refptr<base::SequencedTaskRunner>& task_runner)
32 : task_runner_(task_runner), 32 : task_runner_(task_runner),
33 weak_factory_(this) {} 33 weak_factory_(this) {}
34 34
35 AsyncPolicyLoader::~AsyncPolicyLoader() {} 35 AsyncPolicyLoader::~AsyncPolicyLoader() {}
36 36
37 Time AsyncPolicyLoader::LastModificationTime() { 37 Time AsyncPolicyLoader::LastModificationTime() {
38 return Time(); 38 return Time();
39 } 39 }
40 40
41 void AsyncPolicyLoader::Reload(bool force) { 41 void AsyncPolicyLoader::Reload(bool force) {
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 const TimeDelta age = now - last_modification_clock_; 129 const TimeDelta age = now - last_modification_clock_;
130 if (age < kSettleInterval) { 130 if (age < kSettleInterval) {
131 *delay = kSettleInterval - age; 131 *delay = kSettleInterval - age;
132 return false; 132 return false;
133 } 133 }
134 134
135 return true; 135 return true;
136 } 136 }
137 137
138 } // namespace policy 138 } // namespace policy
OLDNEW
« no previous file with comments | « components/policy/core/common/async_policy_loader.h ('k') | components/policy/core/common/fake_async_policy_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698