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

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

Issue 2648193002: SafeBrowsing: Move enabled_ to base class DB Manager (Closed)
Patch Set: Update comments Created 3 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 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 <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 UMA_HISTOGRAM_TIMES("SB2.RemoteCall.Elapsed", timer_.Elapsed()); 91 UMA_HISTOGRAM_TIMES("SB2.RemoteCall.Elapsed", timer_.Elapsed());
92 // CancelCheck() will delete *this. 92 // CancelCheck() will delete *this.
93 db_manager_->CancelCheck(client_); 93 db_manager_->CancelCheck(client_);
94 } 94 }
95 95
96 // 96 //
97 // RemoteSafeBrowsingDatabaseManager methods 97 // RemoteSafeBrowsingDatabaseManager methods
98 // 98 //
99 99
100 // TODO(nparker): Add more tests for this class 100 // TODO(nparker): Add more tests for this class
101 RemoteSafeBrowsingDatabaseManager::RemoteSafeBrowsingDatabaseManager() 101 RemoteSafeBrowsingDatabaseManager::RemoteSafeBrowsingDatabaseManager() {
102 : enabled_(false) {
103 // Decide which resource types to check. These two are the minimum. 102 // Decide which resource types to check. These two are the minimum.
104 resource_types_to_check_.insert(content::RESOURCE_TYPE_MAIN_FRAME); 103 resource_types_to_check_.insert(content::RESOURCE_TYPE_MAIN_FRAME);
105 resource_types_to_check_.insert(content::RESOURCE_TYPE_SUB_FRAME); 104 resource_types_to_check_.insert(content::RESOURCE_TYPE_SUB_FRAME);
106 105
107 // The param is expected to be a comma-separated list of ints 106 // The param is expected to be a comma-separated list of ints
108 // corresponding to the enum types. We're keeping this finch 107 // corresponding to the enum types. We're keeping this finch
109 // control around so we can add back types if they later become dangerous. 108 // control around so we can add back types if they later become dangerous.
110 const std::string ints_str = variations::GetVariationParamValue( 109 const std::string ints_str = variations::GetVariationParamValue(
111 kAndroidFieldExperiment, kAndroidTypesToCheckParam); 110 kAndroidFieldExperiment, kAndroidTypesToCheckParam);
112 if (ints_str.empty()) { 111 if (ints_str.empty()) {
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 for (auto* req : to_callback) { 293 for (auto* req : to_callback) {
295 DVLOG(1) << "Stopping: Invoking unfinished req for URL " << req->url(); 294 DVLOG(1) << "Stopping: Invoking unfinished req for URL " << req->url();
296 req->OnRequestDone(SB_THREAT_TYPE_SAFE, ThreatMetadata()); 295 req->OnRequestDone(SB_THREAT_TYPE_SAFE, ThreatMetadata());
297 } 296 }
298 enabled_ = false; 297 enabled_ = false;
299 298
300 SafeBrowsingDatabaseManager::StopOnIOThread(shutdown); 299 SafeBrowsingDatabaseManager::StopOnIOThread(shutdown);
301 } 300 }
302 301
303 } // namespace safe_browsing 302 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « components/safe_browsing_db/remote_database_manager.h ('k') | components/safe_browsing_db/test_database_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698