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 "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" |
16 | 17 |
17 namespace url { | 18 namespace url { |
18 class Origin; | 19 class Origin; |
19 } | 20 } |
20 | 21 |
21 namespace content { | 22 namespace content { |
22 | 23 |
23 class BackgroundFetchContext; | 24 class BackgroundFetchContext; |
24 struct BackgroundFetchOptions; | 25 struct BackgroundFetchOptions; |
25 struct ServiceWorkerFetchRequest; | 26 struct ServiceWorkerFetchRequest; |
26 | 27 |
27 class BackgroundFetchServiceImpl : public blink::mojom::BackgroundFetchService { | 28 class CONTENT_EXPORT BackgroundFetchServiceImpl |
29 : public blink::mojom::BackgroundFetchService { | |
28 public: | 30 public: |
29 BackgroundFetchServiceImpl( | 31 BackgroundFetchServiceImpl( |
30 int render_process_id, | 32 int render_process_id, |
31 scoped_refptr<BackgroundFetchContext> background_fetch_context); | 33 scoped_refptr<BackgroundFetchContext> background_fetch_context); |
32 ~BackgroundFetchServiceImpl() override; | 34 ~BackgroundFetchServiceImpl() override; |
33 | 35 |
34 static void Create( | 36 static void Create( |
35 int render_process_id, | 37 int render_process_id, |
36 scoped_refptr<BackgroundFetchContext> background_fetch_context, | 38 scoped_refptr<BackgroundFetchContext> background_fetch_context, |
37 blink::mojom::BackgroundFetchServiceRequest request); | 39 blink::mojom::BackgroundFetchServiceRequest request); |
(...skipping 29 matching lines...) Expand all Loading... | |
67 | 69 |
68 // Validates and returns whether |requests| contains at least a valid request. | 70 // Validates and returns whether |requests| contains at least a valid request. |
69 // The renderer will be flagged for having send a bad message if it isn't. | 71 // The renderer will be flagged for having send a bad message if it isn't. |
70 bool ValidateRequests(const std::vector<ServiceWorkerFetchRequest>& requests) | 72 bool ValidateRequests(const std::vector<ServiceWorkerFetchRequest>& requests) |
71 WARN_UNUSED_RESULT; | 73 WARN_UNUSED_RESULT; |
72 | 74 |
73 // Validates and returns whether the |title| contains a valid value. The | 75 // Validates and returns whether the |title| contains a valid value. The |
74 // renderer will be flagged for having send a bad message if it isn't. | 76 // renderer will be flagged for having send a bad message if it isn't. |
75 bool ValidateTitle(const std::string& title) WARN_UNUSED_RESULT; | 77 bool ValidateTitle(const std::string& title) WARN_UNUSED_RESULT; |
76 | 78 |
79 // | |
harkness
2017/03/30 14:15:28
micro-nit: remove
Peter Beverloo
2017/03/30 14:50:38
Done.
| |
80 void DidUpdateUI(); | |
81 | |
77 // Id of the renderer process that this service has been created for. | 82 // Id of the renderer process that this service has been created for. |
78 int render_process_id_; | 83 int render_process_id_; |
79 | 84 |
80 // The Background Fetch context on which operations will be dispatched. | 85 // The Background Fetch context on which operations will be dispatched. |
81 scoped_refptr<BackgroundFetchContext> background_fetch_context_; | 86 scoped_refptr<BackgroundFetchContext> background_fetch_context_; |
82 | 87 |
83 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchServiceImpl); | 88 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchServiceImpl); |
84 }; | 89 }; |
85 | 90 |
86 } // namespace content | 91 } // namespace content |
87 | 92 |
88 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_SERVICE_IMPL_H_ | 93 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_SERVICE_IMPL_H_ |
OLD | NEW |