| 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 <memory> | 7 #include <memory> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 750 } else { | 750 } else { |
| 751 cache_path = partition_descriptor.path.Append(chrome::kMediaCacheDirname); | 751 cache_path = partition_descriptor.path.Append(chrome::kMediaCacheDirname); |
| 752 } | 752 } |
| 753 | 753 |
| 754 // Use a separate HTTP disk cache for isolated apps. | 754 // Use a separate HTTP disk cache for isolated apps. |
| 755 std::unique_ptr<net::HttpCache::BackendFactory> media_backend( | 755 std::unique_ptr<net::HttpCache::BackendFactory> media_backend( |
| 756 new net::HttpCache::DefaultBackend( | 756 new net::HttpCache::DefaultBackend( |
| 757 net::MEDIA_CACHE, ChooseCacheBackendType(), cache_path, | 757 net::MEDIA_CACHE, ChooseCacheBackendType(), cache_path, |
| 758 cache_max_size, | 758 cache_max_size, |
| 759 BrowserThread::GetTaskRunnerForThread(BrowserThread::CACHE))); | 759 BrowserThread::GetTaskRunnerForThread(BrowserThread::CACHE))); |
| 760 std::unique_ptr<net::HttpCache> media_http_cache = | 760 std::unique_ptr<net::HttpCache> media_http_cache = CreateHttpFactory( |
| 761 CreateHttpFactory(main_request_context_storage()->http_network_session(), | 761 main_request_context()->http_transaction_factory(), |
| 762 std::move(media_backend)); | 762 std::move(media_backend)); |
| 763 | 763 |
| 764 // Transfer ownership of the cache to MediaRequestContext. | 764 // Transfer ownership of the cache to MediaRequestContext. |
| 765 context->SetHttpTransactionFactory(std::move(media_http_cache)); | 765 context->SetHttpTransactionFactory(std::move(media_http_cache)); |
| 766 | 766 |
| 767 // Note that we do not create a new URLRequestJobFactory because | 767 // Note that we do not create a new URLRequestJobFactory because |
| 768 // the media context should behave exactly like its parent context | 768 // the media context should behave exactly like its parent context |
| 769 // in all respects except for cache behavior on media subresources. | 769 // in all respects except for cache behavior on media subresources. |
| 770 // The CopyFrom() step above means that our media context will use | 770 // The CopyFrom() step above means that our media context will use |
| 771 // the same URLRequestJobFactory instance that our parent context does. | 771 // the same URLRequestJobFactory instance that our parent context does. |
| 772 | 772 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 815 const base::Closure& completion) { | 815 const base::Closure& completion) { |
| 816 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 816 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 817 DCHECK(initialized()); | 817 DCHECK(initialized()); |
| 818 | 818 |
| 819 DCHECK(transport_security_state()); | 819 DCHECK(transport_security_state()); |
| 820 // Completes synchronously. | 820 // Completes synchronously. |
| 821 transport_security_state()->DeleteAllDynamicDataSince(time); | 821 transport_security_state()->DeleteAllDynamicDataSince(time); |
| 822 DCHECK(http_server_properties_manager_); | 822 DCHECK(http_server_properties_manager_); |
| 823 http_server_properties_manager_->Clear(completion); | 823 http_server_properties_manager_->Clear(completion); |
| 824 } | 824 } |
| OLD | NEW |