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..9a764850b09b7ad36278d9854d03ff3053f092e4 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, |
- const mojo::String& tag, |
int64_t sw_registration_id, |
const UnregisterCallback& callback) override; |
void GetRegistration(BackgroundSyncPeriodicity periodicity, |
@@ -49,16 +47,18 @@ class CONTENT_EXPORT BackgroundSyncServiceImpl |
BackgroundSyncPeriodicity periodicity, |
int64_t sw_registration_id, |
const GetPermissionStatusCallback& callback) override; |
+ void TrackRegistration(SyncRegistrationPtr sync_registration) override; |
+ void ReleaseRegistration(int64_t sync_id) override; |
void OnRegisterResult(const RegisterCallback& callback, |
BackgroundSyncStatus status, |
- const BackgroundSyncRegistration& result); |
+ scoped_ptr<ClientBackgroundSyncRegistration> result); |
void OnUnregisterResult(const UnregisterCallback& callback, |
BackgroundSyncStatus status); |
void OnGetRegistrationsResult( |
const GetRegistrationsCallback& callback, |
BackgroundSyncStatus status, |
- const std::vector<BackgroundSyncRegistration>& result); |
+ scoped_ptr<ScopedVector<ClientBackgroundSyncRegistration>> result); |
// Called when an error is detected on binding_. |
void OnConnectionError(); |
@@ -68,6 +68,10 @@ class CONTENT_EXPORT BackgroundSyncServiceImpl |
mojo::Binding<BackgroundSyncService> binding_; |
+ // The registrations that the client might reference. |
+ IDMap<ClientBackgroundSyncRegistration, IDMapOwnPointer> |
+ hosted_registrations_; |
+ |
base::WeakPtrFactory<BackgroundSyncServiceImpl> weak_ptr_factory_; |
DISALLOW_COPY_AND_ASSIGN(BackgroundSyncServiceImpl); |