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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 namespace { | 53 namespace { |
54 | 54 |
55 net::BackendType ChooseCacheBackendType() { | 55 net::BackendType ChooseCacheBackendType() { |
56 #if defined(OS_ANDROID) | 56 #if defined(OS_ANDROID) |
57 return net::CACHE_BACKEND_SIMPLE; | 57 return net::CACHE_BACKEND_SIMPLE; |
58 #else | 58 #else |
59 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 59 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
60 if (command_line.HasSwitch(switches::kUseSimpleCacheBackend)) { | 60 if (command_line.HasSwitch(switches::kUseSimpleCacheBackend)) { |
61 const std::string opt_value = | 61 const std::string opt_value = |
62 command_line.GetSwitchValueASCII(switches::kUseSimpleCacheBackend); | 62 command_line.GetSwitchValueASCII(switches::kUseSimpleCacheBackend); |
63 if (LowerCaseEqualsASCII(opt_value, "off")) | 63 if (base::LowerCaseEqualsASCII(opt_value, "off")) |
64 return net::CACHE_BACKEND_BLOCKFILE; | 64 return net::CACHE_BACKEND_BLOCKFILE; |
65 if (opt_value == "" || LowerCaseEqualsASCII(opt_value, "on")) | 65 if (opt_value == "" || base::LowerCaseEqualsASCII(opt_value, "on")) |
66 return net::CACHE_BACKEND_SIMPLE; | 66 return net::CACHE_BACKEND_SIMPLE; |
67 } | 67 } |
68 const std::string experiment_name = | 68 const std::string experiment_name = |
69 base::FieldTrialList::FindFullName("SimpleCacheTrial"); | 69 base::FieldTrialList::FindFullName("SimpleCacheTrial"); |
70 if (experiment_name == "ExperimentYes" || | 70 if (experiment_name == "ExperimentYes" || |
71 experiment_name == "ExperimentYes2") { | 71 experiment_name == "ExperimentYes2") { |
72 return net::CACHE_BACKEND_SIMPLE; | 72 return net::CACHE_BACKEND_SIMPLE; |
73 } | 73 } |
74 return net::CACHE_BACKEND_BLOCKFILE; | 74 return net::CACHE_BACKEND_BLOCKFILE; |
75 #endif | 75 #endif |
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
771 const base::Closure& completion) { | 771 const base::Closure& completion) { |
772 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 772 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
773 DCHECK(initialized()); | 773 DCHECK(initialized()); |
774 | 774 |
775 DCHECK(transport_security_state()); | 775 DCHECK(transport_security_state()); |
776 // Completes synchronously. | 776 // Completes synchronously. |
777 transport_security_state()->DeleteAllDynamicDataSince(time); | 777 transport_security_state()->DeleteAllDynamicDataSince(time); |
778 DCHECK(http_server_properties_manager_); | 778 DCHECK(http_server_properties_manager_); |
779 http_server_properties_manager_->Clear(completion); | 779 http_server_properties_manager_->Clear(completion); |
780 } | 780 } |
OLD | NEW |