| 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 <iterator> | 7 #include <iterator> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 const net::URLRequest* request, | 87 const net::URLRequest* request, |
| 88 content::ResourceType resource_type, | 88 content::ResourceType resource_type, |
| 89 safe_browsing::SafeBrowsingService* sb_service) | 89 safe_browsing::SafeBrowsingService* sb_service) |
| 90 : state_(STATE_NONE), | 90 : state_(STATE_NONE), |
| 91 defer_state_(DEFERRED_NONE), | 91 defer_state_(DEFERRED_NONE), |
| 92 threat_type_(safe_browsing::SB_THREAT_TYPE_SAFE), | 92 threat_type_(safe_browsing::SB_THREAT_TYPE_SAFE), |
| 93 database_manager_(sb_service->database_manager()), | 93 database_manager_(sb_service->database_manager()), |
| 94 ui_manager_(sb_service->ui_manager()), | 94 ui_manager_(sb_service->ui_manager()), |
| 95 request_(request), | 95 request_(request), |
| 96 resource_type_(resource_type), | 96 resource_type_(resource_type), |
| 97 bound_net_log_(net::BoundNetLog::Make(request->net_log().net_log(), | 97 bound_net_log_( |
| 98 NetLogSourceType::SAFE_BROWSING)) {} | 98 net::NetLogWithSource::Make(request->net_log().net_log(), |
| 99 NetLogSourceType::SAFE_BROWSING)) {} |
| 99 | 100 |
| 100 SafeBrowsingResourceThrottle::~SafeBrowsingResourceThrottle() { | 101 SafeBrowsingResourceThrottle::~SafeBrowsingResourceThrottle() { |
| 101 if (defer_state_ != DEFERRED_NONE) { | 102 if (defer_state_ != DEFERRED_NONE) { |
| 102 EndNetLogEvent(NetLogEventType::SAFE_BROWSING_DEFERRED, nullptr, nullptr); | 103 EndNetLogEvent(NetLogEventType::SAFE_BROWSING_DEFERRED, nullptr, nullptr); |
| 103 } | 104 } |
| 104 | 105 |
| 105 if (state_ == STATE_CHECKING_URL) { | 106 if (state_ == STATE_CHECKING_URL) { |
| 106 database_manager_->CancelCheck(this); | 107 database_manager_->CancelCheck(this); |
| 107 EndNetLogEvent(NetLogEventType::SAFE_BROWSING_CHECKING_URL, "result", | 108 EndNetLogEvent(NetLogEventType::SAFE_BROWSING_CHECKING_URL, "result", |
| 108 "request_canceled"); | 109 "request_canceled"); |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 unchecked_redirect_url_, "defer_reason", | 418 unchecked_redirect_url_, "defer_reason", |
| 418 "resumed_redirect"); | 419 "resumed_redirect"); |
| 419 } | 420 } |
| 420 } | 421 } |
| 421 | 422 |
| 422 if (resume) { | 423 if (resume) { |
| 423 defer_state_ = DEFERRED_NONE; | 424 defer_state_ = DEFERRED_NONE; |
| 424 controller()->Resume(); | 425 controller()->Resume(); |
| 425 } | 426 } |
| 426 } | 427 } |
| OLD | NEW |