| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 #include "net/http/http_server_properties_manager.h" | 66 #include "net/http/http_server_properties_manager.h" |
| 67 #include "net/sdch/sdch_owner.h" | 67 #include "net/sdch/sdch_owner.h" |
| 68 #include "net/ssl/channel_id_service.h" | 68 #include "net/ssl/channel_id_service.h" |
| 69 #include "net/url_request/url_request_intercepting_job_factory.h" | 69 #include "net/url_request/url_request_intercepting_job_factory.h" |
| 70 #include "net/url_request/url_request_job_factory_impl.h" | 70 #include "net/url_request/url_request_job_factory_impl.h" |
| 71 #include "storage/browser/quota/special_storage_policy.h" | 71 #include "storage/browser/quota/special_storage_policy.h" |
| 72 | 72 |
| 73 namespace { | 73 namespace { |
| 74 | 74 |
| 75 net::BackendType ChooseCacheBackendType() { | 75 net::BackendType ChooseCacheBackendType() { |
| 76 #if defined(OS_ANDROID) | 76 #if !defined(OS_ANDROID) |
| 77 return net::CACHE_BACKEND_SIMPLE; | |
| 78 #else | |
| 79 const base::CommandLine& command_line = | 77 const base::CommandLine& command_line = |
| 80 *base::CommandLine::ForCurrentProcess(); | 78 *base::CommandLine::ForCurrentProcess(); |
| 81 if (command_line.HasSwitch(switches::kUseSimpleCacheBackend)) { | 79 if (command_line.HasSwitch(switches::kUseSimpleCacheBackend)) { |
| 82 const std::string opt_value = | 80 const std::string opt_value = |
| 83 command_line.GetSwitchValueASCII(switches::kUseSimpleCacheBackend); | 81 command_line.GetSwitchValueASCII(switches::kUseSimpleCacheBackend); |
| 84 if (base::LowerCaseEqualsASCII(opt_value, "off")) | 82 if (base::LowerCaseEqualsASCII(opt_value, "off")) |
| 85 return net::CACHE_BACKEND_BLOCKFILE; | 83 return net::CACHE_BACKEND_BLOCKFILE; |
| 86 if (opt_value.empty() || base::LowerCaseEqualsASCII(opt_value, "on")) | 84 if (opt_value.empty() || base::LowerCaseEqualsASCII(opt_value, "on")) |
| 87 return net::CACHE_BACKEND_SIMPLE; | 85 return net::CACHE_BACKEND_SIMPLE; |
| 88 } | 86 } |
| 89 const std::string experiment_name = | 87 const std::string experiment_name = |
| 90 base::FieldTrialList::FindFullName("SimpleCacheTrial"); | 88 base::FieldTrialList::FindFullName("SimpleCacheTrial"); |
| 91 if (experiment_name == "ExperimentYes" || | 89 if (base::StartsWith(experiment_name, "Disable", |
| 92 experiment_name == "ExperimentYes2") { | 90 base::CompareCase::INSENSITIVE_ASCII)) { |
| 91 return net::CACHE_BACKEND_BLOCKFILE; |
| 92 } |
| 93 if (base::StartsWith(experiment_name, "ExperimentYes", |
| 94 base::CompareCase::INSENSITIVE_ASCII)) { |
| 93 return net::CACHE_BACKEND_SIMPLE; | 95 return net::CACHE_BACKEND_SIMPLE; |
| 94 } | 96 } |
| 97 #endif // #if !defined(OS_ANDROID) |
| 98 |
| 99 #if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) |
| 100 return net::CACHE_BACKEND_SIMPLE; |
| 101 #else |
| 95 return net::CACHE_BACKEND_BLOCKFILE; | 102 return net::CACHE_BACKEND_BLOCKFILE; |
| 96 #endif | 103 #endif |
| 97 } | 104 } |
| 98 | 105 |
| 99 } // namespace | 106 } // namespace |
| 100 | 107 |
| 101 using content::BrowserThread; | 108 using content::BrowserThread; |
| 102 | 109 |
| 103 ProfileImplIOData::Handle::Handle(Profile* profile) | 110 ProfileImplIOData::Handle::Handle(Profile* profile) |
| 104 : io_data_(new ProfileImplIOData), | 111 : io_data_(new ProfileImplIOData), |
| (...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 const base::Closure& completion) { | 789 const base::Closure& completion) { |
| 783 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 790 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 784 DCHECK(initialized()); | 791 DCHECK(initialized()); |
| 785 | 792 |
| 786 DCHECK(transport_security_state()); | 793 DCHECK(transport_security_state()); |
| 787 // Completes synchronously. | 794 // Completes synchronously. |
| 788 transport_security_state()->DeleteAllDynamicDataSince(time); | 795 transport_security_state()->DeleteAllDynamicDataSince(time); |
| 789 DCHECK(http_server_properties_manager_); | 796 DCHECK(http_server_properties_manager_); |
| 790 http_server_properties_manager_->Clear(completion); | 797 http_server_properties_manager_->Clear(completion); |
| 791 } | 798 } |
| OLD | NEW |