| 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> |
| 11 #include <vector> |
| 11 | 12 |
| 12 #include "base/callback.h" | 13 #include "base/callback.h" |
| 13 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 14 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
| 15 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 16 #include "base/synchronization/lock.h" | 17 #include "base/synchronization/lock.h" |
| 17 #include "base/time/time.h" | 18 #include "base/time/time.h" |
| 18 #include "content/public/browser/service_worker_context.h" | 19 #include "content/public/browser/service_worker_context.h" |
| 19 #include "content/public/browser/service_worker_usage_info.h" | 20 #include "content/public/browser/service_worker_usage_info.h" |
| 20 #include "url/gurl.h" | 21 #include "url/gurl.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 // context's ServiceWorker thread. | 57 // context's ServiceWorker thread. |
| 57 std::list<content::ServiceWorkerUsageInfo> service_worker_info_; | 58 std::list<content::ServiceWorkerUsageInfo> service_worker_info_; |
| 58 | 59 |
| 59 // This member is only mutated on the UI thread. | 60 // This member is only mutated on the UI thread. |
| 60 base::Callback<void(const std::list<content::ServiceWorkerUsageInfo>&)> | 61 base::Callback<void(const std::list<content::ServiceWorkerUsageInfo>&)> |
| 61 completion_callback_; | 62 completion_callback_; |
| 62 | 63 |
| 63 // Indicates whether or not we're currently fetching information: | 64 // Indicates whether or not we're currently fetching information: |
| 64 // it's true when StartFetching() is called in the UI thread, and it's reset | 65 // it's true when StartFetching() is called in the UI thread, and it's reset |
| 65 // after we notified the callback in the UI thread. | 66 // after we notified the callback in the UI thread. |
| 66 // This only mutates on the UI thread. | 67 // This member is only mutated on the UI thread. |
| 67 bool is_fetching_; | 68 bool is_fetching_; |
| 68 | 69 |
| 69 private: | 70 private: |
| 70 friend class base::RefCountedThreadSafe<BrowsingDataServiceWorkerHelper>; | 71 friend class base::RefCountedThreadSafe<BrowsingDataServiceWorkerHelper>; |
| 71 | 72 |
| 72 // Enumerates all Service Worker instances on the IO thread. | 73 // Enumerates all Service Worker instances on the IO thread. |
| 73 void FetchServiceWorkerUsageInfoOnIOThread(); | 74 void FetchServiceWorkerUsageInfoOnIOThread(); |
| 74 | 75 |
| 75 // Notifies the completion callback in the UI thread. | 76 // Notifies the completion callback in the UI thread. |
| 76 void NotifyOnUIThread(); | 77 void NotifyOnUIThread(); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 | 137 |
| 137 private: | 138 private: |
| 138 virtual ~CannedBrowsingDataServiceWorkerHelper(); | 139 virtual ~CannedBrowsingDataServiceWorkerHelper(); |
| 139 | 140 |
| 140 std::set<PendingServiceWorkerUsageInfo> pending_service_worker_info_; | 141 std::set<PendingServiceWorkerUsageInfo> pending_service_worker_info_; |
| 141 | 142 |
| 142 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataServiceWorkerHelper); | 143 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataServiceWorkerHelper); |
| 143 }; | 144 }; |
| 144 | 145 |
| 145 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_SERVICE_WORKER_HELPER_H_ | 146 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_SERVICE_WORKER_HELPER_H_ |
| OLD | NEW |