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

Unified Diff: chrome/browser/profiles/off_the_record_profile_io_data.cc

Issue 10702137: Replaced static URLRequestHTTPJob factory with non-static protocol handler for HTTP jobs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: changed the way protocol handlers are set in profile_impl Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/profiles/off_the_record_profile_io_data.cc
diff --git a/chrome/browser/profiles/off_the_record_profile_io_data.cc b/chrome/browser/profiles/off_the_record_profile_io_data.cc
index 830d6df17e42294fb8ae4fb32561180725cc1835..0e44180db5fba7dd0d9ca19805037d55f21e15fb 100644
--- a/chrome/browser/profiles/off_the_record_profile_io_data.cc
+++ b/chrome/browser/profiles/off_the_record_profile_io_data.cc
@@ -28,6 +28,7 @@
#include "net/http/http_cache.h"
#include "net/http/http_server_properties_impl.h"
#include "net/url_request/ftp_protocol_handler.h"
+#include "net/url_request/http_protocol_handler.h"
#include "net/url_request/url_request_job_factory.h"
#include "webkit/database/database_tracker.h"
@@ -255,13 +256,38 @@ void OffTheRecordProfileIOData::LazyInitializeInternal(
job_factories[0] = main_job_factory_.get();
job_factories[1] = extensions_job_factory_.get();
- net::FtpAuthCache* ftp_auth_caches[2];
- ftp_auth_caches[0] = main_context->ftp_auth_cache();
- ftp_auth_caches[1] = extensions_context->ftp_auth_cache();
+ bool set_protocol = main_job_factory_->SetProtocolHandler(
+ chrome::kHttpScheme,
+ new net::HttpProtocolHandler(cache,
+ network_delegate(),
+ io_thread_globals->throttler_manager.get(),
+ main_context->accept_language(),
+ main_context->accept_charset(),
+ main_context->cookie_store(),
+ fraudulent_certificate_reporter(),
+ main_context->ssl_config_service(),
+ transport_security_state()));
+ DCHECK(set_protocol);
+ set_protocol = extensions_job_factory_->SetProtocolHandler(
+ chrome::kHttpScheme,
+ new net::HttpProtocolHandler(NULL,
+ NULL,
+ io_thread_globals->throttler_manager.get(),
+ main_context->accept_language(),
+ main_context->accept_charset(),
+ extensions_cookie_store,
+ NULL,
+ main_context->ssl_config_service(),
+ transport_security_state()));
+ DCHECK(set_protocol);
+
+ CreateFtpProtocolHandler(
+ job_factories[0], main_context->ftp_auth_cache(), network_delegate());
+ CreateFtpProtocolHandler(
+ job_factories[1], extensions_context->ftp_auth_cache(), NULL);
for (int i = 0; i < 2; i++) {
SetUpJobFactoryDefaults(job_factories[i]);
- CreateFtpProtocolHandler(job_factories[i], ftp_auth_caches[i]);
}
main_context->set_job_factory(main_job_factory_.get());
@@ -313,10 +339,11 @@ OffTheRecordProfileIOData::AcquireIsolatedAppRequestContext(
void OffTheRecordProfileIOData::CreateFtpProtocolHandler(
net::URLRequestJobFactory* job_factory,
- net::FtpAuthCache* ftp_auth_cache) const {
- job_factory->SetProtocolHandler(
+ net::FtpAuthCache* ftp_auth_cache,
+ net::NetworkDelegate* network_delegate) const {
+ bool set_protocol = job_factory->SetProtocolHandler(
chrome::kFtpScheme,
new net::FtpProtocolHandler(
- network_delegate(), ftp_factory_.get(), ftp_auth_cache));
+ network_delegate, ftp_factory_.get(), ftp_auth_cache));
+ DCHECK(set_protocol);
}
-

Powered by Google App Engine
This is Rietveld 408576698