| 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/single_thread_task_runner.h" | 7 #include "base/single_thread_task_runner.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "net/base/cache_type.h" | 9 #include "net/base/cache_type.h" |
| 10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
| 11 #include "net/disk_cache/blockfile/backend_impl.h" | 11 #include "net/disk_cache/blockfile/backend_impl.h" |
| 12 #include "net/disk_cache/cache_util.h" | 12 #include "net/disk_cache/cache_util.h" |
| 13 #include "net/disk_cache/disk_cache.h" | 13 #include "net/disk_cache/disk_cache.h" |
| 14 #include "net/disk_cache/memory/mem_backend_impl.h" | 14 #include "net/disk_cache/memory/mem_backend_impl.h" |
| 15 #include "net/disk_cache/simple/simple_backend_impl.h" | 15 #include "net/disk_cache/simple/simple_backend_impl.h" |
| 16 | 16 |
| 17 #ifdef USE_TRACING_CACHE_BACKEND | |
| 18 #include "net/disk_cache/tracing_cache_backend.h" | |
| 19 #endif | |
| 20 | |
| 21 namespace { | 17 namespace { |
| 22 | 18 |
| 23 // Builds an instance of the backend depending on platform, type, experiments | 19 // Builds an instance of the backend depending on platform, type, experiments |
| 24 // etc. Takes care of the retry state. This object will self-destroy when | 20 // etc. Takes care of the retry state. This object will self-destroy when |
| 25 // finished. | 21 // finished. |
| 26 class CacheCreator { | 22 class CacheCreator { |
| 27 public: | 23 public: |
| 28 CacheCreator(const base::FilePath& path, | 24 CacheCreator(const base::FilePath& path, |
| 29 bool force, | 25 bool force, |
| 30 int max_bytes, | 26 int max_bytes, |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 backend_type, | 182 backend_type, |
| 187 kNone, | 183 kNone, |
| 188 thread, | 184 thread, |
| 189 net_log, | 185 net_log, |
| 190 backend, | 186 backend, |
| 191 callback); | 187 callback); |
| 192 return creator->Run(); | 188 return creator->Run(); |
| 193 } | 189 } |
| 194 | 190 |
| 195 } // namespace disk_cache | 191 } // namespace disk_cache |
| OLD | NEW |