Chromium Code Reviews| Index: content/browser/loader/resource_dispatcher_host_impl.cc |
| diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc |
| index 50153c6706bfa0951f8506161aa063702a7069b1..ab3ebb5d4c5c7d6de73bebd3f701957aeaa6c27f 100644 |
| --- a/content/browser/loader/resource_dispatcher_host_impl.cc |
| +++ b/content/browser/loader/resource_dispatcher_host_impl.cc |
| @@ -55,6 +55,7 @@ |
| #include "content/browser/loader/navigation_url_loader_impl_core.h" |
| #include "content/browser/loader/power_save_block_resource_throttle.h" |
| #include "content/browser/loader/redirect_to_file_resource_handler.h" |
| +#include "content/browser/loader/replacing_resource_handler.h" |
| #include "content/browser/loader/resource_message_filter.h" |
| #include "content/browser/loader/resource_request_info_impl.h" |
| #include "content/browser/loader/stream_resource_handler.h" |
| @@ -1725,9 +1726,11 @@ ResourceDispatcherHostImpl::AddStandardHandlers( |
| #if defined(ENABLE_PLUGINS) |
| plugin_service = PluginService::GetInstance(); |
| #endif |
| - // Insert a buffered event handler before the actual one. |
| - handler.reset(new MimeTypeResourceHandler(std::move(handler), this, |
| - plugin_service, request)); |
| + |
| + // The ReplacingResourceThrottle will replace its next handler with an |
| + // appropriate one based on the MIME type of the response if needed. |
|
mmenke
2016/06/09 18:18:42
Maybe mention that this must be at the end of the
clamy
2016/06/21 16:14:15
Done.
|
| + handler.reset(new ReplacingResourceHandler(std::move(handler), this, |
| + plugin_service, request)); |
| ScopedVector<ResourceThrottle> throttles; |
| @@ -1759,6 +1762,9 @@ ResourceDispatcherHostImpl::AddStandardHandlers( |
| handler.reset(new ThrottlingResourceHandler(std::move(handler), request, |
| std::move(throttles))); |
| + // Insert a buffered event handler to sniff the mime type first. |
| + handler.reset(new MimeTypeResourceHandler(std::move(handler), request)); |
| + |
| return handler; |
| } |