summaryrefslogtreecommitdiffstats
path: root/chrome/browser/io_thread.cc
diff options
context:
space:
mode:
authorgavinp@chromium.org <gavinp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-19 19:07:40 +0000
committergavinp@chromium.org <gavinp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-19 19:07:40 +0000
commit1d14ba55e2472ad65b41423a6b8ed13b32dc206d (patch)
treefcc237d57d7b8ee927afc5d60925911949b05c29 /chrome/browser/io_thread.cc
parentfc52c42d72d42558e508f6439e8dfbb9b4ea15d9 (diff)
downloadchromium_src-1d14ba55e2472ad65b41423a6b8ed13b32dc206d.zip
chromium_src-1d14ba55e2472ad65b41423a6b8ed13b32dc206d.tar.gz
chromium_src-1d14ba55e2472ad65b41423a6b8ed13b32dc206d.tar.bz2
Implement a dispatcher for prerender requests
This CL provides a dispatcher that can feed the prerender system with HTML type requests that were prefetched. One thing is missing though: this sends all requests in, and doesn't tag the origin request. Unfortunately referer information is often tossed out in resource_dispatcher_host... Is there a private place it's sent along to for this type of use? I left that undone right now but I'm open to suggestions about a good way to do it. BUG=none TEST=none Review URL: http://codereview.chromium.org/4655004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66790 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/io_thread.cc')
-rw-r--r--chrome/browser/io_thread.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index 65be41e..788c339 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -23,6 +23,7 @@
#include "chrome/browser/net/connect_interceptor.h"
#include "chrome/browser/net/passive_log_collector.h"
#include "chrome/browser/net/predictor_api.h"
+#include "chrome/browser/net/prerender_interceptor.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/net/raw_host_resolver_proc.h"
@@ -332,6 +333,12 @@ void IOThread::Init() {
globals_->dnsrr_resolver.reset(new net::DnsRRResolver);
globals_->http_auth_handler_factory.reset(CreateDefaultAuthHandlerFactory(
globals_->host_resolver.get()));
+
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnablePagePrerender)) {
+ prerender_interceptor_.reset(
+ new chrome_browser_net::PrerenderInterceptor());
+ }
}
void IOThread::CleanUp() {
@@ -386,6 +393,8 @@ void IOThread::CleanUp() {
delete speculative_interceptor_;
speculative_interceptor_ = NULL;
+ prerender_interceptor_.reset();
+
// TODO(eroman): hack for http://crbug.com/15513
if (globals_->host_resolver->GetAsHostResolverImpl()) {
globals_->host_resolver.get()->GetAsHostResolverImpl()->Shutdown();