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/file_util.h" | 5 #include "base/file_util.h" |
6 #include "base/metrics/field_trial.h" | 6 #include "base/metrics/field_trial.h" |
7 #include "base/stringprintf.h" | 7 #include "base/stringprintf.h" |
8 #include "net/base/net_errors.h" | 8 #include "net/base/net_errors.h" |
9 #include "net/disk_cache/backend_impl.h" | 9 #include "net/disk_cache/backend_impl.h" |
10 #include "net/disk_cache/cache_util.h" | 10 #include "net/disk_cache/cache_util.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 // Creates the backend. | 31 // Creates the backend. |
32 int Run(); | 32 int Run(); |
33 | 33 |
34 private: | 34 private: |
35 ~CacheCreator(); | 35 ~CacheCreator(); |
36 | 36 |
37 void DoCallback(int result); | 37 void DoCallback(int result); |
38 | 38 |
39 void OnIOComplete(int result); | 39 void OnIOComplete(int result); |
40 | 40 |
41 const base::FilePath& path_; | 41 const base::FilePath path_; |
42 bool force_; | 42 bool force_; |
43 bool retry_; | 43 bool retry_; |
44 int max_bytes_; | 44 int max_bytes_; |
45 net::CacheType type_; | 45 net::CacheType type_; |
46 uint32 flags_; | 46 uint32 flags_; |
47 scoped_refptr<base::MessageLoopProxy> thread_; | 47 scoped_refptr<base::MessageLoopProxy> thread_; |
48 disk_cache::Backend** backend_; | 48 disk_cache::Backend** backend_; |
49 net::CompletionCallback callback_; | 49 net::CompletionCallback callback_; |
50 disk_cache::Backend* created_cache_; | 50 disk_cache::Backend* created_cache_; |
51 net::NetLog* net_log_; | 51 net::NetLog* net_log_; |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 *backend = disk_cache::MemBackendImpl::CreateBackend(max_bytes, net_log); | 155 *backend = disk_cache::MemBackendImpl::CreateBackend(max_bytes, net_log); |
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, kNone, | 159 CacheCreator* creator = new CacheCreator(path, force, max_bytes, type, kNone, |
160 thread, net_log, backend, callback); | 160 thread, net_log, backend, callback); |
161 return creator->Run(); | 161 return creator->Run(); |
162 } | 162 } |
163 | 163 |
164 } // namespace disk_cache | 164 } // namespace disk_cache |
OLD | NEW |