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

Side by Side Diff: chrome/browser/profiles/profile_impl_io_data.cc

Issue 686343002: Add MaybeInterceptRedirect/Response to URLRequestInterceptor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 "chrome/browser/profiles/profile_impl_io_data.h" 5 #include "chrome/browser/profiles/profile_impl_io_data.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 17 matching lines...) Expand all
28 #include "chrome/browser/net/predictor.h" 28 #include "chrome/browser/net/predictor.h"
29 #include "chrome/browser/net/quota_policy_channel_id_store.h" 29 #include "chrome/browser/net/quota_policy_channel_id_store.h"
30 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator. h" 30 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator. h"
31 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" 31 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h"
32 #include "chrome/browser/profiles/profile.h" 32 #include "chrome/browser/profiles/profile.h"
33 #include "chrome/common/chrome_constants.h" 33 #include "chrome/common/chrome_constants.h"
34 #include "chrome/common/chrome_switches.h" 34 #include "chrome/common/chrome_switches.h"
35 #include "chrome/common/pref_names.h" 35 #include "chrome/common/pref_names.h"
36 #include "chrome/common/url_constants.h" 36 #include "chrome/common/url_constants.h"
37 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_auth _request_handler.h" 37 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_auth _request_handler.h"
38 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_inte rceptor.h"
38 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_prot ocol.h" 39 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_prot ocol.h"
39 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_stat istics_prefs.h" 40 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_stat istics_prefs.h"
40 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_usag e_stats.h" 41 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_usag e_stats.h"
41 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_ names.h" 42 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_ names.h"
42 #include "components/domain_reliability/monitor.h" 43 #include "components/domain_reliability/monitor.h"
43 #include "content/public/browser/browser_thread.h" 44 #include "content/public/browser/browser_thread.h"
44 #include "content/public/browser/cookie_store_factory.h" 45 #include "content/public/browser/cookie_store_factory.h"
45 #include "content/public/browser/notification_service.h" 46 #include "content/public/browser/notification_service.h"
46 #include "content/public/browser/resource_context.h" 47 #include "content/public/browser/resource_context.h"
47 #include "content/public/browser/storage_partition.h" 48 #include "content/public/browser/storage_partition.h"
48 #include "extensions/browser/extension_protocols.h" 49 #include "extensions/browser/extension_protocols.h"
49 #include "extensions/common/constants.h" 50 #include "extensions/common/constants.h"
50 #include "net/base/cache_type.h" 51 #include "net/base/cache_type.h"
51 #include "net/base/sdch_dictionary_fetcher.h" 52 #include "net/base/sdch_dictionary_fetcher.h"
52 #include "net/base/sdch_manager.h" 53 #include "net/base/sdch_manager.h"
53 #include "net/ftp/ftp_network_layer.h" 54 #include "net/ftp/ftp_network_layer.h"
54 #include "net/http/http_cache.h" 55 #include "net/http/http_cache.h"
55 #include "net/http/http_server_properties_manager.h" 56 #include "net/http/http_server_properties_manager.h"
56 #include "net/ssl/channel_id_service.h" 57 #include "net/ssl/channel_id_service.h"
58 #include "net/url_request/url_request_intercepting_job_factory.h"
57 #include "net/url_request/url_request_job_factory_impl.h" 59 #include "net/url_request/url_request_job_factory_impl.h"
58 #include "storage/browser/quota/special_storage_policy.h" 60 #include "storage/browser/quota/special_storage_policy.h"
59 61
60 namespace { 62 namespace {
61 63
62 net::BackendType ChooseCacheBackendType() { 64 net::BackendType ChooseCacheBackendType() {
63 #if defined(OS_ANDROID) 65 #if defined(OS_ANDROID)
64 return net::CACHE_BACKEND_SIMPLE; 66 return net::CACHE_BACKEND_SIMPLE;
65 #else 67 #else
66 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 68 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 568
567 scoped_ptr<net::URLRequestJobFactoryImpl> main_job_factory( 569 scoped_ptr<net::URLRequestJobFactoryImpl> main_job_factory(
568 new net::URLRequestJobFactoryImpl()); 570 new net::URLRequestJobFactoryImpl());
569 InstallProtocolHandlers(main_job_factory.get(), protocol_handlers); 571 InstallProtocolHandlers(main_job_factory.get(), protocol_handlers);
570 main_job_factory_ = SetUpJobFactoryDefaults( 572 main_job_factory_ = SetUpJobFactoryDefaults(
571 main_job_factory.Pass(), 573 main_job_factory.Pass(),
572 request_interceptors.Pass(), 574 request_interceptors.Pass(),
573 profile_params->protocol_handler_interceptor.Pass(), 575 profile_params->protocol_handler_interceptor.Pass(),
574 network_delegate(), 576 network_delegate(),
575 ftp_factory_.get()); 577 ftp_factory_.get());
578
579 main_job_factory_.reset(new net::URLRequestInterceptingJobFactory(
580 main_job_factory_.Pass(), make_scoped_ptr(
581 new data_reduction_proxy::DataReductionProxyInterceptor(
582 data_reduction_proxy_params(),
583 data_reduction_proxy_usage_stats()))));
576 main_context->set_job_factory(main_job_factory_.get()); 584 main_context->set_job_factory(main_job_factory_.get());
577 585
578 #if defined(ENABLE_EXTENSIONS) 586 #if defined(ENABLE_EXTENSIONS)
579 InitializeExtensionsRequestContext(profile_params); 587 InitializeExtensionsRequestContext(profile_params);
580 #endif 588 #endif
581 589
582 // Setup the SDCHManager for this profile. 590 // Setup the SDCHManager for this profile.
583 sdch_manager_.reset(new net::SdchManager); 591 sdch_manager_.reset(new net::SdchManager);
584 sdch_manager_->set_sdch_fetcher(scoped_ptr<net::SdchFetcher>( 592 sdch_manager_->set_sdch_fetcher(scoped_ptr<net::SdchFetcher>(
585 new net::SdchDictionaryFetcher(sdch_manager_.get(), 593 new net::SdchDictionaryFetcher(sdch_manager_.get(),
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 transport_security_state()->DeleteAllDynamicDataSince(time); 838 transport_security_state()->DeleteAllDynamicDataSince(time);
831 DCHECK(http_server_properties_manager_); 839 DCHECK(http_server_properties_manager_);
832 http_server_properties_manager_->Clear(completion); 840 http_server_properties_manager_->Clear(completion);
833 } 841 }
834 842
835 bool ProfileImplIOData::IsDataReductionProxyEnabled() const { 843 bool ProfileImplIOData::IsDataReductionProxyEnabled() const {
836 return data_reduction_proxy_enabled_.GetValue() || 844 return data_reduction_proxy_enabled_.GetValue() ||
837 CommandLine::ForCurrentProcess()->HasSwitch( 845 CommandLine::ForCurrentProcess()->HasSwitch(
838 data_reduction_proxy::switches::kEnableDataReductionProxy); 846 data_reduction_proxy::switches::kEnableDataReductionProxy);
839 } 847 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698