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

Side by Side Diff: chrome/browser/safe_browsing/client_side_detection_service.cc

Issue 9185026: Convert use of int ms to TimeDelta in files owned by brettw. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Explicitly include base/time.h in header file. 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
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/safe_browsing/client_side_detection_service.h" 5 #include "chrome/browser/safe_browsing/client_side_detection_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/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 !i.IsAtEnd(); i.Advance()) { 238 !i.IsAtEnd(); i.Advance()) {
239 SendModelToProcess(i.GetCurrentValue()); 239 SendModelToProcess(i.GetCurrentValue());
240 } 240 }
241 } 241 }
242 242
243 void ClientSideDetectionService::ScheduleFetchModel(int64 delay_ms) { 243 void ClientSideDetectionService::ScheduleFetchModel(int64 delay_ms) {
244 MessageLoop::current()->PostDelayedTask( 244 MessageLoop::current()->PostDelayedTask(
245 FROM_HERE, 245 FROM_HERE,
246 base::Bind(&ClientSideDetectionService::StartFetchModel, 246 base::Bind(&ClientSideDetectionService::StartFetchModel,
247 weak_factory_.GetWeakPtr()), 247 weak_factory_.GetWeakPtr()),
248 delay_ms); 248 base::TimeDelta::FromMilliseconds(delay_ms));
249 } 249 }
250 250
251 void ClientSideDetectionService::StartFetchModel() { 251 void ClientSideDetectionService::StartFetchModel() {
252 if (enabled_) { 252 if (enabled_) {
253 // Start fetching the model either from the cache or possibly from the 253 // Start fetching the model either from the cache or possibly from the
254 // network if the model isn't in the cache. 254 // network if the model isn't in the cache.
255 model_fetcher_.reset(content::URLFetcher::Create( 255 model_fetcher_.reset(content::URLFetcher::Create(
256 0 /* ID used for testing */, GURL(kClientModelUrl), 256 0 /* ID used for testing */, GURL(kClientModelUrl),
257 content::URLFetcher::GET, this)); 257 content::URLFetcher::GET, this));
258 model_fetcher_->SetRequestContext(request_context_getter_.get()); 258 model_fetcher_->SetRequestContext(request_context_getter_.get());
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 } 524 }
525 } 525 }
526 for (int i = 0; i < model.page_term_size(); ++i) { 526 for (int i = 0; i < model.page_term_size(); ++i) {
527 if (model.page_term(i) < 0 || model.page_term(i) > max_index) { 527 if (model.page_term(i) < 0 || model.page_term(i) > max_index) {
528 return false; 528 return false;
529 } 529 }
530 } 530 }
531 return true; 531 return true;
532 } 532 }
533 } // namespace safe_browsing 533 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/web_cache_manager.cc ('k') | chrome/browser/safe_browsing/safe_browsing_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698