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

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

Issue 6697020: Fixed shutdown concurrency issues in FilePathWatcher. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 9 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "content/browser/browser_thread.h"
8
7 namespace { 9 namespace {
8 10
9 // Amount of time we wait for the files on disk to settle before trying to load 11 // Amount of time we wait for the files on disk to settle before trying to load
10 // them. This alleviates the problem of reading partially written files and 12 // them. This alleviates the problem of reading partially written files and
11 // makes it possible to batch quasi-simultaneous changes. 13 // makes it possible to batch quasi-simultaneous changes.
12 const int kSettleIntervalSeconds = 5; 14 const int kSettleIntervalSeconds = 5;
13 15
14 // The time interval for rechecking policy. This is our fallback in case the 16 // The time interval for rechecking policy. This is our fallback in case the
15 // delegate never reports a change to the ReloadObserver. 17 // delegate never reports a change to the ReloadObserver.
16 const int kReloadIntervalMinutes = 15; 18 const int kReloadIntervalMinutes = 15;
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 base::TimeDelta age = now - last_modification_clock_; 137 base::TimeDelta age = now - last_modification_clock_;
136 if (age < settle_interval_) { 138 if (age < settle_interval_) {
137 *delay = settle_interval_ - age; 139 *delay = settle_interval_ - age;
138 return false; 140 return false;
139 } 141 }
140 142
141 return true; 143 return true;
142 } 144 }
143 145
144 } // namespace policy 146 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698