Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Side by Side Diff: content/browser/renderer_host/resource_dispatcher_host.cc

Issue 6625066: Add pending preloads indexed by routing id. Start preloading once we navigate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Responding to comments Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 if (request_data.upload_data) { 454 if (request_data.upload_data) {
455 request->set_upload(request_data.upload_data); 455 request->set_upload(request_data.upload_data);
456 upload_size = request_data.upload_data->GetContentLength(); 456 upload_size = request_data.upload_data->GetContentLength();
457 } 457 }
458 458
459 // Install a PrerenderResourceHandler if the requested URL could 459 // Install a PrerenderResourceHandler if the requested URL could
460 // be prerendered. This should be in front of the [a]syncResourceHandler, 460 // be prerendered. This should be in front of the [a]syncResourceHandler,
461 // but after the BufferedResourceHandler since it depends on the MIME 461 // but after the BufferedResourceHandler since it depends on the MIME
462 // sniffing capabilities in the BufferedResourceHandler. 462 // sniffing capabilities in the BufferedResourceHandler.
463 prerender::PrerenderResourceHandler* pre_handler = 463 prerender::PrerenderResourceHandler* pre_handler =
464 prerender::PrerenderResourceHandler::MaybeCreate(*request, 464 prerender::PrerenderResourceHandler::MaybeCreate(
465 context, 465 *request,
466 handler); 466 context,
467 handler,
468 ((load_flags & net::LOAD_PRERENDER) != 0),
469 child_id, route_id);
467 if (pre_handler) 470 if (pre_handler)
468 handler = pre_handler; 471 handler = pre_handler;
469 472
470 // Install a CrossSiteResourceHandler if this request is coming from a 473 // Install a CrossSiteResourceHandler if this request is coming from a
471 // RenderViewHost with a pending cross-site request. We only check this for 474 // RenderViewHost with a pending cross-site request. We only check this for
472 // MAIN_FRAME requests. Unblock requests only come from a blocked page, do 475 // MAIN_FRAME requests. Unblock requests only come from a blocked page, do
473 // not count as cross-site, otherwise it gets blocked indefinitely. 476 // not count as cross-site, otherwise it gets blocked indefinitely.
474 if (request_data.resource_type == ResourceType::MAIN_FRAME && 477 if (request_data.resource_type == ResourceType::MAIN_FRAME &&
475 process_type == ChildProcessInfo::RENDER_PROCESS && 478 process_type == ChildProcessInfo::RENDER_PROCESS &&
476 CrossSiteRequestManager::GetInstance()-> 479 CrossSiteRequestManager::GetInstance()->
(...skipping 1464 matching lines...) Expand 10 before | Expand all | Expand 10 after
1941 return is_prefetch_enabled_; 1944 return is_prefetch_enabled_;
1942 } 1945 }
1943 1946
1944 // static 1947 // static
1945 void ResourceDispatcherHost::set_is_prefetch_enabled(bool value) { 1948 void ResourceDispatcherHost::set_is_prefetch_enabled(bool value) {
1946 is_prefetch_enabled_ = value; 1949 is_prefetch_enabled_ = value;
1947 } 1950 }
1948 1951
1949 // static 1952 // static
1950 bool ResourceDispatcherHost::is_prefetch_enabled_ = false; 1953 bool ResourceDispatcherHost::is_prefetch_enabled_ = false;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698