OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |