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

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: Clang fixes 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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 uint64 upload_size = 0; 461 uint64 upload_size = 0;
462 if (request_data.upload_data) { 462 if (request_data.upload_data) {
463 request->set_upload(request_data.upload_data); 463 request->set_upload(request_data.upload_data);
464 upload_size = request_data.upload_data->GetContentLength(); 464 upload_size = request_data.upload_data->GetContentLength();
465 } 465 }
466 466
467 // Install a PrerenderResourceHandler if the requested URL could 467 // Install a PrerenderResourceHandler if the requested URL could
468 // be prerendered. This should be in front of the [a]syncResourceHandler, 468 // be prerendered. This should be in front of the [a]syncResourceHandler,
469 // but after the BufferedResourceHandler since it depends on the MIME 469 // but after the BufferedResourceHandler since it depends on the MIME
470 // sniffing capabilities in the BufferedResourceHandler. 470 // sniffing capabilities in the BufferedResourceHandler.
471 bool is_from_prerender = ((load_flags & net::LOAD_PRERENDER) != 0);
cbentzel 2011/03/14 14:05:55 It seems like this CL would be a lot simpler if yo
cbentzel 2011/03/14 14:32:26 Ah, I see you are caching the values in the Preren
dominich 2011/03/14 17:47:15 This happens when we have a prerender link to a pa
471 prerender::PrerenderResourceHandler* pre_handler = 472 prerender::PrerenderResourceHandler* pre_handler =
472 prerender::PrerenderResourceHandler::MaybeCreate(*request, 473 prerender::PrerenderResourceHandler::MaybeCreate(*request,
473 context, 474 context,
474 handler); 475 handler,
476 is_from_prerender,
477 route_id);
cbentzel 2011/03/14 14:32:26 You need both child_id and route_id here. Not a
dominich 2011/03/14 17:47:15 Done.
475 if (pre_handler) 478 if (pre_handler)
476 handler = pre_handler; 479 handler = pre_handler;
477 480
478 // Install a CrossSiteResourceHandler if this request is coming from a 481 // Install a CrossSiteResourceHandler if this request is coming from a
479 // RenderViewHost with a pending cross-site request. We only check this for 482 // RenderViewHost with a pending cross-site request. We only check this for
480 // MAIN_FRAME requests. Unblock requests only come from a blocked page, do 483 // MAIN_FRAME requests. Unblock requests only come from a blocked page, do
481 // not count as cross-site, otherwise it gets blocked indefinitely. 484 // not count as cross-site, otherwise it gets blocked indefinitely.
482 if (request_data.resource_type == ResourceType::MAIN_FRAME && 485 if (request_data.resource_type == ResourceType::MAIN_FRAME &&
483 process_type == ChildProcessInfo::RENDER_PROCESS && 486 process_type == ChildProcessInfo::RENDER_PROCESS &&
484 CrossSiteRequestManager::GetInstance()-> 487 CrossSiteRequestManager::GetInstance()->
(...skipping 1469 matching lines...) Expand 10 before | Expand all | Expand 10 after
1954 return is_prefetch_enabled_; 1957 return is_prefetch_enabled_;
1955 } 1958 }
1956 1959
1957 // static 1960 // static
1958 void ResourceDispatcherHost::set_is_prefetch_enabled(bool value) { 1961 void ResourceDispatcherHost::set_is_prefetch_enabled(bool value) {
1959 is_prefetch_enabled_ = value; 1962 is_prefetch_enabled_ = value;
1960 } 1963 }
1961 1964
1962 // static 1965 // static
1963 bool ResourceDispatcherHost::is_prefetch_enabled_ = false; 1966 bool ResourceDispatcherHost::is_prefetch_enabled_ = false;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698