Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(834)

Side by Side Diff: content/browser/background_fetch/background_fetch_service_impl.h

Issue 2762573003: Implement BackgroundFetchManager.fetch() and struct traits (Closed)
Patch Set: First round of comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 11
11 #include "base/macros.h" 12 #include "base/macros.h"
12 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
13 #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"
14 15
15 namespace content { 16 namespace content {
16 17
17 class BackgroundFetchContext; 18 class BackgroundFetchContext;
19 struct BackgroundFetchOptions;
18 class ServiceWorkerContextWrapper; 20 class ServiceWorkerContextWrapper;
19 21
20 class BackgroundFetchServiceImpl : public blink::mojom::BackgroundFetchService { 22 class BackgroundFetchServiceImpl : public blink::mojom::BackgroundFetchService {
21 public: 23 public:
22 BackgroundFetchServiceImpl( 24 BackgroundFetchServiceImpl(
23 scoped_refptr<BackgroundFetchContext> background_fetch_context, 25 scoped_refptr<BackgroundFetchContext> background_fetch_context,
24 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context); 26 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context);
25 ~BackgroundFetchServiceImpl() override; 27 ~BackgroundFetchServiceImpl() override;
26 28
27 static void Create( 29 static void Create(
28 scoped_refptr<BackgroundFetchContext> background_fetch_context, 30 scoped_refptr<BackgroundFetchContext> background_fetch_context,
29 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context, 31 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context,
30 blink::mojom::BackgroundFetchServiceRequest request); 32 blink::mojom::BackgroundFetchServiceRequest request);
31 33
32 // blink::mojom::BackgroundFetchService implementation. 34 // blink::mojom::BackgroundFetchService implementation.
35 void Fetch(int64_t service_worker_registration_id,
36 const std::string& tag,
37 const BackgroundFetchOptions& options,
38 const FetchCallback& callback) override;
33 void UpdateUI(int64_t service_worker_registration_id, 39 void UpdateUI(int64_t service_worker_registration_id,
34 const std::string& tag, 40 const std::string& tag,
35 const std::string& title, 41 const std::string& title,
36 const UpdateUICallback& callback) override; 42 const UpdateUICallback& callback) override;
37 void Abort(int64_t service_worker_registration_id, 43 void Abort(int64_t service_worker_registration_id,
38 const std::string& tag, 44 const std::string& tag,
39 const AbortCallback& callback) override; 45 const AbortCallback& callback) override;
40 void GetRegistration(int64_t service_worker_registration_id, 46 void GetRegistration(int64_t service_worker_registration_id,
41 const std::string& tag, 47 const std::string& tag,
42 const GetRegistrationCallback& callback) override; 48 const GetRegistrationCallback& callback) override;
43 void GetTags(int64_t service_worker_registration_id, 49 void GetTags(int64_t service_worker_registration_id,
44 const GetTagsCallback& callback) override; 50 const GetTagsCallback& callback) override;
45 51
46 private: 52 private:
47 scoped_refptr<BackgroundFetchContext> background_fetch_context_; 53 scoped_refptr<BackgroundFetchContext> background_fetch_context_;
48 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; 54 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_;
49 55
50 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchServiceImpl); 56 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchServiceImpl);
51 }; 57 };
52 58
53 } // namespace content 59 } // namespace content
54 60
55 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_SERVICE_IMPL_H_ 61 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_SERVICE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698