| 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/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "third_party/WebKit/public/platform/modules/background_fetch/background
_fetch.mojom.h" | 15 #include "third_party/WebKit/public/platform/modules/background_fetch/background
_fetch.mojom.h" |
| 16 | 16 |
| 17 namespace url { | 17 namespace url { |
| 18 class Origin; | 18 class Origin; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace content { | 21 namespace content { |
| 22 | 22 |
| 23 class BackgroundFetchContext; | 23 class BackgroundFetchContext; |
| 24 struct BackgroundFetchOptions; | 24 struct BackgroundFetchOptions; |
| 25 struct ServiceWorkerFetchRequest; |
| 25 | 26 |
| 26 class BackgroundFetchServiceImpl : public blink::mojom::BackgroundFetchService { | 27 class BackgroundFetchServiceImpl : public blink::mojom::BackgroundFetchService { |
| 27 public: | 28 public: |
| 28 BackgroundFetchServiceImpl( | 29 BackgroundFetchServiceImpl( |
| 29 int render_process_id, | 30 int render_process_id, |
| 30 scoped_refptr<BackgroundFetchContext> background_fetch_context); | 31 scoped_refptr<BackgroundFetchContext> background_fetch_context); |
| 31 ~BackgroundFetchServiceImpl() override; | 32 ~BackgroundFetchServiceImpl() override; |
| 32 | 33 |
| 33 static void Create( | 34 static void Create( |
| 34 int render_process_id, | 35 int render_process_id, |
| 35 scoped_refptr<BackgroundFetchContext> background_fetch_context, | 36 scoped_refptr<BackgroundFetchContext> background_fetch_context, |
| 36 blink::mojom::BackgroundFetchServiceRequest request); | 37 blink::mojom::BackgroundFetchServiceRequest request); |
| 37 | 38 |
| 38 // blink::mojom::BackgroundFetchService implementation. | 39 // blink::mojom::BackgroundFetchService implementation. |
| 39 void Fetch(int64_t service_worker_registration_id, | 40 void Fetch(int64_t service_worker_registration_id, |
| 40 const url::Origin& origin, | 41 const url::Origin& origin, |
| 41 const std::string& tag, | 42 const std::string& tag, |
| 43 const std::vector<ServiceWorkerFetchRequest>& requests, |
| 42 const BackgroundFetchOptions& options, | 44 const BackgroundFetchOptions& options, |
| 43 const FetchCallback& callback) override; | 45 const FetchCallback& callback) override; |
| 44 void UpdateUI(int64_t service_worker_registration_id, | 46 void UpdateUI(int64_t service_worker_registration_id, |
| 45 const url::Origin& origin, | 47 const url::Origin& origin, |
| 46 const std::string& tag, | 48 const std::string& tag, |
| 47 const std::string& title, | 49 const std::string& title, |
| 48 const UpdateUICallback& callback) override; | 50 const UpdateUICallback& callback) override; |
| 49 void Abort(int64_t service_worker_registration_id, | 51 void Abort(int64_t service_worker_registration_id, |
| 50 const url::Origin& origin, | 52 const url::Origin& origin, |
| 51 const std::string& tag, | 53 const std::string& tag, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 77 | 79 |
| 78 // The Background Fetch context on which operations will be dispatched. | 80 // The Background Fetch context on which operations will be dispatched. |
| 79 scoped_refptr<BackgroundFetchContext> background_fetch_context_; | 81 scoped_refptr<BackgroundFetchContext> background_fetch_context_; |
| 80 | 82 |
| 81 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchServiceImpl); | 83 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchServiceImpl); |
| 82 }; | 84 }; |
| 83 | 85 |
| 84 } // namespace content | 86 } // namespace content |
| 85 | 87 |
| 86 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_SERVICE_IMPL_H_ | 88 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_SERVICE_IMPL_H_ |
| OLD | NEW |