OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SERVICE_WORKER_HELPER_H_ | 5 #ifndef CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_SERVICE_WORKER_HELPER_H_ |
6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_SERVICE_WORKER_HELPER_H_ | 6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_SERVICE_WORKER_HELPER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 100 |
101 bool operator<(const PendingServiceWorkerUsageInfo& other) const; | 101 bool operator<(const PendingServiceWorkerUsageInfo& other) const; |
102 | 102 |
103 GURL origin; | 103 GURL origin; |
104 std::vector<GURL> scopes; | 104 std::vector<GURL> scopes; |
105 }; | 105 }; |
106 | 106 |
107 explicit CannedBrowsingDataServiceWorkerHelper( | 107 explicit CannedBrowsingDataServiceWorkerHelper( |
108 content::ServiceWorkerContext* context); | 108 content::ServiceWorkerContext* context); |
109 | 109 |
110 // Return a copy of the ServiceWorker helper. Only one consumer can use the | |
111 // StartFetching method at a time, so we need to create a copy of the helper | |
112 // every time we instantiate a cookies tree model for it. | |
113 CannedBrowsingDataServiceWorkerHelper* Clone(); | |
114 | |
115 // Add a Service Worker to the set of canned Service Workers that is | 110 // Add a Service Worker to the set of canned Service Workers that is |
116 // returned by this helper. | 111 // returned by this helper. |
117 void AddServiceWorker(const GURL& origin, const std::vector<GURL>& scopes); | 112 void AddServiceWorker(const GURL& origin, const std::vector<GURL>& scopes); |
118 | 113 |
119 // Clear the list of canned Service Workers. | 114 // Clear the list of canned Service Workers. |
120 void Reset(); | 115 void Reset(); |
121 | 116 |
122 // True if no Service Workers are currently stored. | 117 // True if no Service Workers are currently stored. |
123 bool empty() const; | 118 bool empty() const; |
124 | 119 |
(...skipping 12 matching lines...) Expand all Loading... |
137 | 132 |
138 private: | 133 private: |
139 virtual ~CannedBrowsingDataServiceWorkerHelper(); | 134 virtual ~CannedBrowsingDataServiceWorkerHelper(); |
140 | 135 |
141 std::set<PendingServiceWorkerUsageInfo> pending_service_worker_info_; | 136 std::set<PendingServiceWorkerUsageInfo> pending_service_worker_info_; |
142 | 137 |
143 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataServiceWorkerHelper); | 138 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataServiceWorkerHelper); |
144 }; | 139 }; |
145 | 140 |
146 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_SERVICE_WORKER_HELPER_H_ | 141 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_SERVICE_WORKER_HELPER_H_ |
OLD | NEW |