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

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

Issue 1420053005: Move code in components/safe_browsing_db and chrome/browser/s_b/ under the safe_browsing namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@02_components_move
Patch Set: Remove '// namespace safe_browsing' for a small fwd decl block. Created 5 years, 1 month 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/remote_database_manager.h" 5 #include "chrome/browser/safe_browsing/remote_database_manager.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/metrics/histogram_macros.h" 9 #include "base/metrics/histogram_macros.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
11 #include "base/strings/string_split.h" 11 #include "base/strings/string_split.h"
12 #include "base/timer/elapsed_timer.h" 12 #include "base/timer/elapsed_timer.h"
13 #include "chrome/browser/safe_browsing/safe_browsing_api_handler.h" 13 #include "chrome/browser/safe_browsing/safe_browsing_api_handler.h"
14 #include "components/variations/variations_associated_data.h" 14 #include "components/variations/variations_associated_data.h"
15 #include "content/public/browser/browser_thread.h" 15 #include "content/public/browser/browser_thread.h"
16 16
17 using content::BrowserThread; 17 using content::BrowserThread;
18 18
19 namespace { 19 namespace {
20 20
21 // Android field trial 21 // Android field trial
22 const char kAndroidFieldExperiment[] = "SafeBrowsingAndroid"; 22 const char kAndroidFieldExperiment[] = "SafeBrowsingAndroid";
23 const char kAndroidFieldParam[] = "enabled"; 23 const char kAndroidFieldParam[] = "enabled";
24 const char kAndroidFieldParamEnabledValue[] = "true"; 24 const char kAndroidFieldParamEnabledValue[] = "true";
25 const char kAndroidTypesToCheckParam[] = "types_to_check"; 25 const char kAndroidTypesToCheckParam[] = "types_to_check";
26 26
27 } // namespace 27 } // namespace
28 28
29 namespace safe_browsing {
30
29 // 31 //
30 // RemoteSafeBrowsingDatabaseManager::ClientRequest methods 32 // RemoteSafeBrowsingDatabaseManager::ClientRequest methods
31 // 33 //
32 class RemoteSafeBrowsingDatabaseManager::ClientRequest { 34 class RemoteSafeBrowsingDatabaseManager::ClientRequest {
33 public: 35 public:
34 ClientRequest(Client* client, 36 ClientRequest(Client* client,
35 RemoteSafeBrowsingDatabaseManager* db_manager, 37 RemoteSafeBrowsingDatabaseManager* db_manager,
36 const GURL& url); 38 const GURL& url);
37 39
38 static void OnRequestDoneWeak(const base::WeakPtr<ClientRequest>& req, 40 static void OnRequestDoneWeak(const base::WeakPtr<ClientRequest>& req,
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 258
257 // Call back and delete any remaining clients. OnRequestDone() modifies 259 // Call back and delete any remaining clients. OnRequestDone() modifies
258 // |current_requests_|, so we make a copy first. 260 // |current_requests_|, so we make a copy first.
259 std::vector<ClientRequest*> to_callback(current_requests_); 261 std::vector<ClientRequest*> to_callback(current_requests_);
260 for (auto req : to_callback) { 262 for (auto req : to_callback) {
261 DVLOG(1) << "Stopping: Invoking unfinished req for URL " << req->url(); 263 DVLOG(1) << "Stopping: Invoking unfinished req for URL " << req->url();
262 req->OnRequestDone(SB_THREAT_TYPE_SAFE, std::string()); 264 req->OnRequestDone(SB_THREAT_TYPE_SAFE, std::string());
263 } 265 }
264 enabled_ = false; 266 enabled_ = false;
265 } 267 }
268
269 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698