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 <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1124 | 1124 |
1125 // The RedirectToFileResourceHandler depends on being next in the chain. | 1125 // The RedirectToFileResourceHandler depends on being next in the chain. |
1126 if (request_data.download_to_file) { | 1126 if (request_data.download_to_file) { |
1127 handler.reset( | 1127 handler.reset( |
1128 new RedirectToFileResourceHandler(handler.Pass(), request, this)); | 1128 new RedirectToFileResourceHandler(handler.Pass(), request, this)); |
1129 } | 1129 } |
1130 | 1130 |
1131 // Install a CrossSiteResourceHandler for all main frame requests. This will | 1131 // Install a CrossSiteResourceHandler for all main frame requests. This will |
1132 // let us check whether a transfer is required and pause for the unload | 1132 // let us check whether a transfer is required and pause for the unload |
1133 // handler either if so or if a cross-process navigation is already under way. | 1133 // handler either if so or if a cross-process navigation is already under way. |
1134 if (request_data.resource_type == ResourceType::MAIN_FRAME && | 1134 if ((request_data.resource_type == ResourceType::MAIN_FRAME || |
| 1135 request_data.resource_type == ResourceType::SUB_FRAME) && |
1135 process_type == PROCESS_TYPE_RENDERER) { | 1136 process_type == PROCESS_TYPE_RENDERER) { |
1136 handler.reset(new CrossSiteResourceHandler(handler.Pass(), request)); | 1137 handler.reset(new CrossSiteResourceHandler(handler.Pass(), request)); |
1137 } | 1138 } |
1138 | 1139 |
1139 // Insert a buffered event handler before the actual one. | 1140 // Insert a buffered event handler before the actual one. |
1140 handler.reset( | 1141 handler.reset( |
1141 new BufferedResourceHandler(handler.Pass(), this, request)); | 1142 new BufferedResourceHandler(handler.Pass(), this, request)); |
1142 | 1143 |
1143 ScopedVector<ResourceThrottle> throttles; | 1144 ScopedVector<ResourceThrottle> throttles; |
1144 if (delegate_) { | 1145 if (delegate_) { |
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1933 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS) | 1934 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS) |
1934 && !policy->CanReadRawCookies(child_id)) { | 1935 && !policy->CanReadRawCookies(child_id)) { |
1935 VLOG(1) << "Denied unauthorized request for raw headers"; | 1936 VLOG(1) << "Denied unauthorized request for raw headers"; |
1936 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS; | 1937 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS; |
1937 } | 1938 } |
1938 | 1939 |
1939 return load_flags; | 1940 return load_flags; |
1940 } | 1941 } |
1941 | 1942 |
1942 } // namespace content | 1943 } // namespace content |
OLD | NEW |