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 #ifndef CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_APPCACHE_HELPER_H_ | 5 #ifndef CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_APPCACHE_HELPER_H_ |
6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_APPCACHE_HELPER_H_ | 6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_APPCACHE_HELPER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 DISALLOW_COPY_AND_ASSIGN(BrowsingDataAppCacheHelper); | 53 DISALLOW_COPY_AND_ASSIGN(BrowsingDataAppCacheHelper); |
54 }; | 54 }; |
55 | 55 |
56 // This class is a thin wrapper around BrowsingDataAppCacheHelper that does not | 56 // This class is a thin wrapper around BrowsingDataAppCacheHelper that does not |
57 // fetch its information from the appcache service, but gets them passed as | 57 // fetch its information from the appcache service, but gets them passed as |
58 // a parameter during construction. | 58 // a parameter during construction. |
59 class CannedBrowsingDataAppCacheHelper : public BrowsingDataAppCacheHelper { | 59 class CannedBrowsingDataAppCacheHelper : public BrowsingDataAppCacheHelper { |
60 public: | 60 public: |
61 explicit CannedBrowsingDataAppCacheHelper(Profile* profile); | 61 explicit CannedBrowsingDataAppCacheHelper(Profile* profile); |
62 | 62 |
63 // Return a copy of the appcache helper. Only one consumer can use the | |
64 // StartFetching method at a time, so we need to create a copy of the helper | |
65 // every time we instantiate a cookies tree model for it. | |
66 CannedBrowsingDataAppCacheHelper* Clone(); | |
67 | |
68 // Add an appcache to the set of canned caches that is returned by this | 63 // Add an appcache to the set of canned caches that is returned by this |
69 // helper. | 64 // helper. |
70 void AddAppCache(const GURL& manifest_url); | 65 void AddAppCache(const GURL& manifest_url); |
71 | 66 |
72 // Clears the list of canned caches. | 67 // Clears the list of canned caches. |
73 void Reset(); | 68 void Reset(); |
74 | 69 |
75 // True if no appcaches are currently stored. | 70 // True if no appcaches are currently stored. |
76 bool empty() const; | 71 bool empty() const; |
77 | 72 |
78 // Returns the number of app cache resources. | 73 // Returns the number of app cache resources. |
79 size_t GetAppCacheCount() const; | 74 size_t GetAppCacheCount() const; |
80 | 75 |
81 // Returns a current map with the |AppCacheInfoVector|s per origin. | 76 // Returns a current map with the |AppCacheInfoVector|s per origin. |
82 const OriginAppCacheInfoMap& GetOriginAppCacheInfoMap() const; | 77 const OriginAppCacheInfoMap& GetOriginAppCacheInfoMap() const; |
83 | 78 |
84 // BrowsingDataAppCacheHelper methods. | 79 // BrowsingDataAppCacheHelper methods. |
85 virtual void StartFetching(const base::Closure& completion_callback) OVERRIDE; | 80 virtual void StartFetching(const base::Closure& completion_callback) OVERRIDE; |
86 virtual void DeleteAppCacheGroup(const GURL& manifest_url) OVERRIDE; | 81 virtual void DeleteAppCacheGroup(const GURL& manifest_url) OVERRIDE; |
87 | 82 |
88 private: | 83 private: |
89 virtual ~CannedBrowsingDataAppCacheHelper(); | 84 virtual ~CannedBrowsingDataAppCacheHelper(); |
90 | 85 |
91 Profile* profile_; | |
92 | |
93 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataAppCacheHelper); | 86 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataAppCacheHelper); |
94 }; | 87 }; |
95 | 88 |
96 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_APPCACHE_HELPER_H_ | 89 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_APPCACHE_HELPER_H_ |
OLD | NEW |