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 1620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1631 handler.reset(new AsyncResourceHandler(request, this)); | 1631 handler.reset(new AsyncResourceHandler(request, this)); |
1632 } | 1632 } |
1633 | 1633 |
1634 // The RedirectToFileResourceHandler depends on being next in the chain. | 1634 // The RedirectToFileResourceHandler depends on being next in the chain. |
1635 if (request_data.download_to_file) { | 1635 if (request_data.download_to_file) { |
1636 handler.reset( | 1636 handler.reset( |
1637 new RedirectToFileResourceHandler(std::move(handler), request)); | 1637 new RedirectToFileResourceHandler(std::move(handler), request)); |
1638 } | 1638 } |
1639 } | 1639 } |
1640 | 1640 |
1641 const bool detached = | |
mmenke
2016/08/22 14:08:23
style: const is generally not used for stack vari
| |
1642 delegate()->ShouldSinkResponse(request, request_data.resource_type); | |
mmenke
2016/08/22 14:08:23
sink / detach: Should use consistent naming.
| |
1643 | |
1641 // Prefetches and <a ping> requests outlive their child process. | 1644 // Prefetches and <a ping> requests outlive their child process. |
1642 if (!sync_result && IsDetachableResourceType(request_data.resource_type)) { | 1645 if (detached || |
1646 (!sync_result && IsDetachableResourceType(request_data.resource_type))) { | |
mmenke
2016/08/22 14:08:22
Should we instead introduce a resource type for th
mmenke
2016/08/22 14:08:23
BUG: The sync_result check should cover the case
mmenke
2016/08/22 14:11:00
Moreover, do we really want the embedder controlli
| |
1643 handler.reset(new DetachableResourceHandler( | 1647 handler.reset(new DetachableResourceHandler( |
1644 request, | 1648 request, |
1645 base::TimeDelta::FromMilliseconds(kDefaultDetachableCancelDelayMs), | 1649 base::TimeDelta::FromMilliseconds(kDefaultDetachableCancelDelayMs), |
1646 std::move(handler))); | 1650 detached ? nullptr : std::move(handler))); |
1647 } | 1651 } |
1648 | 1652 |
1649 // PlzNavigate: If using --enable-browser-side-navigation, the | 1653 // PlzNavigate: If using --enable-browser-side-navigation, the |
1650 // CrossSiteResourceHandler is not needed. This codepath is not used for the | 1654 // CrossSiteResourceHandler is not needed. This codepath is not used for the |
1651 // actual navigation request, but only the subsequent blob URL load. This does | 1655 // actual navigation request, but only the subsequent blob URL load. This does |
1652 // not require request transfers. | 1656 // not require request transfers. |
1653 if (!IsBrowserSideNavigationEnabled()) { | 1657 if (!IsBrowserSideNavigationEnabled()) { |
1654 // Install a CrossSiteResourceHandler for all main frame requests. This will | 1658 // Install a CrossSiteResourceHandler for all main frame requests. This will |
1655 // check whether a transfer is required and, if so, pause for the UI thread | 1659 // check whether a transfer is required and, if so, pause for the UI thread |
1656 // to drive the transfer. | 1660 // to drive the transfer. |
(...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2719 << iter->filesystem_url().spec(); | 2723 << iter->filesystem_url().spec(); |
2720 return false; | 2724 return false; |
2721 } | 2725 } |
2722 } | 2726 } |
2723 } | 2727 } |
2724 } | 2728 } |
2725 return true; | 2729 return true; |
2726 } | 2730 } |
2727 | 2731 |
2728 } // namespace content | 2732 } // namespace content |
OLD | NEW |