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 "base/files/file_path.h" | 5 #include "base/files/file_path.h" |
6 #include "base/metrics/field_trial.h" | 6 #include "base/metrics/field_trial.h" |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "net/base/cache_type.h" | 8 #include "net/base/cache_type.h" |
9 #include "net/base/net_errors.h" | 9 #include "net/base/net_errors.h" |
10 #include "net/disk_cache/backend_impl.h" | 10 #include "net/disk_cache/blockfile/backend_impl.h" |
11 #include "net/disk_cache/cache_util.h" | 11 #include "net/disk_cache/cache_util.h" |
12 #include "net/disk_cache/disk_cache.h" | 12 #include "net/disk_cache/disk_cache.h" |
13 #include "net/disk_cache/mem_backend_impl.h" | 13 #include "net/disk_cache/memory/mem_backend_impl.h" |
14 #include "net/disk_cache/simple/simple_backend_impl.h" | 14 #include "net/disk_cache/simple/simple_backend_impl.h" |
15 | 15 |
16 #ifdef USE_TRACING_CACHE_BACKEND | 16 #ifdef USE_TRACING_CACHE_BACKEND |
17 #include "net/disk_cache/tracing_cache_backend.h" | 17 #include "net/disk_cache/tracing_cache_backend.h" |
18 #endif | 18 #endif |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 // Builds an instance of the backend depending on platform, type, experiments | 22 // Builds an instance of the backend depending on platform, type, experiments |
23 // etc. Takes care of the retry state. This object will self-destroy when | 23 // etc. Takes care of the retry state. This object will self-destroy when |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 return *backend ? net::OK : net::ERR_FAILED; | 156 return *backend ? net::OK : net::ERR_FAILED; |
157 } | 157 } |
158 DCHECK(thread); | 158 DCHECK(thread); |
159 CacheCreator* creator = new CacheCreator(path, force, max_bytes, type, | 159 CacheCreator* creator = new CacheCreator(path, force, max_bytes, type, |
160 backend_type, kNone, | 160 backend_type, kNone, |
161 thread, net_log, backend, callback); | 161 thread, net_log, backend, callback); |
162 return creator->Run(); | 162 return creator->Run(); |
163 } | 163 } |
164 | 164 |
165 } // namespace disk_cache | 165 } // namespace disk_cache |
OLD | NEW |