| 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 "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 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 710 cookie_path, | 710 cookie_path, |
| 711 content::CookieStoreConfig::EPHEMERAL_SESSION_COOKIES, | 711 content::CookieStoreConfig::EPHEMERAL_SESSION_COOKIES, |
| 712 NULL, NULL); | 712 NULL, NULL); |
| 713 cookie_config.crypto_delegate = | 713 cookie_config.crypto_delegate = |
| 714 chrome_browser_net::GetCookieCryptoDelegate(); | 714 chrome_browser_net::GetCookieCryptoDelegate(); |
| 715 cookie_store = content::CreateCookieStore(cookie_config); | 715 cookie_store = content::CreateCookieStore(cookie_config); |
| 716 } | 716 } |
| 717 | 717 |
| 718 // Transfer ownership of the cookies and cache to AppRequestContext. | 718 // Transfer ownership of the cookies and cache to AppRequestContext. |
| 719 context->SetCookieStore(cookie_store.get()); | 719 context->SetCookieStore(cookie_store.get()); |
| 720 context->SetHttpTransactionFactory( | 720 context->SetHttpTransactionFactory(app_http_cache.Pass()); |
| 721 scoped_ptr<net::HttpTransactionFactory>( | |
| 722 app_http_cache.PassAs<net::HttpTransactionFactory>())); | |
| 723 | 721 |
| 724 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( | 722 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( |
| 725 new net::URLRequestJobFactoryImpl()); | 723 new net::URLRequestJobFactoryImpl()); |
| 726 InstallProtocolHandlers(job_factory.get(), protocol_handlers); | 724 InstallProtocolHandlers(job_factory.get(), protocol_handlers); |
| 727 scoped_ptr<net::URLRequestJobFactory> top_job_factory( | 725 scoped_ptr<net::URLRequestJobFactory> top_job_factory( |
| 728 SetUpJobFactoryDefaults(job_factory.Pass(), | 726 SetUpJobFactoryDefaults(job_factory.Pass(), |
| 729 request_interceptors.Pass(), | 727 request_interceptors.Pass(), |
| 730 protocol_handler_interceptor.Pass(), | 728 protocol_handler_interceptor.Pass(), |
| 731 network_delegate(), | 729 network_delegate(), |
| 732 ftp_factory_.get())); | 730 ftp_factory_.get())); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 768 ChooseCacheBackendType(), | 766 ChooseCacheBackendType(), |
| 769 cache_path, | 767 cache_path, |
| 770 cache_max_size, | 768 cache_max_size, |
| 771 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)); | 769 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)); |
| 772 net::HttpNetworkSession* main_network_session = | 770 net::HttpNetworkSession* main_network_session = |
| 773 main_http_factory_->GetSession(); | 771 main_http_factory_->GetSession(); |
| 774 scoped_ptr<net::HttpCache> media_http_cache = | 772 scoped_ptr<net::HttpCache> media_http_cache = |
| 775 CreateHttpFactory(main_network_session, media_backend); | 773 CreateHttpFactory(main_network_session, media_backend); |
| 776 | 774 |
| 777 // Transfer ownership of the cache to MediaRequestContext. | 775 // Transfer ownership of the cache to MediaRequestContext. |
| 778 context->SetHttpTransactionFactory( | 776 context->SetHttpTransactionFactory(media_http_cache.Pass()); |
| 779 media_http_cache.PassAs<net::HttpTransactionFactory>()); | |
| 780 | 777 |
| 781 // Note that we do not create a new URLRequestJobFactory because | 778 // Note that we do not create a new URLRequestJobFactory because |
| 782 // the media context should behave exactly like its parent context | 779 // the media context should behave exactly like its parent context |
| 783 // in all respects except for cache behavior on media subresources. | 780 // in all respects except for cache behavior on media subresources. |
| 784 // The CopyFrom() step above means that our media context will use | 781 // The CopyFrom() step above means that our media context will use |
| 785 // the same URLRequestJobFactory instance that our parent context does. | 782 // the same URLRequestJobFactory instance that our parent context does. |
| 786 | 783 |
| 787 return context; | 784 return context; |
| 788 } | 785 } |
| 789 | 786 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 833 transport_security_state()->DeleteAllDynamicDataSince(time); | 830 transport_security_state()->DeleteAllDynamicDataSince(time); |
| 834 DCHECK(http_server_properties_manager_); | 831 DCHECK(http_server_properties_manager_); |
| 835 http_server_properties_manager_->Clear(completion); | 832 http_server_properties_manager_->Clear(completion); |
| 836 } | 833 } |
| 837 | 834 |
| 838 bool ProfileImplIOData::IsDataReductionProxyEnabled() const { | 835 bool ProfileImplIOData::IsDataReductionProxyEnabled() const { |
| 839 return data_reduction_proxy_enabled_.GetValue() || | 836 return data_reduction_proxy_enabled_.GetValue() || |
| 840 CommandLine::ForCurrentProcess()->HasSwitch( | 837 CommandLine::ForCurrentProcess()->HasSwitch( |
| 841 data_reduction_proxy::switches::kEnableDataReductionProxy); | 838 data_reduction_proxy::switches::kEnableDataReductionProxy); |
| 842 } | 839 } |
| OLD | NEW |