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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
162 if (state_ == STATE_CHECKING_URL || | 162 if (state_ == STATE_CHECKING_URL || |
163 state_ == STATE_DISPLAYING_BLOCKING_PAGE) { | 163 state_ == STATE_DISPLAYING_BLOCKING_PAGE) { |
164 defer_state_ = DEFERRED_PROCESSING; | 164 defer_state_ = DEFERRED_PROCESSING; |
165 defer_start_time_ = base::TimeTicks::Now(); | 165 defer_start_time_ = base::TimeTicks::Now(); |
166 *defer = true; | 166 *defer = true; |
167 BeginNetLogEvent(NetLog::TYPE_SAFE_BROWSING_DEFERRED, request_->url(), | 167 BeginNetLogEvent(NetLog::TYPE_SAFE_BROWSING_DEFERRED, request_->url(), |
168 "defer_reason", "at_response"); | 168 "defer_reason", "at_response"); |
169 } | 169 } |
170 } | 170 } |
171 | 171 |
172 bool SafeBrowsingResourceThrottle::MustProcessResponseBeforeReadingBody() { | |
173 return true; | |
mmenke
2016/08/19 16:33:02
Also, if we have any SafeBrowsing integration test
mmenke
2016/08/19 16:33:02
Think this needs an explanatory comment.
clamy
2016/09/01 23:19:40
Added a comment.
clamy
2016/09/01 23:19:40
Considering that we now have a unit test to check
| |
174 } | |
175 | |
172 void SafeBrowsingResourceThrottle::WillRedirectRequest( | 176 void SafeBrowsingResourceThrottle::WillRedirectRequest( |
173 const net::RedirectInfo& redirect_info, | 177 const net::RedirectInfo& redirect_info, |
174 bool* defer) { | 178 bool* defer) { |
175 CHECK_EQ(defer_state_, DEFERRED_NONE); | 179 CHECK_EQ(defer_state_, DEFERRED_NONE); |
176 | 180 |
177 // Prev check completed and was safe. | 181 // Prev check completed and was safe. |
178 if (state_ == STATE_NONE) { | 182 if (state_ == STATE_NONE) { |
179 // Save the redirect urls for possible malware detail reporting later. | 183 // Save the redirect urls for possible malware detail reporting later. |
180 redirect_urls_.push_back(redirect_info.new_url); | 184 redirect_urls_.push_back(redirect_info.new_url); |
181 | 185 |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
388 unchecked_redirect_url_, "defer_reason", | 392 unchecked_redirect_url_, "defer_reason", |
389 "resumed_redirect"); | 393 "resumed_redirect"); |
390 } | 394 } |
391 } | 395 } |
392 | 396 |
393 if (resume) { | 397 if (resume) { |
394 defer_state_ = DEFERRED_NONE; | 398 defer_state_ = DEFERRED_NONE; |
395 controller()->Resume(); | 399 controller()->Resume(); |
396 } | 400 } |
397 } | 401 } |
OLD | NEW |