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

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

Issue 6793020: Move FilePathWatcher to base/files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use ::operator<< Created 9 years, 8 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 | 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/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "content/browser/browser_thread.h" 8 #include "content/browser/browser_thread.h"
9 9
10 using ::base::files::FilePathWatcher;
11
10 namespace { 12 namespace {
11 13
12 // Amount of time we wait for the files on disk to settle before trying to load 14 // Amount of time we wait for the files on disk to settle before trying to load
13 // them. This alleviates the problem of reading partially written files and 15 // them. This alleviates the problem of reading partially written files and
14 // makes it possible to batch quasi-simultaneous changes. 16 // makes it possible to batch quasi-simultaneous changes.
15 const int kSettleIntervalSeconds = 5; 17 const int kSettleIntervalSeconds = 5;
16 18
17 // The time interval for rechecking policy. This is our fallback in case the 19 // The time interval for rechecking policy. This is our fallback in case the
18 // delegate never reports a change to the ReloadObserver. 20 // delegate never reports a change to the ReloadObserver.
19 const int kReloadIntervalMinutes = 15; 21 const int kReloadIntervalMinutes = 15;
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 base::TimeDelta age = now - last_modification_clock_; 140 base::TimeDelta age = now - last_modification_clock_;
139 if (age < settle_interval_) { 141 if (age < settle_interval_) {
140 *delay = settle_interval_ - age; 142 *delay = settle_interval_ - age;
141 return false; 143 return false;
142 } 144 }
143 145
144 return true; 146 return true;
145 } 147 }
146 148
147 } // namespace policy 149 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/file_based_policy_loader.h ('k') | chrome/browser/user_style_sheet_watcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698