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

Side by Side Diff: remoting/host/policy_hack/policy_watcher_linux.cc

Issue 12207034: Linux/ChromeOS Chromium style checker cleanup, remoting/ edition. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 7 years, 10 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
« no previous file with comments | « remoting/host/plugin/host_plugin.cc ('k') | remoting/jingle_glue/chromium_socket_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // Most of this code is copied from various classes in 5 // Most of this code is copied from various classes in
6 // src/chrome/browser/policy. In particular, look at 6 // src/chrome/browser/policy. In particular, look at
7 // 7 //
8 // file_based_policy_loader.{h,cc} 8 // file_based_policy_loader.{h,cc}
9 // config_dir_policy_provider.{h,cc} 9 // config_dir_policy_provider.{h,cc}
10 // 10 //
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 LOG(WARNING) << "Expected JSON dictionary in configuration file " 156 LOG(WARNING) << "Expected JSON dictionary in configuration file "
157 << config_file_iter->value(); 157 << config_file_iter->value();
158 return scoped_ptr<DictionaryValue>(); 158 return scoped_ptr<DictionaryValue>();
159 } 159 }
160 policy->MergeDictionary(static_cast<DictionaryValue*>(value.get())); 160 policy->MergeDictionary(static_cast<DictionaryValue*>(value.get()));
161 } 161 }
162 162
163 return policy.Pass(); 163 return policy.Pass();
164 } 164 }
165 165
166 void Reload() { 166 virtual void Reload() OVERRIDE {
167 DCHECK(OnPolicyWatcherThread()); 167 DCHECK(OnPolicyWatcherThread());
168 // Check the directory time in order to see whether a reload is required. 168 // Check the directory time in order to see whether a reload is required.
169 base::TimeDelta delay; 169 base::TimeDelta delay;
170 base::Time now = base::Time::Now(); 170 base::Time now = base::Time::Now();
171 if (!IsSafeToReloadPolicy(now, &delay)) { 171 if (!IsSafeToReloadPolicy(now, &delay)) {
172 ScheduleReloadTask(delay); 172 ScheduleReloadTask(delay);
173 return; 173 return;
174 } 174 }
175 175
176 // Check again in case the directory has changed while reading it. 176 // Check again in case the directory has changed while reading it.
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 }; 246 };
247 247
248 PolicyWatcher* PolicyWatcher::Create( 248 PolicyWatcher* PolicyWatcher::Create(
249 scoped_refptr<base::SingleThreadTaskRunner> task_runner) { 249 scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
250 base::FilePath policy_dir(kPolicyDir); 250 base::FilePath policy_dir(kPolicyDir);
251 return new PolicyWatcherLinux(task_runner, policy_dir); 251 return new PolicyWatcherLinux(task_runner, policy_dir);
252 } 252 }
253 253
254 } // namespace policy_hack 254 } // namespace policy_hack
255 } // namespace remoting 255 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/plugin/host_plugin.cc ('k') | remoting/jingle_glue/chromium_socket_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698