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

Side by Side Diff: components/safe_browsing_db/remote_database_manager.cc

Issue 1703413002: Move common PVer4 code into a V4ProtocolManagerUtil class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Pass config as pointer, instead of reference Created 4 years, 10 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 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 "components/safe_browsing_db/remote_database_manager.h" 5 #include "components/safe_browsing_db/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"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 // CancelCheck() will delete *this. 87 // CancelCheck() will delete *this.
88 db_manager_->CancelCheck(client_); 88 db_manager_->CancelCheck(client_);
89 } 89 }
90 90
91 // 91 //
92 // RemoteSafeBrowsingDatabaseManager methods 92 // RemoteSafeBrowsingDatabaseManager methods
93 // 93 //
94 94
95 // TODO(nparker): Add more tests for this class 95 // TODO(nparker): Add more tests for this class
96 RemoteSafeBrowsingDatabaseManager::RemoteSafeBrowsingDatabaseManager() 96 RemoteSafeBrowsingDatabaseManager::RemoteSafeBrowsingDatabaseManager()
97 : RemoteSafeBrowsingDatabaseManager(NULL, V4GetHashProtocolConfig()) { 97 : RemoteSafeBrowsingDatabaseManager(NULL, V4ProtocolConfig()) {
98 } 98 }
99 99
100 RemoteSafeBrowsingDatabaseManager::RemoteSafeBrowsingDatabaseManager( 100 RemoteSafeBrowsingDatabaseManager::RemoteSafeBrowsingDatabaseManager(
101 net::URLRequestContextGetter* request_context_getter, 101 net::URLRequestContextGetter* request_context_getter,
102 const V4GetHashProtocolConfig& config) 102 const V4ProtocolConfig& config)
103 : SafeBrowsingDatabaseManager(request_context_getter, config), 103 : SafeBrowsingDatabaseManager(request_context_getter, config),
104 enabled_(false) { 104 enabled_(false) {
105 // Decide which resource types to check. These two are the minimum. 105 // Decide which resource types to check. These two are the minimum.
106 resource_types_to_check_.insert(content::RESOURCE_TYPE_MAIN_FRAME); 106 resource_types_to_check_.insert(content::RESOURCE_TYPE_MAIN_FRAME);
107 resource_types_to_check_.insert(content::RESOURCE_TYPE_SUB_FRAME); 107 resource_types_to_check_.insert(content::RESOURCE_TYPE_SUB_FRAME);
108 108
109 // The param is expected to be a comma-separated list of ints 109 // The param is expected to be a comma-separated list of ints
110 // corresponding to the enum types. We're keeping this finch 110 // corresponding to the enum types. We're keeping this finch
111 // control around so we can add back types if they later become dangerous. 111 // control around so we can add back types if they later become dangerous.
112 const std::string ints_str = variations::GetVariationParamValue( 112 const std::string ints_str = variations::GetVariationParamValue(
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 // |current_requests_|, so we make a copy first. 297 // |current_requests_|, so we make a copy first.
298 std::vector<ClientRequest*> to_callback(current_requests_); 298 std::vector<ClientRequest*> to_callback(current_requests_);
299 for (auto req : to_callback) { 299 for (auto req : to_callback) {
300 DVLOG(1) << "Stopping: Invoking unfinished req for URL " << req->url(); 300 DVLOG(1) << "Stopping: Invoking unfinished req for URL " << req->url();
301 req->OnRequestDone(SB_THREAT_TYPE_SAFE, std::string()); 301 req->OnRequestDone(SB_THREAT_TYPE_SAFE, std::string());
302 } 302 }
303 enabled_ = false; 303 enabled_ = false;
304 } 304 }
305 305
306 } // namespace safe_browsing 306 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « components/safe_browsing_db/remote_database_manager.h ('k') | components/safe_browsing_db/util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698