diff options
author | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-12 13:12:21 +0000 |
---|---|---|
committer | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-12 13:12:21 +0000 |
commit | 0e25b15e6bf51ced4c0cc3d2c14122b38debc815 (patch) | |
tree | d64bde3c0e1043135dd872c936f137581f6fd3b7 /chrome/browser/net/chrome_url_request_context.cc | |
parent | 702f9978ada5dcf21c2720219c7de067b81950a6 (diff) | |
download | chromium_src-0e25b15e6bf51ced4c0cc3d2c14122b38debc815.zip chromium_src-0e25b15e6bf51ced4c0cc3d2c14122b38debc815.tar.gz chromium_src-0e25b15e6bf51ced4c0cc3d2c14122b38debc815.tar.bz2 |
Add PrerenderResourceHandler and hook it into the ResourceDispatcherHost.
The PrerenderResourceHandler will initiate prerendering of a web page under the following conditions:
- The initial request is a GET for a ResourceType::PREFETCH resource.
- The mime-type (sniffed or explicitly specified) of the resource is text/html.
- The response status code is a 200.
- The top-level page will not need to be revalidated until after it's guaranteed to be removed from potential use.
The handler passes along all data to the backing resource handler.
BUG=61745
TEST=unit_tests --gtest_filter="PrerenderResourceHandlerTest*"
Manual Test: Start Chrome with --enable-page-prerender. Go to a page with a <link rel=prefetch> element. Navigate to that element, and make sure that it uses the prerendered view.
Review URL: http://codereview.chromium.org/5912001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71162 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net/chrome_url_request_context.cc')
-rw-r--r-- | chrome/browser/net/chrome_url_request_context.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/chrome/browser/net/chrome_url_request_context.cc b/chrome/browser/net/chrome_url_request_context.cc index d06d806..c5c7edb 100644 --- a/chrome/browser/net/chrome_url_request_context.cc +++ b/chrome/browser/net/chrome_url_request_context.cc @@ -885,6 +885,7 @@ ChromeURLRequestContextFactory::ChromeURLRequestContextFactory(Profile* profile) blob_storage_context_ = profile->GetBlobStorageContext(); file_system_context_ = profile->GetFileSystemContext(); extension_info_map_ = profile->GetExtensionInfoMap(); + prerender_manager_ = profile->GetPrerenderManager(); } ChromeURLRequestContextFactory::~ChromeURLRequestContextFactory() { @@ -911,4 +912,5 @@ void ChromeURLRequestContextFactory::ApplyProfileParametersToContext( context->set_blob_storage_context(blob_storage_context_); context->set_file_system_context(file_system_context_); context->set_extension_info_map(extension_info_map_); + context->set_prerender_manager(prerender_manager_); } |