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

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

Issue 1582843003: Move SafeBrowsing trace events to the loader category (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_service.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/util.h" 5 #include "components/safe_browsing_db/util.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 *canonicalized_query = escaped_canon_url_str.substr( 298 *canonicalized_query = escaped_canon_url_str.substr(
299 final_parsed.query.begin, final_parsed.query.len); 299 final_parsed.query.begin, final_parsed.query.len);
300 } 300 }
301 } 301 }
302 302
303 void UrlToFullHashes(const GURL& url, 303 void UrlToFullHashes(const GURL& url,
304 bool include_whitelist_hashes, 304 bool include_whitelist_hashes,
305 std::vector<SBFullHash>* full_hashes) { 305 std::vector<SBFullHash>* full_hashes) {
306 // Include this function in traces because it's not cheap so it should be 306 // Include this function in traces because it's not cheap so it should be
307 // called sparingly. 307 // called sparingly.
308 TRACE_EVENT2("SafeBrowsing", "UrlToFullHashes", "url", url.spec(), 308 TRACE_EVENT2("loader", "safe_browsing::UrlToFullHashes", "url", url.spec(),
309 "include_whitelist_hashes", include_whitelist_hashes); 309 "include_whitelist_hashes", include_whitelist_hashes);
310 std::vector<std::string> hosts; 310 std::vector<std::string> hosts;
311 if (url.HostIsIPAddress()) { 311 if (url.HostIsIPAddress()) {
312 hosts.push_back(url.host()); 312 hosts.push_back(url.host());
313 } else { 313 } else {
314 GenerateHostsToCheck(url, &hosts); 314 GenerateHostsToCheck(url, &hosts);
315 } 315 }
316 316
317 std::vector<std::string> paths; 317 std::vector<std::string> paths;
318 GeneratePathsToCheck(url, &paths); 318 GeneratePathsToCheck(url, &paths);
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 GenerateHostsToCheck(url, &hosts); 407 GenerateHostsToCheck(url, &hosts);
408 GeneratePathsToCheck(url, &paths); 408 GeneratePathsToCheck(url, &paths);
409 for (size_t h = 0; h < hosts.size(); ++h) { 409 for (size_t h = 0; h < hosts.size(); ++h) {
410 for (size_t p = 0; p < paths.size(); ++p) { 410 for (size_t p = 0; p < paths.size(); ++p) {
411 urls->push_back(hosts[h] + paths[p]); 411 urls->push_back(hosts[h] + paths[p]);
412 } 412 }
413 } 413 }
414 } 414 }
415 415
416 } // namespace safe_browsing 416 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698