| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "net/disk_cache/simple/simple_backend_impl.h" | 5 #include "net/disk_cache/simple/simple_backend_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 const char* kSimpleBackendSubdirectory = "Simple"; | 25 const char* kSimpleBackendSubdirectory = "Simple"; |
| 26 | 26 |
| 27 } // namespace | 27 } // namespace |
| 28 | 28 |
| 29 namespace disk_cache { | 29 namespace disk_cache { |
| 30 | 30 |
| 31 // static | 31 // static |
| 32 int SimpleBackendImpl::CreateBackend( | 32 int SimpleBackendImpl::CreateBackend( |
| 33 const FilePath& full_path, | 33 const FilePath& full_path, |
| 34 bool force, | |
| 35 int max_bytes, | 34 int max_bytes, |
| 36 net::CacheType type, | 35 net::CacheType type, |
| 37 uint32 flags, | 36 uint32 flags, |
| 38 scoped_refptr<base::TaskRunner> task_runner, | 37 scoped_refptr<base::TaskRunner> task_runner, |
| 39 net::NetLog* net_log, | 38 net::NetLog* net_log, |
| 40 Backend** backend, | 39 Backend** backend, |
| 41 const CompletionCallback& callback) { | 40 const CompletionCallback& callback) { |
| 42 // TODO(gavinp): Use the |net_log|. | 41 // TODO(gavinp): Use the |net_log|. |
| 43 DCHECK_EQ(net::DISK_CACHE, type); | 42 DCHECK_EQ(net::DISK_CACHE, type); |
| 44 FilePath simple_cache_path = | 43 FilePath simple_cache_path = |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 const CompletionCallback& callback, | 144 const CompletionCallback& callback, |
| 146 Backend** backend) { | 145 Backend** backend) { |
| 147 if (result == net::OK) | 146 if (result == net::OK) |
| 148 *backend = new SimpleBackendImpl(path); | 147 *backend = new SimpleBackendImpl(path); |
| 149 else | 148 else |
| 150 *backend = NULL; | 149 *backend = NULL; |
| 151 callback.Run(result); | 150 callback.Run(result); |
| 152 } | 151 } |
| 153 | 152 |
| 154 } // namespace disk_cache | 153 } // namespace disk_cache |
| OLD | NEW |