OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_SYNC_BACKGROUND_SYNC_SERVICE_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_SERVICE_IMPL_H_ |
6 #define CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_SERVICE_IMPL_H_ | 6 #define CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_SERVICE_IMPL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
| 10 #include <memory> |
| 11 #include <vector> |
| 12 |
10 #include "base/id_map.h" | 13 #include "base/id_map.h" |
11 #include "base/macros.h" | 14 #include "base/macros.h" |
12 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
13 #include "base/memory/scoped_vector.h" | |
14 #include "content/browser/background_sync/background_sync_manager.h" | 16 #include "content/browser/background_sync/background_sync_manager.h" |
15 #include "mojo/public/cpp/bindings/binding.h" | 17 #include "mojo/public/cpp/bindings/binding.h" |
16 #include "third_party/WebKit/public/platform/modules/background_sync/background_
sync.mojom.h" | 18 #include "third_party/WebKit/public/platform/modules/background_sync/background_
sync.mojom.h" |
17 | 19 |
18 namespace content { | 20 namespace content { |
19 | 21 |
20 class BackgroundSyncContext; | 22 class BackgroundSyncContext; |
21 | 23 |
22 class CONTENT_EXPORT BackgroundSyncServiceImpl | 24 class CONTENT_EXPORT BackgroundSyncServiceImpl |
23 : public NON_EXPORTED_BASE(blink::mojom::BackgroundSyncService) { | 25 : public NON_EXPORTED_BASE(blink::mojom::BackgroundSyncService) { |
(...skipping 13 matching lines...) Expand all Loading... |
37 const RegisterCallback& callback) override; | 39 const RegisterCallback& callback) override; |
38 void GetRegistrations(int64_t sw_registration_id, | 40 void GetRegistrations(int64_t sw_registration_id, |
39 const GetRegistrationsCallback& callback) override; | 41 const GetRegistrationsCallback& callback) override; |
40 | 42 |
41 void OnRegisterResult(const RegisterCallback& callback, | 43 void OnRegisterResult(const RegisterCallback& callback, |
42 BackgroundSyncStatus status, | 44 BackgroundSyncStatus status, |
43 std::unique_ptr<BackgroundSyncRegistration> result); | 45 std::unique_ptr<BackgroundSyncRegistration> result); |
44 void OnGetRegistrationsResult( | 46 void OnGetRegistrationsResult( |
45 const GetRegistrationsCallback& callback, | 47 const GetRegistrationsCallback& callback, |
46 BackgroundSyncStatus status, | 48 BackgroundSyncStatus status, |
47 std::unique_ptr<ScopedVector<BackgroundSyncRegistration>> result); | 49 std::unique_ptr<std::vector<std::unique_ptr<BackgroundSyncRegistration>>> |
| 50 result); |
48 | 51 |
49 // Called when an error is detected on binding_. | 52 // Called when an error is detected on binding_. |
50 void OnConnectionError(); | 53 void OnConnectionError(); |
51 | 54 |
52 // background_sync_context_ owns this. | 55 // background_sync_context_ owns this. |
53 BackgroundSyncContext* background_sync_context_; | 56 BackgroundSyncContext* background_sync_context_; |
54 | 57 |
55 mojo::Binding<blink::mojom::BackgroundSyncService> binding_; | 58 mojo::Binding<blink::mojom::BackgroundSyncService> binding_; |
56 | 59 |
57 base::WeakPtrFactory<BackgroundSyncServiceImpl> weak_ptr_factory_; | 60 base::WeakPtrFactory<BackgroundSyncServiceImpl> weak_ptr_factory_; |
58 | 61 |
59 DISALLOW_COPY_AND_ASSIGN(BackgroundSyncServiceImpl); | 62 DISALLOW_COPY_AND_ASSIGN(BackgroundSyncServiceImpl); |
60 }; | 63 }; |
61 | 64 |
62 } // namespace content | 65 } // namespace content |
63 | 66 |
64 #endif // CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_SERVICE_IMPL_H_ | 67 #endif // CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_SERVICE_IMPL_H_ |
OLD | NEW |