Index: content/browser/background_sync/background_sync_service_impl.h |
diff --git a/content/browser/background_sync/background_sync_service_impl.h b/content/browser/background_sync/background_sync_service_impl.h |
index 4f8ab3d4580b2638e8c7d8464d213eb655c5ef34..dbaa91a501c6f22d7a64b5af542740c386a5b85a 100644 |
--- a/content/browser/background_sync/background_sync_service_impl.h |
+++ b/content/browser/background_sync/background_sync_service_impl.h |
@@ -5,9 +5,9 @@ |
#ifndef CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_SERVICE_IMPL_H_ |
#define CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_SERVICE_IMPL_H_ |
-#include <vector> |
- |
+#include "base/id_map.h" |
#include "base/memory/ref_counted.h" |
+#include "base/memory/scoped_vector.h" |
#include "content/browser/background_sync/background_sync_manager.h" |
#include "content/common/background_sync_service.mojom.h" |
#include "third_party/mojo/src/mojo/public/cpp/bindings/binding.h" |
@@ -28,14 +28,12 @@ class CONTENT_EXPORT BackgroundSyncServiceImpl |
private: |
friend class BackgroundSyncServiceImplTest; |
- |
// BackgroundSyncService methods: |
void Register(content::SyncRegistrationPtr options, |
int64_t sw_registration_id, |
const RegisterCallback& callback) override; |
void Unregister(BackgroundSyncPeriodicity periodicity, |
int64_t id, |
michaeln
2015/08/28 02:53:11
int handle_id?
jkarlin
2015/09/02 23:51:41
Done.
|
- const mojo::String& tag, |
int64_t sw_registration_id, |
michaeln
2015/08/28 02:53:11
is sw_registration_id needed, is handle_id not suf
jkarlin
2015/09/02 23:51:41
Acknowledged.
|
const UnregisterCallback& callback) override; |
void GetRegistration(BackgroundSyncPeriodicity periodicity, |
@@ -49,16 +47,21 @@ class CONTENT_EXPORT BackgroundSyncServiceImpl |
BackgroundSyncPeriodicity periodicity, |
int64_t sw_registration_id, |
const GetPermissionStatusCallback& callback) override; |
+ void DuplicateRegistrationHandle( |
+ int64_t handle_id, |
michaeln
2015/08/28 02:53:11
int to match BackgroundSyncRegistrationHandle::Han
jkarlin
2015/09/02 23:51:40
Done.
|
+ int64_t service_worker_registration_id, |
michaeln
2015/08/28 02:53:11
is service_worker_registration_id needed?
jkarlin
2015/09/02 23:51:41
Done.
|
+ const DuplicateRegistrationHandleCallback& callback) override; |
+ void ReleaseRegistration(int64_t handle_id) override; |
void OnRegisterResult(const RegisterCallback& callback, |
BackgroundSyncStatus status, |
- const BackgroundSyncRegistration& result); |
+ scoped_ptr<BackgroundSyncRegistrationHandle> result); |
void OnUnregisterResult(const UnregisterCallback& callback, |
BackgroundSyncStatus status); |
void OnGetRegistrationsResult( |
const GetRegistrationsCallback& callback, |
BackgroundSyncStatus status, |
- const std::vector<BackgroundSyncRegistration>& result); |
+ scoped_ptr<ScopedVector<BackgroundSyncRegistrationHandle>> result); |
// Called when an error is detected on binding_. |
void OnConnectionError(); |
@@ -68,6 +71,9 @@ class CONTENT_EXPORT BackgroundSyncServiceImpl |
mojo::Binding<BackgroundSyncService> binding_; |
+ // The registrations that the client might reference. |
+ IDMap<BackgroundSyncRegistrationHandle, IDMapOwnPointer> active_handles_; |
+ |
base::WeakPtrFactory<BackgroundSyncServiceImpl> weak_ptr_factory_; |
DISALLOW_COPY_AND_ASSIGN(BackgroundSyncServiceImpl); |