Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Unified Diff: content/child/background_sync/background_sync_provider.cc

Issue 1282013004: BackgroundSyncManager tracks client registrations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed test Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/child/background_sync/background_sync_provider.cc
diff --git a/content/child/background_sync/background_sync_provider.cc b/content/child/background_sync/background_sync_provider.cc
index 277e1a7b9962af245023ec58747ef56fcd49d0d7..28ebdf33293d621e8a0f05625a434ab4771342c2 100644
--- a/content/child/background_sync/background_sync_provider.cc
+++ b/content/child/background_sync/background_sync_provider.cc
@@ -61,7 +61,7 @@ void BackgroundSyncProvider::registerBackgroundSync(
void BackgroundSyncProvider::unregisterBackgroundSync(
blink::WebSyncRegistration::Periodicity periodicity,
- int64_t id,
+ int64_t handle_id,
const blink::WebString& tag,
blink::WebServiceWorkerRegistration* service_worker_registration,
blink::WebSyncUnregistrationCallbacks* callbacks) {
@@ -74,7 +74,7 @@ void BackgroundSyncProvider::unregisterBackgroundSync(
// base::Unretained is safe here, as the mojo channel will be deleted (and
// will wipe its callbacks) before 'this' is deleted.
GetBackgroundSyncServicePtr()->Unregister(
- mojo::ConvertTo<BackgroundSyncPeriodicity>(periodicity), id, tag.utf8(),
+ mojo::ConvertTo<BackgroundSyncPeriodicity>(periodicity), handle_id,
service_worker_registration_id,
base::Bind(&BackgroundSyncProvider::UnregisterCallback,
base::Unretained(this), base::Passed(callbacksPtr.Pass())));
@@ -139,6 +139,18 @@ void BackgroundSyncProvider::getPermissionStatus(
base::Unretained(this), base::Passed(callbacksPtr.Pass())));
}
+void BackgroundSyncProvider::releaseRegistration(int64_t handle_id) {
+ GetBackgroundSyncServicePtr()->ReleaseRegistration(handle_id);
+}
+
+void BackgroundSyncProvider::DuplicateRegistrationHandle(
+ int handle_id,
+ const BackgroundSyncService::DuplicateRegistrationHandleCallback&
+ callback) {
+ GetBackgroundSyncServicePtr()->DuplicateRegistrationHandle(handle_id,
+ callback);
+}
+
void BackgroundSyncProvider::RegisterCallback(
scoped_ptr<blink::WebSyncRegistrationCallbacks> callbacks,
BackgroundSyncError error,

Powered by Google App Engine
This is Rietveld 408576698