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

Side by Side Diff: net/url_request/url_request_context_builder.cc

Issue 937513003: Add Data Saver support to Cronet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 unified diff | Download patch
OLDNEW
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 15 matching lines...) Expand all
26 #include "net/http/http_server_properties_impl.h" 26 #include "net/http/http_server_properties_impl.h"
27 #include "net/http/transport_security_persister.h" 27 #include "net/http/transport_security_persister.h"
28 #include "net/http/transport_security_state.h" 28 #include "net/http/transport_security_state.h"
29 #include "net/ssl/channel_id_service.h" 29 #include "net/ssl/channel_id_service.h"
30 #include "net/ssl/default_channel_id_store.h" 30 #include "net/ssl/default_channel_id_store.h"
31 #include "net/ssl/ssl_config_service_defaults.h" 31 #include "net/ssl/ssl_config_service_defaults.h"
32 #include "net/url_request/data_protocol_handler.h" 32 #include "net/url_request/data_protocol_handler.h"
33 #include "net/url_request/static_http_user_agent_settings.h" 33 #include "net/url_request/static_http_user_agent_settings.h"
34 #include "net/url_request/url_request_context.h" 34 #include "net/url_request/url_request_context.h"
35 #include "net/url_request/url_request_context_storage.h" 35 #include "net/url_request/url_request_context_storage.h"
36 #include "net/url_request/url_request_intercepting_job_factory.h"
36 #include "net/url_request/url_request_job_factory_impl.h" 37 #include "net/url_request/url_request_job_factory_impl.h"
37 #include "net/url_request/url_request_throttler_manager.h" 38 #include "net/url_request/url_request_throttler_manager.h"
38 39
39 #if !defined(DISABLE_FILE_SUPPORT) 40 #if !defined(DISABLE_FILE_SUPPORT)
40 #include "net/url_request/file_protocol_handler.h" 41 #include "net/url_request/file_protocol_handler.h"
41 #endif 42 #endif
42 43
43 #if !defined(DISABLE_FTP_SUPPORT) 44 #if !defined(DISABLE_FTP_SUPPORT)
44 #include "net/url_request/ftp_protocol_handler.h" 45 #include "net/url_request/ftp_protocol_handler.h"
45 #endif 46 #endif
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 403
403 #if !defined(DISABLE_FTP_SUPPORT) 404 #if !defined(DISABLE_FTP_SUPPORT)
404 if (ftp_enabled_) { 405 if (ftp_enabled_) {
405 ftp_transaction_factory_.reset( 406 ftp_transaction_factory_.reset(
406 new FtpNetworkLayer(context->host_resolver())); 407 new FtpNetworkLayer(context->host_resolver()));
407 job_factory->SetProtocolHandler("ftp", 408 job_factory->SetProtocolHandler("ftp",
408 new FtpProtocolHandler(ftp_transaction_factory_.get())); 409 new FtpProtocolHandler(ftp_transaction_factory_.get()));
409 } 410 }
410 #endif // !defined(DISABLE_FTP_SUPPORT) 411 #endif // !defined(DISABLE_FTP_SUPPORT)
411 412
412 storage->set_job_factory(job_factory); 413 if (url_request_interceptor_) {
413 414 storage->set_job_factory(new net::URLRequestInterceptingJobFactory(
415 make_scoped_ptr(job_factory).Pass(), url_request_interceptor_.Pass()));
mmenke 2015/03/10 15:26:55 I don't think Pass() isn't needed with make_scoped
bengr 2015/03/10 23:43:31 Done.
416 } else {
417 storage->set_job_factory(job_factory);
418 }
414 // TODO(willchan): Support sdch. 419 // TODO(willchan): Support sdch.
415 420
416 return context; 421 return context;
417 } 422 }
418 423
419 } // namespace net 424 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698