| 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 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading | 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading |
| 6 | 6 |
| 7 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 7 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
| 8 | 8 |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 | 10 |
| (...skipping 1673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1684 // Add the post mime sniffing throttles. | 1684 // Add the post mime sniffing throttles. |
| 1685 handler.reset(new ThrottlingResourceHandler( | 1685 handler.reset(new ThrottlingResourceHandler( |
| 1686 std::move(handler), request, std::move(post_mime_sniffing_throttles))); | 1686 std::move(handler), request, std::move(post_mime_sniffing_throttles))); |
| 1687 | 1687 |
| 1688 PluginService* plugin_service = nullptr; | 1688 PluginService* plugin_service = nullptr; |
| 1689 #if defined(ENABLE_PLUGINS) | 1689 #if defined(ENABLE_PLUGINS) |
| 1690 plugin_service = PluginService::GetInstance(); | 1690 plugin_service = PluginService::GetInstance(); |
| 1691 #endif | 1691 #endif |
| 1692 | 1692 |
| 1693 // Insert a buffered event handler to sniff the mime type. | 1693 // Insert a buffered event handler to sniff the mime type. |
| 1694 // Note: all ResourceHandler following the MimeSniffingResourceHandler should | 1694 // Note: all ResourceHandler following the MimeSniffingResourceHandler |
| 1695 // expect OnWillRead to be called *before* OnResponseStarted as part of the | 1695 // should expect OnWillRead to be called *before* OnResponseStarted as |
| 1696 // mime sniffing process. | 1696 // part of the mime sniffing process. |
| 1697 handler.reset(new MimeSniffingResourceHandler( | 1697 handler.reset(new MimeSniffingResourceHandler( |
| 1698 std::move(handler), this, plugin_service, intercepting_handler, request)); | 1698 std::move(handler), this, plugin_service, intercepting_handler, request, |
| 1699 fetch_request_context_type)); |
| 1699 | 1700 |
| 1700 // Add the pre mime sniffing throttles. | 1701 // Add the pre mime sniffing throttles. |
| 1701 handler.reset(new ThrottlingResourceHandler( | 1702 handler.reset(new ThrottlingResourceHandler( |
| 1702 std::move(handler), request, std::move(pre_mime_sniffing_throttles))); | 1703 std::move(handler), request, std::move(pre_mime_sniffing_throttles))); |
| 1703 | 1704 |
| 1704 return handler; | 1705 return handler; |
| 1705 } | 1706 } |
| 1706 | 1707 |
| 1707 void ResourceDispatcherHostImpl::OnReleaseDownloadedFile(int request_id) { | 1708 void ResourceDispatcherHostImpl::OnReleaseDownloadedFile(int request_id) { |
| 1708 UnregisterDownloadedTempFile(filter_->child_id(), request_id); | 1709 UnregisterDownloadedTempFile(filter_->child_id(), request_id); |
| (...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2710 &throttles); | 2711 &throttles); |
| 2711 if (!throttles.empty()) { | 2712 if (!throttles.empty()) { |
| 2712 handler.reset(new ThrottlingResourceHandler(std::move(handler), request, | 2713 handler.reset(new ThrottlingResourceHandler(std::move(handler), request, |
| 2713 std::move(throttles))); | 2714 std::move(throttles))); |
| 2714 } | 2715 } |
| 2715 } | 2716 } |
| 2716 return handler; | 2717 return handler; |
| 2717 } | 2718 } |
| 2718 | 2719 |
| 2719 } // namespace content | 2720 } // namespace content |
| OLD | NEW |