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

Side by Side Diff: chrome/browser/policy/file_based_policy_loader.cc

Issue 8437002: Move BrowserThread to content namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: A few updates. Created 9 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/policy/file_based_policy_loader.h" 5 #include "chrome/browser/policy/file_based_policy_loader.h"
6 6
7 #include "base/files/file_path_watcher.h" 7 #include "base/files/file_path_watcher.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
11 11
12 using ::base::files::FilePathWatcher; 12 using ::base::files::FilePathWatcher;
13 using content::BrowserThread;
13 14
14 namespace { 15 namespace {
15 16
16 // Amount of time we wait for the files on disk to settle before trying to load 17 // Amount of time we wait for the files on disk to settle before trying to load
17 // them. This alleviates the problem of reading partially written files and 18 // them. This alleviates the problem of reading partially written files and
18 // makes it possible to batch quasi-simultaneous changes. 19 // makes it possible to batch quasi-simultaneous changes.
19 const int kSettleIntervalSeconds = 5; 20 const int kSettleIntervalSeconds = 5;
20 21
21 // The time interval for rechecking policy. This is our fallback in case the 22 // The time interval for rechecking policy. This is our fallback in case the
22 // delegate never reports a change to the ReloadObserver. 23 // delegate never reports a change to the ReloadObserver.
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 base::TimeDelta age = now - last_modification_clock_; 143 base::TimeDelta age = now - last_modification_clock_;
143 if (age < settle_interval_) { 144 if (age < settle_interval_) {
144 *delay = settle_interval_ - age; 145 *delay = settle_interval_ - age;
145 return false; 146 return false;
146 } 147 }
147 148
148 return true; 149 return true;
149 } 150 }
150 151
151 } // namespace policy 152 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/enterprise_metrics_browsertest.cc ('k') | chrome/browser/policy/logging_work_scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698