| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_SERVICE_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_SERVICE_IMPL_H_ |
| 6 #define CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_SERVICE_IMPL_H_ | 6 #define CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_SERVICE_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "third_party/WebKit/public/platform/modules/background_fetch/background
_fetch.mojom.h" | 14 #include "third_party/WebKit/public/platform/modules/background_fetch/background
_fetch.mojom.h" |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 | 17 |
| 18 class BackgroundFetchContext; | 18 class BackgroundFetchContext; |
| 19 struct BackgroundFetchOptions; | 19 struct BackgroundFetchOptions; |
| 20 class ServiceWorkerContextWrapper; | 20 class ServiceWorkerContextWrapper; |
| 21 struct ServiceWorkerFetchRequest; |
| 21 | 22 |
| 22 class BackgroundFetchServiceImpl : public blink::mojom::BackgroundFetchService { | 23 class BackgroundFetchServiceImpl : public blink::mojom::BackgroundFetchService { |
| 23 public: | 24 public: |
| 24 BackgroundFetchServiceImpl( | 25 BackgroundFetchServiceImpl( |
| 25 scoped_refptr<BackgroundFetchContext> background_fetch_context, | 26 scoped_refptr<BackgroundFetchContext> background_fetch_context, |
| 26 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context); | 27 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context); |
| 27 ~BackgroundFetchServiceImpl() override; | 28 ~BackgroundFetchServiceImpl() override; |
| 28 | 29 |
| 29 static void Create( | 30 static void Create( |
| 30 scoped_refptr<BackgroundFetchContext> background_fetch_context, | 31 scoped_refptr<BackgroundFetchContext> background_fetch_context, |
| 31 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context, | 32 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context, |
| 32 blink::mojom::BackgroundFetchServiceRequest request); | 33 blink::mojom::BackgroundFetchServiceRequest request); |
| 33 | 34 |
| 34 // blink::mojom::BackgroundFetchService implementation. | 35 // blink::mojom::BackgroundFetchService implementation. |
| 35 void Fetch(int64_t service_worker_registration_id, | 36 void Fetch(int64_t service_worker_registration_id, |
| 36 const std::string& tag, | 37 const std::string& tag, |
| 38 const std::vector<ServiceWorkerFetchRequest>& requests, |
| 37 const BackgroundFetchOptions& options, | 39 const BackgroundFetchOptions& options, |
| 38 const FetchCallback& callback) override; | 40 const FetchCallback& callback) override; |
| 39 void UpdateUI(int64_t service_worker_registration_id, | 41 void UpdateUI(int64_t service_worker_registration_id, |
| 40 const std::string& tag, | 42 const std::string& tag, |
| 41 const std::string& title, | 43 const std::string& title, |
| 42 const UpdateUICallback& callback) override; | 44 const UpdateUICallback& callback) override; |
| 43 void Abort(int64_t service_worker_registration_id, | 45 void Abort(int64_t service_worker_registration_id, |
| 44 const std::string& tag, | 46 const std::string& tag, |
| 45 const AbortCallback& callback) override; | 47 const AbortCallback& callback) override; |
| 46 void GetRegistration(int64_t service_worker_registration_id, | 48 void GetRegistration(int64_t service_worker_registration_id, |
| 47 const std::string& tag, | 49 const std::string& tag, |
| 48 const GetRegistrationCallback& callback) override; | 50 const GetRegistrationCallback& callback) override; |
| 49 void GetTags(int64_t service_worker_registration_id, | 51 void GetTags(int64_t service_worker_registration_id, |
| 50 const GetTagsCallback& callback) override; | 52 const GetTagsCallback& callback) override; |
| 51 | 53 |
| 52 private: | 54 private: |
| 53 scoped_refptr<BackgroundFetchContext> background_fetch_context_; | 55 scoped_refptr<BackgroundFetchContext> background_fetch_context_; |
| 54 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; | 56 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; |
| 55 | 57 |
| 56 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchServiceImpl); | 58 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchServiceImpl); |
| 57 }; | 59 }; |
| 58 | 60 |
| 59 } // namespace content | 61 } // namespace content |
| 60 | 62 |
| 61 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_SERVICE_IMPL_H_ | 63 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_SERVICE_IMPL_H_ |
| OLD | NEW |