OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_APPCACHE_HELPER_H_ | 5 #ifndef CHROME_BROWSER_BROWSING_DATA_APPCACHE_HELPER_H_ |
6 #define CHROME_BROWSER_BROWSING_DATA_APPCACHE_HELPER_H_ | 6 #define CHROME_BROWSER_BROWSING_DATA_APPCACHE_HELPER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
10 #include "base/task.h" | 10 #include "base/task.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 DISALLOW_COPY_AND_ASSIGN(BrowsingDataAppCacheHelper); | 49 DISALLOW_COPY_AND_ASSIGN(BrowsingDataAppCacheHelper); |
50 }; | 50 }; |
51 | 51 |
52 // This class is a thin wrapper around BrowsingDataAppCacheHelper that does not | 52 // This class is a thin wrapper around BrowsingDataAppCacheHelper that does not |
53 // fetch its information from the appcache service, but gets them passed as | 53 // fetch its information from the appcache service, but gets them passed as |
54 // a parameter during construction. | 54 // a parameter during construction. |
55 class CannedBrowsingDataAppCacheHelper : public BrowsingDataAppCacheHelper { | 55 class CannedBrowsingDataAppCacheHelper : public BrowsingDataAppCacheHelper { |
56 public: | 56 public: |
57 explicit CannedBrowsingDataAppCacheHelper(Profile* profile); | 57 explicit CannedBrowsingDataAppCacheHelper(Profile* profile); |
58 | 58 |
| 59 // Return a copy of the appcache helper. Only one consumer can use the |
| 60 // StartFetching method at a time, so we need to create a copy of the helper |
| 61 // everytime we instantiate a cookies tree model for it. |
| 62 CannedBrowsingDataAppCacheHelper* Clone(); |
| 63 |
59 // Add an appcache to the set of canned caches that is returned by this | 64 // Add an appcache to the set of canned caches that is returned by this |
60 // helper. | 65 // helper. |
61 void AddAppCache(const GURL& manifest_url); | 66 void AddAppCache(const GURL& manifest_url); |
62 | 67 |
63 // Clears the list of canned caches. | 68 // Clears the list of canned caches. |
64 void Reset(); | 69 void Reset(); |
65 | 70 |
66 // True if no appcaches are currently stored. | 71 // True if no appcaches are currently stored. |
67 bool empty() const; | 72 bool empty() const; |
68 | 73 |
69 // BrowsingDataAppCacheHelper methods. | 74 // BrowsingDataAppCacheHelper methods. |
70 virtual void StartFetching(Callback0::Type* completion_callback); | 75 virtual void StartFetching(Callback0::Type* completion_callback); |
71 virtual void CancelNotification() {} | 76 virtual void CancelNotification() {} |
72 | 77 |
73 private: | 78 private: |
74 virtual ~CannedBrowsingDataAppCacheHelper(); | 79 virtual ~CannedBrowsingDataAppCacheHelper(); |
75 | 80 |
| 81 Profile* profile_; |
| 82 |
76 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataAppCacheHelper); | 83 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataAppCacheHelper); |
77 }; | 84 }; |
78 | 85 |
79 #endif // CHROME_BROWSER_BROWSING_DATA_APPCACHE_HELPER_H_ | 86 #endif // CHROME_BROWSER_BROWSING_DATA_APPCACHE_HELPER_H_ |
OLD | NEW |