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

Unified Diff: ios/crnet/crnet_environment.mm

Issue 1888963004: Add HttpProtocolHandler and convert everything to use it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-supports-scheme
Patch Set: rebase (needs fixing) Created 4 years, 2 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
« no previous file with comments | « ios/chrome/browser/ios_chrome_io_thread.mm ('k') | ios/web/shell/shell_url_request_context_getter.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/crnet/crnet_environment.mm
diff --git a/ios/crnet/crnet_environment.mm b/ios/crnet/crnet_environment.mm
index 4666593a8e96b9adc932c54538b1ff8a54b96a33..8e16b06bb32a7b695e0e2ed114cc61acdd5f7a6f 100644
--- a/ios/crnet/crnet_environment.mm
+++ b/ios/crnet/crnet_environment.mm
@@ -480,8 +480,9 @@ void CrNetEnvironment::InitializeOnNetworkThread() {
[NSHTTPCookieStorage sharedHTTPCookieStorage]);
main_context_->set_cookie_store(cookie_store_.get());
- net::URLRequestJobFactoryImpl* job_factory =
- new net::URLRequestJobFactoryImpl;
+ // TODO(mgersh): Fix this leak too. See https://crbug.com/523858
+ std::unique_ptr<net::URLRequestJobFactoryImpl> job_factory =
+ net::URLRequestJobFactoryImpl::CreateWithHttpProtocolHandlers();
job_factory->SetProtocolHandler(
"data", base::WrapUnique(new net::DataProtocolHandler));
#if !defined(DISABLE_FILE_SUPPORT)
@@ -489,8 +490,7 @@ void CrNetEnvironment::InitializeOnNetworkThread() {
"file",
base::MakeUnique<net::FileProtocolHandler>(file_thread_->task_runner()));
#endif // !defined(DISABLE_FILE_SUPPORT)
- main_context_->set_job_factory(job_factory);
-
+ main_context_->set_job_factory(job_factory.release());
main_context_->set_net_log(net_log_.get());
}
« no previous file with comments | « ios/chrome/browser/ios_chrome_io_thread.mm ('k') | ios/web/shell/shell_url_request_context_getter.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698