Chromium Code Reviews| 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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 238 } | 238 } |
| 239 | 239 |
| 240 // If the BufferingHandler is acting as a pass-through handler, just ask the | 240 // If the BufferingHandler is acting as a pass-through handler, just ask the |
| 241 // upwards ResourceController to resume the request. | 241 // upwards ResourceController to resume the request. |
| 242 if (state_ == STATE_STARTING || state_ == STATE_STREAMING) { | 242 if (state_ == STATE_STARTING || state_ == STATE_STREAMING) { |
| 243 controller()->Resume(); | 243 controller()->Resume(); |
| 244 return; | 244 return; |
| 245 } | 245 } |
| 246 | 246 |
| 247 // Otherwise proceed with the replay of the response. If it is successful, | 247 // Otherwise proceed with the replay of the response. If it is successful, |
| 248 // it will resume the request. | 248 // it will resume the request. Posted as a task to avoid re-entrancy into |
| 249 AdvanceState(); | 249 // the calling class. |
| 250 base::ThreadTaskRunnerHandle::Get()->PostTask( | |
| 251 FROM_HERE, base::Bind(&MimeSniffingResourceHandler::AdvanceState, | |
| 252 weak_ptr_factory_.GetWeakPtr())); | |
|
Randy Smith (Not in Mondays)
2017/01/12 18:44:29
Hmmm. Your top level comment is that this PostTas
mmenke
2017/01/12 19:04:01
I think what I said is correct, but it's not exact
mmenke
2017/01/12 19:06:32
(Also note that in pass through mode, we call resu
Randy Smith (Not in Mondays)
2017/01/12 19:08:58
*bonk* That's what I was missing. Thank you. LG
mmenke
2017/01/12 19:17:15
Note that there was a bug in my argument about the
| |
| 250 } | 253 } |
| 251 | 254 |
| 252 void MimeSniffingResourceHandler::Cancel() { | 255 void MimeSniffingResourceHandler::Cancel() { |
| 253 controller()->Cancel(); | 256 controller()->Cancel(); |
| 254 } | 257 } |
| 255 | 258 |
| 256 void MimeSniffingResourceHandler::CancelAndIgnore() { | 259 void MimeSniffingResourceHandler::CancelAndIgnore() { |
| 257 controller()->CancelAndIgnore(); | 260 controller()->CancelAndIgnore(); |
| 258 } | 261 } |
| 259 | 262 |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 507 | 510 |
| 508 void MimeSniffingResourceHandler::OnPluginsLoaded( | 511 void MimeSniffingResourceHandler::OnPluginsLoaded( |
| 509 const std::vector<WebPluginInfo>& plugins) { | 512 const std::vector<WebPluginInfo>& plugins) { |
| 510 // No longer blocking on the plugins being loaded. | 513 // No longer blocking on the plugins being loaded. |
| 511 request()->LogUnblocked(); | 514 request()->LogUnblocked(); |
| 512 if (state_ == STATE_BUFFERING) | 515 if (state_ == STATE_BUFFERING) |
| 513 AdvanceState(); | 516 AdvanceState(); |
| 514 } | 517 } |
| 515 | 518 |
| 516 } // namespace content | 519 } // namespace content |
| OLD | NEW |