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

Side by Side Diff: content/browser/appcache/appcache_disk_cache.h

Issue 1142193002: Revert of ServiceWorker: Use SimpleCache for the script cache (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | « no previous file | content/browser/appcache/appcache_disk_cache.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) 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 #ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_DISK_CACHE_H_ 5 #ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_DISK_CACHE_H_
6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_DISK_CACHE_H_ 6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_DISK_CACHE_H_
7 7
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 bool is_disabled() const { return is_disabled_; } 45 bool is_disabled() const { return is_disabled_; }
46 46
47 int CreateEntry(int64 key, 47 int CreateEntry(int64 key,
48 Entry** entry, 48 Entry** entry,
49 const net::CompletionCallback& callback) override; 49 const net::CompletionCallback& callback) override;
50 int OpenEntry(int64 key, 50 int OpenEntry(int64 key,
51 Entry** entry, 51 Entry** entry,
52 const net::CompletionCallback& callback) override; 52 const net::CompletionCallback& callback) override;
53 int DoomEntry(int64 key, const net::CompletionCallback& callback) override; 53 int DoomEntry(int64 key, const net::CompletionCallback& callback) override;
54 54
55 protected:
56 explicit AppCacheDiskCache(bool use_simple_cache);
57
58 private: 55 private:
59 class CreateBackendCallbackShim; 56 class CreateBackendCallbackShim;
60 class EntryImpl; 57 class EntryImpl;
61 58
62 // PendingCalls allow CreateEntry, OpenEntry, and DoomEntry to be called 59 // PendingCalls allow CreateEntry, OpenEntry, and DoomEntry to be called
63 // immediately after construction, without waiting for the 60 // immediately after construction, without waiting for the
64 // underlying disk_cache::Backend to be fully constructed. Early 61 // underlying disk_cache::Backend to be fully constructed. Early
65 // calls are queued up and serviced once the disk_cache::Backend is 62 // calls are queued up and serviced once the disk_cache::Backend is
66 // really ready to go. 63 // really ready to go.
67 enum PendingCallType { 64 enum PendingCallType {
(...skipping 27 matching lines...) Expand all
95 int Init(net::CacheType cache_type, 92 int Init(net::CacheType cache_type,
96 const base::FilePath& directory, 93 const base::FilePath& directory,
97 int cache_size, 94 int cache_size,
98 bool force, 95 bool force,
99 const scoped_refptr<base::SingleThreadTaskRunner>& cache_thread, 96 const scoped_refptr<base::SingleThreadTaskRunner>& cache_thread,
100 const net::CompletionCallback& callback); 97 const net::CompletionCallback& callback);
101 void OnCreateBackendComplete(int rv); 98 void OnCreateBackendComplete(int rv);
102 void AddOpenEntry(EntryImpl* entry) { open_entries_.insert(entry); } 99 void AddOpenEntry(EntryImpl* entry) { open_entries_.insert(entry); }
103 void RemoveOpenEntry(EntryImpl* entry) { open_entries_.erase(entry); } 100 void RemoveOpenEntry(EntryImpl* entry) { open_entries_.erase(entry); }
104 101
105 bool use_simple_cache_;
106 bool is_disabled_; 102 bool is_disabled_;
107 net::CompletionCallback init_callback_; 103 net::CompletionCallback init_callback_;
108 scoped_refptr<CreateBackendCallbackShim> create_backend_callback_; 104 scoped_refptr<CreateBackendCallbackShim> create_backend_callback_;
109 PendingCalls pending_calls_; 105 PendingCalls pending_calls_;
110 OpenEntries open_entries_; 106 OpenEntries open_entries_;
111 scoped_ptr<disk_cache::Backend> disk_cache_; 107 scoped_ptr<disk_cache::Backend> disk_cache_;
112 108
113 base::WeakPtrFactory<AppCacheDiskCache> weak_factory_; 109 base::WeakPtrFactory<AppCacheDiskCache> weak_factory_;
114 }; 110 };
115 111
116 } // namespace content 112 } // namespace content
117 113
118 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_DISK_CACHE_H_ 114 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_DISK_CACHE_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/appcache/appcache_disk_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698