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

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

Issue 6731064: kqueue implementation of FilePathWatcher on Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more minor tweaks 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 "content/browser/browser_thread.h" 7 #include "content/browser/browser_thread.h"
8 8
9 namespace { 9 namespace {
10 10
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 90
91 ScheduleFallbackReloadTask(); 91 ScheduleFallbackReloadTask();
92 } 92 }
93 93
94 void FileBasedPolicyLoader::InitOnFileThread() { 94 void FileBasedPolicyLoader::InitOnFileThread() {
95 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 95 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
96 watcher_.reset(new FilePathWatcher); 96 watcher_.reset(new FilePathWatcher);
97 if (!config_file_path().empty() && 97 if (!config_file_path().empty() &&
98 !watcher_->Watch( 98 !watcher_->Watch(
99 config_file_path(), 99 config_file_path(),
100 new FileBasedPolicyWatcherDelegate(this), 100 new FileBasedPolicyWatcherDelegate(this))) {
101 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI))) {
102 OnError(); 101 OnError();
103 } 102 }
104 103
105 // There might have been changes to the directory in the time between 104 // There might have been changes to the directory in the time between
106 // construction of the loader and initialization of the watcher. Call reload 105 // construction of the loader and initialization of the watcher. Call reload
107 // to detect if that is the case. 106 // to detect if that is the case.
108 Reload(); 107 Reload();
109 108
110 ScheduleFallbackReloadTask(); 109 ScheduleFallbackReloadTask();
111 } 110 }
(...skipping 27 matching lines...) Expand all
139 base::TimeDelta age = now - last_modification_clock_; 138 base::TimeDelta age = now - last_modification_clock_;
140 if (age < settle_interval_) { 139 if (age < settle_interval_) {
141 *delay = settle_interval_ - age; 140 *delay = settle_interval_ - age;
142 return false; 141 return false;
143 } 142 }
144 143
145 return true; 144 return true;
146 } 145 }
147 146
148 } // namespace policy 147 } // namespace policy
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/user_style_sheet_watcher.cc » ('j') | content/common/file_path_watcher/file_path_watcher_mac.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698