Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_SERVICE_IMPL_H_ | |
| 6 #define CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_SERVICE_IMPL_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "base/memory/ref_counted.h" | |
| 12 #include "third_party/WebKit/public/platform/modules/background_fetch/background _fetch.mojom.h" | |
| 13 | |
| 14 namespace content { | |
| 15 | |
| 16 class BackgroundFetchContext; | |
| 17 class ServiceWorkerContextWrapper; | |
| 18 | |
| 19 class BackgroundFetchServiceImpl : public blink::mojom::BackgroundFetchService { | |
| 20 public: | |
| 21 BackgroundFetchServiceImpl( | |
| 22 BackgroundFetchContext* background_fetch_context, | |
|
dcheng
2017/03/16 07:14:07
Nit: these are refcounted and this class takes a r
Peter Beverloo
2017/03/16 15:32:55
Bonus points acquired!
| |
| 23 ServiceWorkerContextWrapper* service_worker_context); | |
| 24 ~BackgroundFetchServiceImpl() override; | |
| 25 | |
| 26 static void Create(BackgroundFetchContext* background_fetch_context, | |
| 27 ServiceWorkerContextWrapper* service_worker_context, | |
| 28 blink::mojom::BackgroundFetchServiceRequest request); | |
| 29 | |
| 30 // blink::mojom::BackgroundFetchService implementation. | |
| 31 void UpdateUI(int64_t service_worker_registration_id, | |
| 32 const std::string& tag, | |
| 33 const std::string& title, | |
| 34 const UpdateUICallback& callback) override; | |
| 35 void Abort(int64_t service_worker_registration_id, | |
| 36 const std::string& tag) override; | |
| 37 void GetRegistration(int64_t service_worker_registration_id, | |
| 38 const std::string& tag, | |
| 39 const GetRegistrationCallback& callback) override; | |
| 40 void GetTags(int64_t service_worker_registration_id, | |
| 41 const GetTagsCallback& callback) override; | |
| 42 | |
| 43 private: | |
| 44 scoped_refptr<BackgroundFetchContext> background_fetch_context_; | |
| 45 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; | |
| 46 | |
| 47 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchServiceImpl); | |
| 48 }; | |
| 49 | |
| 50 } // namespace content | |
| 51 | |
| 52 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_SERVICE_IMPL_H_ | |
| OLD | NEW |