OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/url_request/url_request_context_builder.h" | 5 #include "net/url_request/url_request_context_builder.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 http_cache_backend = | 284 http_cache_backend = |
285 HttpCache::DefaultBackend::InMemory(http_cache_params_.max_size); | 285 HttpCache::DefaultBackend::InMemory(http_cache_params_.max_size); |
286 } | 286 } |
287 | 287 |
288 http_transaction_factory = new HttpCache( | 288 http_transaction_factory = new HttpCache( |
289 network_session_params, http_cache_backend); | 289 network_session_params, http_cache_backend); |
290 } else { | 290 } else { |
291 scoped_refptr<net::HttpNetworkSession> network_session( | 291 scoped_refptr<net::HttpNetworkSession> network_session( |
292 new net::HttpNetworkSession(network_session_params)); | 292 new net::HttpNetworkSession(network_session_params)); |
293 | 293 |
294 http_transaction_factory = new HttpNetworkLayer(network_session); | 294 http_transaction_factory = new HttpNetworkLayer(network_session.get()); |
295 } | 295 } |
296 storage->set_http_transaction_factory(http_transaction_factory); | 296 storage->set_http_transaction_factory(http_transaction_factory); |
297 | 297 |
298 URLRequestJobFactoryImpl* job_factory = new URLRequestJobFactoryImpl; | 298 URLRequestJobFactoryImpl* job_factory = new URLRequestJobFactoryImpl; |
299 if (data_enabled_) | 299 if (data_enabled_) |
300 job_factory->SetProtocolHandler("data", new DataProtocolHandler); | 300 job_factory->SetProtocolHandler("data", new DataProtocolHandler); |
301 if (file_enabled_) | 301 if (file_enabled_) |
302 job_factory->SetProtocolHandler("file", new FileProtocolHandler); | 302 job_factory->SetProtocolHandler("file", new FileProtocolHandler); |
303 #if !defined(DISABLE_FTP_SUPPORT) | 303 #if !defined(DISABLE_FTP_SUPPORT) |
304 if (ftp_enabled_) { | 304 if (ftp_enabled_) { |
305 ftp_transaction_factory_.reset( | 305 ftp_transaction_factory_.reset( |
306 new FtpNetworkLayer(context->host_resolver())); | 306 new FtpNetworkLayer(context->host_resolver())); |
307 job_factory->SetProtocolHandler("ftp", | 307 job_factory->SetProtocolHandler("ftp", |
308 new FtpProtocolHandler(ftp_transaction_factory_.get())); | 308 new FtpProtocolHandler(ftp_transaction_factory_.get())); |
309 } | 309 } |
310 #endif | 310 #endif |
311 storage->set_job_factory(job_factory); | 311 storage->set_job_factory(job_factory); |
312 | 312 |
313 // TODO(willchan): Support sdch. | 313 // TODO(willchan): Support sdch. |
314 | 314 |
315 return context; | 315 return context; |
316 } | 316 } |
317 | 317 |
318 } // namespace net | 318 } // namespace net |
OLD | NEW |