summaryrefslogtreecommitdiffstats
path: root/chrome/browser/io_thread.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/io_thread.cc')
-rw-r--r--chrome/browser/io_thread.cc33
1 files changed, 12 insertions, 21 deletions
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index 7839925..34c18ff 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -16,6 +16,8 @@
#include "base/string_util.h"
#include "base/threading/thread_restrictions.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/extensions/extension_event_router_forwarder.h"
+#include "chrome/browser/net/chrome_network_delegate.h"
#include "chrome/browser/net/chrome_net_log.h"
#include "chrome/browser/net/chrome_url_request_context.h"
#include "chrome/browser/net/connect_interceptor.h"
@@ -37,7 +39,6 @@
#include "net/base/host_resolver_impl.h"
#include "net/base/mapped_host_resolver.h"
#include "net/base/net_util.h"
-#include "net/base/network_delegate.h"
#include "net/http/http_auth_filter.h"
#include "net/http/http_auth_handler_factory.h"
#include "net/http/http_network_layer.h"
@@ -179,22 +180,6 @@ class LoggingNetworkChangeObserver
DISALLOW_COPY_AND_ASSIGN(LoggingNetworkChangeObserver);
};
-class SystemNetworkDelegate : public net::NetworkDelegate {
- public:
- SystemNetworkDelegate() {}
- ~SystemNetworkDelegate() {}
-
- // NetworkDelegate methods:
- // TODO(willchan): Implement these functions!
- virtual void OnBeforeURLRequest(net::URLRequest* request) {}
- virtual void OnSendHttpRequest(net::HttpRequestHeaders* headers) {}
- virtual void OnResponseStarted(net::URLRequest* request) {}
- virtual void OnReadCompleted(net::URLRequest* request, int bytes_read) {}
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SystemNetworkDelegate);
-};
-
scoped_refptr<net::URLRequestContext>
ConstructProxyScriptFetcherContext(IOThread::Globals* globals,
net::NetLog* net_log) {
@@ -210,7 +195,7 @@ ConstructProxyScriptFetcherContext(IOThread::Globals* globals,
globals->proxy_script_fetcher_http_transaction_factory.get());
// In-memory cookie store.
context->set_cookie_store(new net::CookieMonster(NULL, NULL));
- // TODO(mpcomplete): give it a SystemNetworkDelegate.
+ context->set_network_delegate(globals->system_network_delegate.get());
return context;
}
@@ -226,9 +211,13 @@ IOThread::Globals::~Globals() {}
// |local_state| is passed in explicitly in order to (1) reduce implicit
// dependencies and (2) make IOThread more flexible for testing.
-IOThread::IOThread(PrefService* local_state, ChromeNetLog* net_log)
+IOThread::IOThread(
+ PrefService* local_state,
+ ChromeNetLog* net_log,
+ ExtensionEventRouterForwarder* extension_event_router_forwarder)
: BrowserProcessSubThread(BrowserThread::IO),
net_log_(net_log),
+ extension_event_router_forwarder_(extension_event_router_forwarder),
globals_(NULL),
speculative_interceptor_(NULL),
predictor_(NULL) {
@@ -344,7 +333,10 @@ void IOThread::Init() {
network_change_observer_.reset(
new LoggingNetworkChangeObserver(net_log_));
- globals_->system_network_delegate.reset(new SystemNetworkDelegate);
+ globals_->extension_event_router_forwarder =
+ extension_event_router_forwarder_;
+ globals_->system_network_delegate.reset(new ChromeNetworkDelegate(
+ extension_event_router_forwarder_, Profile::kInvalidProfileId));
globals_->host_resolver.reset(
CreateGlobalHostResolver(net_log_));
globals_->cert_verifier.reset(new net::CertVerifier);
@@ -364,7 +356,6 @@ void IOThread::Init() {
globals_->proxy_script_fetcher_proxy_service.get();
session_params.http_auth_handler_factory =
globals_->http_auth_handler_factory.get();
- // TODO(willchan): Enable for proxy script fetcher context.
session_params.network_delegate = globals_->system_network_delegate.get();
session_params.net_log = net_log_;
session_params.ssl_config_service = globals_->ssl_config_service;