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