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

Side by Side Diff: chrome/browser/renderer_host/safe_browsing_resource_throttle.cc

Issue 2005273002: Move MimeTypeResourceHandler before ThrottlingResourceHandler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added missing file Created 4 years, 4 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
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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
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::MustProcessResponseBeforeMimeSniffing() {
173 return true;
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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 unchecked_redirect_url_, "defer_reason", 397 unchecked_redirect_url_, "defer_reason",
394 "resumed_redirect"); 398 "resumed_redirect");
395 } 399 }
396 } 400 }
397 401
398 if (resume) { 402 if (resume) {
399 defer_state_ = DEFERRED_NONE; 403 defer_state_ = DEFERRED_NONE;
400 controller()->Resume(); 404 controller()->Resume();
401 } 405 }
402 } 406 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698