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

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

Issue 1515703005: WebRequest API: add more resource types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace == with && 2x Created 5 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
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"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 resource_types_to_check_.insert(content::RESOURCE_TYPE_SUB_FRAME); 97 resource_types_to_check_.insert(content::RESOURCE_TYPE_SUB_FRAME);
98 98
99 // The param is expected to be a comma-separated list of ints 99 // The param is expected to be a comma-separated list of ints
100 // corresponding to the enum types. We're keeping this finch 100 // corresponding to the enum types. We're keeping this finch
101 // control around so we can add back types if they later become dangerous. 101 // control around so we can add back types if they later become dangerous.
102 const std::string ints_str = variations::GetVariationParamValue( 102 const std::string ints_str = variations::GetVariationParamValue(
103 kAndroidFieldExperiment, kAndroidTypesToCheckParam); 103 kAndroidFieldExperiment, kAndroidTypesToCheckParam);
104 if (ints_str.empty()) { 104 if (ints_str.empty()) {
105 // By default, we check all types except a few. 105 // By default, we check all types except a few.
106 static_assert(content::RESOURCE_TYPE_LAST_TYPE == 106 static_assert(content::RESOURCE_TYPE_LAST_TYPE ==
107 content::RESOURCE_TYPE_SERVICE_WORKER + 1, 107 content::RESOURCE_TYPE_PLUGIN_RESOURCE + 1,
108 "Decide if new resource type should be skipped on mobile."); 108 "Decide if new resource type should be skipped on mobile.");
109 for (int t_int = 0; t_int < content::RESOURCE_TYPE_LAST_TYPE; t_int++) { 109 for (int t_int = 0; t_int < content::RESOURCE_TYPE_LAST_TYPE; t_int++) {
110 content::ResourceType t = static_cast<content::ResourceType>(t_int); 110 content::ResourceType t = static_cast<content::ResourceType>(t_int);
111 switch (t) { 111 switch (t) {
112 case content::RESOURCE_TYPE_STYLESHEET: 112 case content::RESOURCE_TYPE_STYLESHEET:
113 case content::RESOURCE_TYPE_IMAGE: 113 case content::RESOURCE_TYPE_IMAGE:
114 case content::RESOURCE_TYPE_FONT_RESOURCE: 114 case content::RESOURCE_TYPE_FONT_RESOURCE:
115 case content::RESOURCE_TYPE_FAVICON: 115 case content::RESOURCE_TYPE_FAVICON:
116 break; 116 break;
117 default: 117 default:
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 // |current_requests_|, so we make a copy first. 276 // |current_requests_|, so we make a copy first.
277 std::vector<ClientRequest*> to_callback(current_requests_); 277 std::vector<ClientRequest*> to_callback(current_requests_);
278 for (auto req : to_callback) { 278 for (auto req : to_callback) {
279 DVLOG(1) << "Stopping: Invoking unfinished req for URL " << req->url(); 279 DVLOG(1) << "Stopping: Invoking unfinished req for URL " << req->url();
280 req->OnRequestDone(SB_THREAT_TYPE_SAFE, std::string()); 280 req->OnRequestDone(SB_THREAT_TYPE_SAFE, std::string());
281 } 281 }
282 enabled_ = false; 282 enabled_ = false;
283 } 283 }
284 284
285 } // namespace safe_browsing 285 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698