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

Side by Side Diff: webkit/appcache/mock_appcache_storage.h

Issue 7210006: AppCaches which belong to hosted apps are not protected from deletion (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Test beautification. Created 9 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 WEBKIT_APPCACHE_MOCK_APPCACHE_STORAGE_H_ 5 #ifndef WEBKIT_APPCACHE_MOCK_APPCACHE_STORAGE_H_
6 #define WEBKIT_APPCACHE_MOCK_APPCACHE_STORAGE_H_ 6 #define WEBKIT_APPCACHE_MOCK_APPCACHE_STORAGE_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <map> 9 #include <map>
10 #include <vector> 10 #include <vector>
(...skipping 12 matching lines...) Expand all
23 // For use in unit tests. 23 // For use in unit tests.
24 // Note: This class is also being used to bootstrap our development efforts. 24 // Note: This class is also being used to bootstrap our development efforts.
25 // We can get layout tests up and running, and back fill with real storage 25 // We can get layout tests up and running, and back fill with real storage
26 // somewhat in parallel. 26 // somewhat in parallel.
27 class MockAppCacheStorage : public AppCacheStorage { 27 class MockAppCacheStorage : public AppCacheStorage {
28 public: 28 public:
29 explicit MockAppCacheStorage(AppCacheService* service); 29 explicit MockAppCacheStorage(AppCacheService* service);
30 virtual ~MockAppCacheStorage(); 30 virtual ~MockAppCacheStorage();
31 31
32 virtual void GetAllInfo(Delegate* delegate); 32 virtual void GetAllInfo(Delegate* delegate);
33 virtual void SyncGetAllInfo(Delegate* delegate);
33 virtual void LoadCache(int64 id, Delegate* delegate); 34 virtual void LoadCache(int64 id, Delegate* delegate);
34 virtual void LoadOrCreateGroup(const GURL& manifest_url, Delegate* delegate); 35 virtual void LoadOrCreateGroup(const GURL& manifest_url, Delegate* delegate);
36 virtual void SyncLoadOrCreateGroup(const GURL& manifest_url,
37 Delegate* delegate);
35 virtual void StoreGroupAndNewestCache( 38 virtual void StoreGroupAndNewestCache(
36 AppCacheGroup* group, AppCache* newest_cache, Delegate* delegate); 39 AppCacheGroup* group, AppCache* newest_cache, Delegate* delegate);
37 virtual void FindResponseForMainRequest( 40 virtual void FindResponseForMainRequest(
38 const GURL& url, const GURL& preferred_manifest_url, Delegate* delegate); 41 const GURL& url, const GURL& preferred_manifest_url, Delegate* delegate);
39 virtual void FindResponseForSubRequest( 42 virtual void FindResponseForSubRequest(
40 AppCache* cache, const GURL& url, 43 AppCache* cache, const GURL& url,
41 AppCacheEntry* found_entry, AppCacheEntry* found_fallback_entry, 44 AppCacheEntry* found_entry, AppCacheEntry* found_fallback_entry,
42 bool * found_network_namespace); 45 bool * found_network_namespace);
43 virtual void MarkEntryAsForeign(const GURL& entry_url, int64 cache_id); 46 virtual void MarkEntryAsForeign(const GURL& entry_url, int64 cache_id);
44 virtual void MakeGroupObsolete(AppCacheGroup* group, Delegate* delegate); 47 virtual void MakeGroupObsolete(AppCacheGroup* group, Delegate* delegate);
48 virtual void SyncMakeGroupObsolete(AppCacheGroup* group, Delegate* delegate);
45 virtual AppCacheResponseReader* CreateResponseReader( 49 virtual AppCacheResponseReader* CreateResponseReader(
46 const GURL& manifest_url, int64 response_id); 50 const GURL& manifest_url, int64 response_id);
47 virtual AppCacheResponseWriter* CreateResponseWriter(const GURL& origin); 51 virtual AppCacheResponseWriter* CreateResponseWriter(const GURL& origin);
48 virtual void DoomResponses( 52 virtual void DoomResponses(
49 const GURL& manifest_url, const std::vector<int64>& response_ids); 53 const GURL& manifest_url, const std::vector<int64>& response_ids);
50 virtual void DeleteResponses( 54 virtual void DeleteResponses(
51 const GURL& manifest_url, const std::vector<int64>& response_ids); 55 const GURL& manifest_url, const std::vector<int64>& response_ids);
52 virtual void PurgeMemory() {} 56 virtual void PurgeMemory() {}
53 57
54 private: 58 private:
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 FRIEND_TEST_ALL_PREFIXES(MockAppCacheStorageTest, 189 FRIEND_TEST_ALL_PREFIXES(MockAppCacheStorageTest,
186 StoreExistingGroupExistingCache); 190 StoreExistingGroupExistingCache);
187 FRIEND_TEST_ALL_PREFIXES(AppCacheServiceTest, DeleteAppCachesForOrigin); 191 FRIEND_TEST_ALL_PREFIXES(AppCacheServiceTest, DeleteAppCachesForOrigin);
188 192
189 DISALLOW_COPY_AND_ASSIGN(MockAppCacheStorage); 193 DISALLOW_COPY_AND_ASSIGN(MockAppCacheStorage);
190 }; 194 };
191 195
192 } // namespace appcache 196 } // namespace appcache
193 197
194 #endif // WEBKIT_APPCACHE_MOCK_APPCACHE_STORAGE_H_ 198 #endif // WEBKIT_APPCACHE_MOCK_APPCACHE_STORAGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698