| 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 url { |
| 17 class Origin; |
| 18 } |
| 19 |
| 16 namespace content { | 20 namespace content { |
| 17 | 21 |
| 18 class BackgroundFetchContext; | 22 class BackgroundFetchContext; |
| 19 struct BackgroundFetchOptions; | 23 struct BackgroundFetchOptions; |
| 20 class ServiceWorkerContextWrapper; | 24 class ServiceWorkerContextWrapper; |
| 21 | 25 |
| 22 class BackgroundFetchServiceImpl : public blink::mojom::BackgroundFetchService { | 26 class BackgroundFetchServiceImpl : public blink::mojom::BackgroundFetchService { |
| 23 public: | 27 public: |
| 24 BackgroundFetchServiceImpl( | 28 BackgroundFetchServiceImpl( |
| 25 scoped_refptr<BackgroundFetchContext> background_fetch_context, | 29 scoped_refptr<BackgroundFetchContext> background_fetch_context, |
| 26 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context); | 30 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context); |
| 27 ~BackgroundFetchServiceImpl() override; | 31 ~BackgroundFetchServiceImpl() override; |
| 28 | 32 |
| 29 static void Create( | 33 static void Create( |
| 30 scoped_refptr<BackgroundFetchContext> background_fetch_context, | 34 scoped_refptr<BackgroundFetchContext> background_fetch_context, |
| 31 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context, | 35 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context, |
| 32 blink::mojom::BackgroundFetchServiceRequest request); | 36 blink::mojom::BackgroundFetchServiceRequest request); |
| 33 | 37 |
| 34 // blink::mojom::BackgroundFetchService implementation. | 38 // blink::mojom::BackgroundFetchService implementation. |
| 35 void Fetch(int64_t service_worker_registration_id, | 39 void Fetch(int64_t service_worker_registration_id, |
| 40 const url::Origin& origin, |
| 36 const std::string& tag, | 41 const std::string& tag, |
| 37 const BackgroundFetchOptions& options, | 42 const BackgroundFetchOptions& options, |
| 38 const FetchCallback& callback) override; | 43 const FetchCallback& callback) override; |
| 39 void UpdateUI(int64_t service_worker_registration_id, | 44 void UpdateUI(int64_t service_worker_registration_id, |
| 45 const url::Origin& origin, |
| 40 const std::string& tag, | 46 const std::string& tag, |
| 41 const std::string& title, | 47 const std::string& title, |
| 42 const UpdateUICallback& callback) override; | 48 const UpdateUICallback& callback) override; |
| 43 void Abort(int64_t service_worker_registration_id, | 49 void Abort(int64_t service_worker_registration_id, |
| 50 const url::Origin& origin, |
| 44 const std::string& tag, | 51 const std::string& tag, |
| 45 const AbortCallback& callback) override; | 52 const AbortCallback& callback) override; |
| 46 void GetRegistration(int64_t service_worker_registration_id, | 53 void GetRegistration(int64_t service_worker_registration_id, |
| 54 const url::Origin& origin, |
| 47 const std::string& tag, | 55 const std::string& tag, |
| 48 const GetRegistrationCallback& callback) override; | 56 const GetRegistrationCallback& callback) override; |
| 49 void GetTags(int64_t service_worker_registration_id, | 57 void GetTags(int64_t service_worker_registration_id, |
| 58 const url::Origin& origin, |
| 50 const GetTagsCallback& callback) override; | 59 const GetTagsCallback& callback) override; |
| 51 | 60 |
| 52 private: | 61 private: |
| 53 scoped_refptr<BackgroundFetchContext> background_fetch_context_; | 62 scoped_refptr<BackgroundFetchContext> background_fetch_context_; |
| 54 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; | 63 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; |
| 55 | 64 |
| 56 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchServiceImpl); | 65 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchServiceImpl); |
| 57 }; | 66 }; |
| 58 | 67 |
| 59 } // namespace content | 68 } // namespace content |
| 60 | 69 |
| 61 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_SERVICE_IMPL_H_ | 70 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_SERVICE_IMPL_H_ |
| OLD | NEW |