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

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

Issue 2478573004: Convert GURL::{host,path} to GURL::{host_piece,path_piece} for ==. (Closed)
Patch Set: rebase to #431874 Created 4 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 (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/browser_feature_extractor.h" 5 #include "chrome/browser/safe_browsing/browser_feature_extractor.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <map> 9 #include <map>
10 #include <utility> 10 #include <utility>
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 if (url_index == -1 && entry->GetURL() == request_url) { 205 if (url_index == -1 && entry->GetURL() == request_url) {
206 // It's possible that we've been on the on the possibly phishy url before 206 // It's possible that we've been on the on the possibly phishy url before
207 // in this tab, so make sure that we use the latest navigation for 207 // in this tab, so make sure that we use the latest navigation for
208 // features. 208 // features.
209 // Note that it's possible that the url_index should always be the 209 // Note that it's possible that the url_index should always be the
210 // latest entry, but I'm worried about possible races during a navigation 210 // latest entry, but I'm worried about possible races during a navigation
211 // and transient entries (i.e. interstiatials) so for now we will just 211 // and transient entries (i.e. interstiatials) so for now we will just
212 // be cautious. 212 // be cautious.
213 url_index = index; 213 url_index = index;
214 } else if (index < url_index) { 214 } else if (index < url_index) {
215 if (entry->GetURL().host() == request_url.host()) { 215 if (entry->GetURL().host_piece() == request_url.host_piece()) {
216 first_host_index = index; 216 first_host_index = index;
217 } else { 217 } else {
218 // We have found the possibly phishing url, but we are no longer on the 218 // We have found the possibly phishing url, but we are no longer on the
219 // host. No reason to look back any further. 219 // host. No reason to look back any further.
220 break; 220 break;
221 } 221 }
222 } 222 }
223 } 223 }
224 224
225 // Add features pertaining to how we got to 225 // Add features pertaining to how we got to
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 // Limit the number of matched bad IPs in one request to control 487 // Limit the number of matched bad IPs in one request to control
488 // the request's size 488 // the request's size
489 if (matched_bad_ips >= kMaxMalwareIPPerRequest) { 489 if (matched_bad_ips >= kMaxMalwareIPPerRequest) {
490 break; 490 break;
491 } 491 }
492 } 492 }
493 callback.Run(true, std::move(request)); 493 callback.Run(true, std::move(request));
494 } 494 }
495 495
496 } // namespace safe_browsing 496 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/browser/renderer_context_menu/render_view_context_menu.cc ('k') | chrome/browser/search/iframe_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698