OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/renderer_host/resource_dispatcher_host.h" | 7 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 if (request_data.upload_data) { | 453 if (request_data.upload_data) { |
454 request->set_upload(request_data.upload_data); | 454 request->set_upload(request_data.upload_data); |
455 upload_size = request_data.upload_data->GetContentLength(); | 455 upload_size = request_data.upload_data->GetContentLength(); |
456 } | 456 } |
457 | 457 |
458 // Install a PrerenderResourceHandler if the requested URL could | 458 // Install a PrerenderResourceHandler if the requested URL could |
459 // be prerendered. This should be in front of the [a]syncResourceHandler, | 459 // be prerendered. This should be in front of the [a]syncResourceHandler, |
460 // but after the BufferedResourceHandler since it depends on the MIME | 460 // but after the BufferedResourceHandler since it depends on the MIME |
461 // sniffing capabilities in the BufferedResourceHandler. | 461 // sniffing capabilities in the BufferedResourceHandler. |
462 prerender::PrerenderResourceHandler* pre_handler = | 462 prerender::PrerenderResourceHandler* pre_handler = |
463 prerender::PrerenderResourceHandler::MaybeCreate(*request, | 463 prerender::PrerenderResourceHandler::MaybeCreate( |
464 context, | 464 *request, |
465 handler); | 465 context, |
| 466 handler, |
| 467 ((load_flags & net::LOAD_PRERENDER) != 0), |
| 468 child_id, route_id); |
466 if (pre_handler) | 469 if (pre_handler) |
467 handler = pre_handler; | 470 handler = pre_handler; |
468 | 471 |
469 // Install a CrossSiteResourceHandler if this request is coming from a | 472 // Install a CrossSiteResourceHandler if this request is coming from a |
470 // RenderViewHost with a pending cross-site request. We only check this for | 473 // RenderViewHost with a pending cross-site request. We only check this for |
471 // MAIN_FRAME requests. Unblock requests only come from a blocked page, do | 474 // MAIN_FRAME requests. Unblock requests only come from a blocked page, do |
472 // not count as cross-site, otherwise it gets blocked indefinitely. | 475 // not count as cross-site, otherwise it gets blocked indefinitely. |
473 if (request_data.resource_type == ResourceType::MAIN_FRAME && | 476 if (request_data.resource_type == ResourceType::MAIN_FRAME && |
474 process_type == ChildProcessInfo::RENDER_PROCESS && | 477 process_type == ChildProcessInfo::RENDER_PROCESS && |
475 CrossSiteRequestManager::GetInstance()-> | 478 CrossSiteRequestManager::GetInstance()-> |
(...skipping 1469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1945 return is_prefetch_enabled_; | 1948 return is_prefetch_enabled_; |
1946 } | 1949 } |
1947 | 1950 |
1948 // static | 1951 // static |
1949 void ResourceDispatcherHost::set_is_prefetch_enabled(bool value) { | 1952 void ResourceDispatcherHost::set_is_prefetch_enabled(bool value) { |
1950 is_prefetch_enabled_ = value; | 1953 is_prefetch_enabled_ = value; |
1951 } | 1954 } |
1952 | 1955 |
1953 // static | 1956 // static |
1954 bool ResourceDispatcherHost::is_prefetch_enabled_ = false; | 1957 bool ResourceDispatcherHost::is_prefetch_enabled_ = false; |
OLD | NEW |