Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(369)

Side by Side Diff: net/disk_cache/simple/simple_backend_impl.h

Issue 12794003: Initialize the simple cache backend at runtime. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebased to latest, auto-merged net.gyp Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/disk_cache/entry_unittest.cc ('k') | net/disk_cache/simple/simple_backend_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef NET_DISK_CACHE_SIMPLE_SIMPLE_BACKEND_IMPL_H_ 5 #ifndef NET_DISK_CACHE_SIMPLE_SIMPLE_BACKEND_IMPL_H_
6 #define NET_DISK_CACHE_SIMPLE_SIMPLE_BACKEND_IMPL_H_ 6 #define NET_DISK_CACHE_SIMPLE_SIMPLE_BACKEND_IMPL_H_
7 7
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/files/file_path.h" 13 #include "base/files/file_path.h"
14 #include "base/task_runner.h" 14 #include "base/task_runner.h"
15 #include "net/base/cache_type.h" 15 #include "net/base/cache_type.h"
16 #include "net/disk_cache/disk_cache.h" 16 #include "net/disk_cache/disk_cache.h"
17 17
18 namespace disk_cache { 18 namespace disk_cache {
19 19
20 // SimpleBackendImpl is a new cache backend that stores entries in individual 20 // SimpleBackendImpl is a new cache backend that stores entries in individual
21 // files. 21 // files.
22 22
23 // It is currently a work in progress, missing many features of a real cache, 23 // It is currently a work in progress, missing many features of a real cache,
24 // such as eviction. 24 // such as eviction.
25 25
26 // See http://www.chromium.org/developers/design-documents/network-stack/disk-ca che/very-simple-backend 26 // See http://www.chromium.org/developers/design-documents/network-stack/disk-ca che/very-simple-backend
27 27
28 class SimpleIndex; 28 class SimpleIndex;
29 29
30 class SimpleBackendImpl : public Backend { 30 class NET_EXPORT_PRIVATE SimpleBackendImpl : public Backend {
31 public: 31 public:
32 virtual ~SimpleBackendImpl(); 32 virtual ~SimpleBackendImpl();
33 33
34 static int CreateBackend(const base::FilePath& full_path, 34 static int CreateBackend(const base::FilePath& full_path,
35 bool force,
36 int max_bytes, 35 int max_bytes,
37 net::CacheType type, 36 net::CacheType type,
38 uint32 flags, 37 uint32 flags,
39 scoped_refptr<base::TaskRunner> cache_thread, 38 scoped_refptr<base::TaskRunner> cache_thread,
40 net::NetLog* net_log, 39 net::NetLog* net_log,
41 Backend** backend, 40 Backend** backend,
42 const CompletionCallback& callback); 41 const CompletionCallback& callback);
43 42
44 // From Backend: 43 // From Backend:
45 virtual net::CacheType GetCacheType() const OVERRIDE; 44 virtual net::CacheType GetCacheType() const OVERRIDE;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 void Initialize(); 80 void Initialize();
82 81
83 const base::FilePath path_; 82 const base::FilePath path_;
84 83
85 scoped_ptr<SimpleIndex> index_; 84 scoped_ptr<SimpleIndex> index_;
86 }; 85 };
87 86
88 } // namespace disk_cache 87 } // namespace disk_cache
89 88
90 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_BACKEND_IMPL_H_ 89 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_BACKEND_IMPL_H_
OLDNEW
« no previous file with comments | « net/disk_cache/entry_unittest.cc ('k') | net/disk_cache/simple/simple_backend_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698