Chromium Code Reviews| 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 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 460 if (request_data.upload_data) { | 460 if (request_data.upload_data) { |
| 461 request->set_upload(request_data.upload_data); | 461 request->set_upload(request_data.upload_data); |
| 462 upload_size = request_data.upload_data->GetContentLength(); | 462 upload_size = request_data.upload_data->GetContentLength(); |
| 463 } | 463 } |
| 464 | 464 |
| 465 // Install a PrerenderResourceHandler if the requested URL could | 465 // Install a PrerenderResourceHandler if the requested URL could |
| 466 // be prerendered. This should be in front of the [a]syncResourceHandler, | 466 // be prerendered. This should be in front of the [a]syncResourceHandler, |
| 467 // but after the BufferedResourceHandler since it depends on the MIME | 467 // but after the BufferedResourceHandler since it depends on the MIME |
| 468 // sniffing capabilities in the BufferedResourceHandler. | 468 // sniffing capabilities in the BufferedResourceHandler. |
| 469 prerender::PrerenderResourceHandler* pre_handler = | 469 prerender::PrerenderResourceHandler* pre_handler = |
| 470 prerender::PrerenderResourceHandler::MaybeCreate(*request, | 470 prerender::PrerenderResourceHandler::MaybeCreate( |
| 471 context, | 471 *request, context, handler, ((load_flags & net::LOAD_PRERENDER) != 0), |
|
cbentzel
2011/03/18 18:35:43
Nit: can just be load_flags & net::LOAD_PRERENDER,
dominich
2011/03/21 16:36:11
Windows build fails with an error about forcing an
| |
| 472 handler); | 472 child_id, route_id); |
| 473 if (pre_handler) | 473 if (pre_handler) |
| 474 handler = pre_handler; | 474 handler = pre_handler; |
| 475 | 475 |
| 476 // Install a CrossSiteResourceHandler if this request is coming from a | 476 // Install a CrossSiteResourceHandler if this request is coming from a |
| 477 // RenderViewHost with a pending cross-site request. We only check this for | 477 // RenderViewHost with a pending cross-site request. We only check this for |
| 478 // MAIN_FRAME requests. Unblock requests only come from a blocked page, do | 478 // MAIN_FRAME requests. Unblock requests only come from a blocked page, do |
| 479 // not count as cross-site, otherwise it gets blocked indefinitely. | 479 // not count as cross-site, otherwise it gets blocked indefinitely. |
| 480 if (request_data.resource_type == ResourceType::MAIN_FRAME && | 480 if (request_data.resource_type == ResourceType::MAIN_FRAME && |
| 481 process_type == ChildProcessInfo::RENDER_PROCESS && | 481 process_type == ChildProcessInfo::RENDER_PROCESS && |
| 482 CrossSiteRequestManager::GetInstance()-> | 482 CrossSiteRequestManager::GetInstance()-> |
| (...skipping 1475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1958 return is_prefetch_enabled_; | 1958 return is_prefetch_enabled_; |
| 1959 } | 1959 } |
| 1960 | 1960 |
| 1961 // static | 1961 // static |
| 1962 void ResourceDispatcherHost::set_is_prefetch_enabled(bool value) { | 1962 void ResourceDispatcherHost::set_is_prefetch_enabled(bool value) { |
| 1963 is_prefetch_enabled_ = value; | 1963 is_prefetch_enabled_ = value; |
| 1964 } | 1964 } |
| 1965 | 1965 |
| 1966 // static | 1966 // static |
| 1967 bool ResourceDispatcherHost::is_prefetch_enabled_ = false; | 1967 bool ResourceDispatcherHost::is_prefetch_enabled_ = false; |
| OLD | NEW |