| 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 "content/browser/loader/mime_sniffing_resource_handler.h" | 5 #include "content/browser/loader/mime_sniffing_resource_handler.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 response_->head.mime_type.assign(new_type); | 211 response_->head.mime_type.assign(new_type); |
| 212 | 212 |
| 213 if (!made_final_decision && (bytes_read > 0)) | 213 if (!made_final_decision && (bytes_read > 0)) |
| 214 return true; | 214 return true; |
| 215 | 215 |
| 216 return ProcessState(defer); | 216 return ProcessState(defer); |
| 217 } | 217 } |
| 218 | 218 |
| 219 void MimeSniffingResourceHandler::OnResponseCompleted( | 219 void MimeSniffingResourceHandler::OnResponseCompleted( |
| 220 const net::URLRequestStatus& status, | 220 const net::URLRequestStatus& status, |
| 221 const std::string& security_info, | |
| 222 bool* defer) { | 221 bool* defer) { |
| 223 // Upon completion, act like a pass-through handler in case the downstream | 222 // Upon completion, act like a pass-through handler in case the downstream |
| 224 // handler defers OnResponseCompleted. | 223 // handler defers OnResponseCompleted. |
| 225 state_ = STATE_STREAMING; | 224 state_ = STATE_STREAMING; |
| 226 | 225 |
| 227 next_handler_->OnResponseCompleted(status, security_info, defer); | 226 next_handler_->OnResponseCompleted(status, defer); |
| 228 } | 227 } |
| 229 | 228 |
| 230 void MimeSniffingResourceHandler::Resume() { | 229 void MimeSniffingResourceHandler::Resume() { |
| 231 // If no information is currently being transmitted to downstream handlers, | 230 // If no information is currently being transmitted to downstream handlers, |
| 232 // they should not attempt to resume the request. | 231 // they should not attempt to resume the request. |
| 233 if (state_ == STATE_BUFFERING) { | 232 if (state_ == STATE_BUFFERING) { |
| 234 NOTREACHED(); | 233 NOTREACHED(); |
| 235 return; | 234 return; |
| 236 } | 235 } |
| 237 | 236 |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 | 508 |
| 510 void MimeSniffingResourceHandler::OnPluginsLoaded( | 509 void MimeSniffingResourceHandler::OnPluginsLoaded( |
| 511 const std::vector<WebPluginInfo>& plugins) { | 510 const std::vector<WebPluginInfo>& plugins) { |
| 512 // No longer blocking on the plugins being loaded. | 511 // No longer blocking on the plugins being loaded. |
| 513 request()->LogUnblocked(); | 512 request()->LogUnblocked(); |
| 514 if (state_ == STATE_BUFFERING) | 513 if (state_ == STATE_BUFFERING) |
| 515 AdvanceState(); | 514 AdvanceState(); |
| 516 } | 515 } |
| 517 | 516 |
| 518 } // namespace content | 517 } // namespace content |
| OLD | NEW |