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

Side by Side Diff: chrome/browser/renderer_host/safe_browsing_resource_throttle.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 | « no previous file | chrome/browser/safe_browsing/safe_browsing_service.cc » ('j') | 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) 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/renderer_host/safe_browsing_resource_throttle.h" 5 #include "chrome/browser/renderer_host/safe_browsing_resource_throttle.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 threat_type_ = safe_browsing::SB_THREAT_TYPE_SAFE; 315 threat_type_ = safe_browsing::SB_THREAT_TYPE_SAFE;
316 if (defer_state_ != DEFERRED_NONE) { 316 if (defer_state_ != DEFERRED_NONE) {
317 ResumeRequest(); 317 ResumeRequest();
318 } 318 }
319 } else { 319 } else {
320 controller()->Cancel(); 320 controller()->Cancel();
321 } 321 }
322 } 322 }
323 323
324 bool SafeBrowsingResourceThrottle::CheckUrl(const GURL& url) { 324 bool SafeBrowsingResourceThrottle::CheckUrl(const GURL& url) {
325 TRACE_EVENT1("SafeBrowsing", "SafeBrowsingResourceThrottle::CheckUrl", "url", 325 TRACE_EVENT1("loader", "SafeBrowsingResourceThrottle::CheckUrl", "url",
326 url.spec()); 326 url.spec());
327 CHECK_EQ(state_, STATE_NONE); 327 CHECK_EQ(state_, STATE_NONE);
328 // To reduce aggregate latency on mobile, check only the most dangerous 328 // To reduce aggregate latency on mobile, check only the most dangerous
329 // resource types. 329 // resource types.
330 if (!database_manager_->CanCheckResourceType(resource_type_)) { 330 if (!database_manager_->CanCheckResourceType(resource_type_)) {
331 UMA_HISTOGRAM_ENUMERATION("SB2.ResourceTypes2.Skipped", resource_type_, 331 UMA_HISTOGRAM_ENUMERATION("SB2.ResourceTypes2.Skipped", resource_type_,
332 content::RESOURCE_TYPE_LAST_TYPE); 332 content::RESOURCE_TYPE_LAST_TYPE);
333 return true; 333 return true;
334 } 334 }
335 335
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 unchecked_redirect_url_, "defer_reason", 383 unchecked_redirect_url_, "defer_reason",
384 "resumed_redirect"); 384 "resumed_redirect");
385 } 385 }
386 } 386 }
387 387
388 if (resume) { 388 if (resume) {
389 defer_state_ = DEFERRED_NONE; 389 defer_state_ = DEFERRED_NONE;
390 controller()->Resume(); 390 controller()->Resume();
391 } 391 }
392 } 392 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/safe_browsing_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698