| 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 "base/id_map.h" | 8 #include "base/id_map.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 const GetRegistrationsCallback& callback) override; | 46 const GetRegistrationsCallback& callback) override; |
| 47 void GetPermissionStatus( | 47 void GetPermissionStatus( |
| 48 BackgroundSyncPeriodicity periodicity, | 48 BackgroundSyncPeriodicity periodicity, |
| 49 int64_t sw_registration_id, | 49 int64_t sw_registration_id, |
| 50 const GetPermissionStatusCallback& callback) override; | 50 const GetPermissionStatusCallback& callback) override; |
| 51 void DuplicateRegistrationHandle( | 51 void DuplicateRegistrationHandle( |
| 52 BackgroundSyncRegistrationHandle::HandleId handle_id, | 52 BackgroundSyncRegistrationHandle::HandleId handle_id, |
| 53 const DuplicateRegistrationHandleCallback& callback) override; | 53 const DuplicateRegistrationHandleCallback& callback) override; |
| 54 void ReleaseRegistration( | 54 void ReleaseRegistration( |
| 55 BackgroundSyncRegistrationHandle::HandleId handle_id) override; | 55 BackgroundSyncRegistrationHandle::HandleId handle_id) override; |
| 56 void NotifyWhenDone(BackgroundSyncRegistrationHandle::HandleId handle_id, |
| 57 const NotifyWhenDoneCallback& callback) override; |
| 56 | 58 |
| 57 void OnRegisterResult(const RegisterCallback& callback, | 59 void OnRegisterResult(const RegisterCallback& callback, |
| 58 BackgroundSyncStatus status, | 60 BackgroundSyncStatus status, |
| 59 scoped_ptr<BackgroundSyncRegistrationHandle> result); | 61 scoped_ptr<BackgroundSyncRegistrationHandle> result); |
| 60 void OnUnregisterResult(const UnregisterCallback& callback, | 62 void OnUnregisterResult(const UnregisterCallback& callback, |
| 61 BackgroundSyncStatus status); | 63 BackgroundSyncStatus status); |
| 62 void OnGetRegistrationsResult( | 64 void OnGetRegistrationsResult( |
| 63 const GetRegistrationsCallback& callback, | 65 const GetRegistrationsCallback& callback, |
| 64 BackgroundSyncStatus status, | 66 BackgroundSyncStatus status, |
| 65 scoped_ptr<ScopedVector<BackgroundSyncRegistrationHandle>> result); | 67 scoped_ptr<ScopedVector<BackgroundSyncRegistrationHandle>> result); |
| 68 void OnNotifyWhenDoneResult(const NotifyWhenDoneCallback& callback, |
| 69 BackgroundSyncStatus status, |
| 70 BackgroundSyncState sync_state); |
| 66 | 71 |
| 67 // Called when an error is detected on binding_. | 72 // Called when an error is detected on binding_. |
| 68 void OnConnectionError(); | 73 void OnConnectionError(); |
| 69 | 74 |
| 70 // background_sync_context_ owns this. | 75 // background_sync_context_ owns this. |
| 71 BackgroundSyncContextImpl* background_sync_context_; | 76 BackgroundSyncContextImpl* background_sync_context_; |
| 72 | 77 |
| 73 mojo::Binding<BackgroundSyncService> binding_; | 78 mojo::Binding<BackgroundSyncService> binding_; |
| 74 | 79 |
| 75 // The registrations that the client might reference. | 80 // The registrations that the client might reference. |
| 76 IDMap<BackgroundSyncRegistrationHandle, IDMapOwnPointer> active_handles_; | 81 IDMap<BackgroundSyncRegistrationHandle, IDMapOwnPointer> active_handles_; |
| 77 | 82 |
| 78 base::WeakPtrFactory<BackgroundSyncServiceImpl> weak_ptr_factory_; | 83 base::WeakPtrFactory<BackgroundSyncServiceImpl> weak_ptr_factory_; |
| 79 | 84 |
| 80 DISALLOW_COPY_AND_ASSIGN(BackgroundSyncServiceImpl); | 85 DISALLOW_COPY_AND_ASSIGN(BackgroundSyncServiceImpl); |
| 81 }; | 86 }; |
| 82 | 87 |
| 83 } // namespace content | 88 } // namespace content |
| 84 | 89 |
| 85 #endif // CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_SERVICE_IMPL_H_ | 90 #endif // CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_SERVICE_IMPL_H_ |
| OLD | NEW |