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

Side by Side Diff: chrome/browser/web_resource/web_resource_service.cc

Issue 9215005: Revert 117824 - Convert use of int ms to TimeDelta in files owned by brettw. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 11 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) 2012 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/web_resource/web_resource_service.h" 5 #include "chrome/browser/web_resource/web_resource_service.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
11 #include "base/time.h" 11 #include "base/time.h"
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 ScheduleFetch(delay); 173 ScheduleFetch(delay);
174 } 174 }
175 175
176 // Delay initial load of resource data into cache so as not to interfere 176 // Delay initial load of resource data into cache so as not to interfere
177 // with startup time. 177 // with startup time.
178 void WebResourceService::ScheduleFetch(int64 delay_ms) { 178 void WebResourceService::ScheduleFetch(int64 delay_ms) {
179 MessageLoop::current()->PostDelayedTask( 179 MessageLoop::current()->PostDelayedTask(
180 FROM_HERE, 180 FROM_HERE,
181 base::Bind(&WebResourceService::StartFetch, 181 base::Bind(&WebResourceService::StartFetch,
182 weak_ptr_factory_.GetWeakPtr()), 182 weak_ptr_factory_.GetWeakPtr()),
183 base::TimeDelta::FromMilliseconds(delay_ms)); 183 delay_ms);
184 } 184 }
185 185
186 // Initializes the fetching of data from the resource server. Data 186 // Initializes the fetching of data from the resource server. Data
187 // load calls OnURLFetchComplete. 187 // load calls OnURLFetchComplete.
188 void WebResourceService::StartFetch() { 188 void WebResourceService::StartFetch() {
189 // First, put our next cache load on the MessageLoop. 189 // First, put our next cache load on the MessageLoop.
190 ScheduleFetch(cache_update_delay_ms_); 190 ScheduleFetch(cache_update_delay_ms_);
191 191
192 // Set cache update time in preferences. 192 // Set cache update time in preferences.
193 prefs_->SetString(last_update_time_pref_name_, 193 prefs_->SetString(last_update_time_pref_name_,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 230
231 std::string data; 231 std::string data;
232 source->GetResponseAsString(&data); 232 source->GetResponseAsString(&data);
233 233
234 // UnpackerClient releases itself. 234 // UnpackerClient releases itself.
235 UnpackerClient* client = new UnpackerClient(this); 235 UnpackerClient* client = new UnpackerClient(this);
236 client->Start(data); 236 client->Start(data);
237 237
238 Release(); 238 Release();
239 } 239 }
OLDNEW
« no previous file with comments | « chrome/browser/web_resource/promo_resource_service.cc ('k') | chrome/common/important_file_writer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698