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

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

Issue 9584043: Convert uses of int ms to TimeDelta in chrome/browser/policy. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 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
« no previous file with comments | « no previous file | no next file » | 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 #include "chrome/browser/policy/asynchronous_policy_loader.h" 5 #include "chrome/browser/policy/asynchronous_policy_loader.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "content/public/browser/browser_thread.h" 9 #include "content/public/browser/browser_thread.h"
10 10
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 void AsynchronousPolicyLoader::ScheduleReloadTask( 64 void AsynchronousPolicyLoader::ScheduleReloadTask(
65 const base::TimeDelta& delay) { 65 const base::TimeDelta& delay) {
66 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 66 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
67 67
68 CancelReloadTask(); 68 CancelReloadTask();
69 69
70 BrowserThread::PostDelayedTask( 70 BrowserThread::PostDelayedTask(
71 BrowserThread::FILE, FROM_HERE, 71 BrowserThread::FILE, FROM_HERE,
72 base::Bind(&AsynchronousPolicyLoader::ReloadFromTask, 72 base::Bind(&AsynchronousPolicyLoader::ReloadFromTask,
73 weak_ptr_factory_.GetWeakPtr()), 73 weak_ptr_factory_.GetWeakPtr()),
74 delay.InMilliseconds()); 74 delay);
75 } 75 }
76 76
77 void AsynchronousPolicyLoader::ScheduleFallbackReloadTask() { 77 void AsynchronousPolicyLoader::ScheduleFallbackReloadTask() {
78 // As a safeguard in case that the load delegate failed to timely notice a 78 // As a safeguard in case that the load delegate failed to timely notice a
79 // change in policy, schedule a reload task that'll make us recheck after a 79 // change in policy, schedule a reload task that'll make us recheck after a
80 // reasonable interval. 80 // reasonable interval.
81 ScheduleReloadTask(reload_interval_); 81 ScheduleReloadTask(reload_interval_);
82 } 82 }
83 83
84 void AsynchronousPolicyLoader::ReloadFromTask() { 84 void AsynchronousPolicyLoader::ReloadFromTask() {
(...skipping 25 matching lines...) Expand all
110 110
111 void AsynchronousPolicyLoader::InitAfterFileThreadAvailable() { 111 void AsynchronousPolicyLoader::InitAfterFileThreadAvailable() {
112 if (!stopped_) { 112 if (!stopped_) {
113 BrowserThread::PostTask( 113 BrowserThread::PostTask(
114 BrowserThread::FILE, FROM_HERE, 114 BrowserThread::FILE, FROM_HERE,
115 base::Bind(&AsynchronousPolicyLoader::InitOnFileThread, this)); 115 base::Bind(&AsynchronousPolicyLoader::InitOnFileThread, this));
116 } 116 }
117 } 117 }
118 118
119 } // namespace policy 119 } // namespace policy
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698