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

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

Issue 816403003: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 6 years 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 | « chrome/browser/rlz/rlz.cc ('k') | chrome/browser/safe_browsing/database_manager.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 #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 <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 252
253 void ClientSideDetectionService::SendModelToRenderers() { 253 void ClientSideDetectionService::SendModelToRenderers() {
254 for (content::RenderProcessHost::iterator i( 254 for (content::RenderProcessHost::iterator i(
255 content::RenderProcessHost::AllHostsIterator()); 255 content::RenderProcessHost::AllHostsIterator());
256 !i.IsAtEnd(); i.Advance()) { 256 !i.IsAtEnd(); i.Advance()) {
257 SendModelToProcess(i.GetCurrentValue()); 257 SendModelToProcess(i.GetCurrentValue());
258 } 258 }
259 } 259 }
260 260
261 void ClientSideDetectionService::ScheduleFetchModel(int64 delay_ms) { 261 void ClientSideDetectionService::ScheduleFetchModel(int64 delay_ms) {
262 if (CommandLine::ForCurrentProcess()->HasSwitch( 262 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
263 switches::kSbDisableAutoUpdate)) 263 switches::kSbDisableAutoUpdate))
264 return; 264 return;
265 base::MessageLoop::current()->PostDelayedTask( 265 base::MessageLoop::current()->PostDelayedTask(
266 FROM_HERE, 266 FROM_HERE,
267 base::Bind(&ClientSideDetectionService::StartFetchModel, 267 base::Bind(&ClientSideDetectionService::StartFetchModel,
268 weak_factory_.GetWeakPtr()), 268 weak_factory_.GetWeakPtr()),
269 base::TimeDelta::FromMilliseconds(delay_ms)); 269 base::TimeDelta::FromMilliseconds(delay_ms));
270 } 270 }
271 271
272 void ClientSideDetectionService::StartFetchModel() { 272 void ClientSideDetectionService::StartFetchModel() {
273 if (enabled_) { 273 if (enabled_) {
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 GURL ClientSideDetectionService::GetClientReportUrl( 635 GURL ClientSideDetectionService::GetClientReportUrl(
636 const std::string& report_url) { 636 const std::string& report_url) {
637 GURL url(report_url); 637 GURL url(report_url);
638 std::string api_key = google_apis::GetAPIKey(); 638 std::string api_key = google_apis::GetAPIKey();
639 if (!api_key.empty()) 639 if (!api_key.empty())
640 url = url.Resolve("?key=" + net::EscapeQueryParamValue(api_key, true)); 640 url = url.Resolve("?key=" + net::EscapeQueryParamValue(api_key, true));
641 641
642 return url; 642 return url;
643 } 643 }
644 } // namespace safe_browsing 644 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/browser/rlz/rlz.cc ('k') | chrome/browser/safe_browsing/database_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698