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

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

Issue 1344843003: [BackgroundSync] Add browser side support for SyncRegistration.done (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ncn_max
Patch Set: Rebase 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_thread_proxy.cc
diff --git a/content/child/background_sync/background_sync_provider_thread_proxy.cc b/content/child/background_sync/background_sync_provider_thread_proxy.cc
index cc8846cc22df8691cf6e301878bc49bcbf35c199..b3013c484b922429d42a76a193e572f613a34e68 100644
--- a/content/child/background_sync/background_sync_provider_thread_proxy.cc
+++ b/content/child/background_sync/background_sync_provider_thread_proxy.cc
@@ -211,6 +211,20 @@ void BackgroundSyncProviderThreadProxy::releaseRegistration(int64_t handle_id) {
base::Unretained(sync_provider_), handle_id));
}
+void BackgroundSyncProviderThreadProxy::notifyWhenDone(
+ int64_t handle_id,
+ blink::WebSyncNotifyWhenDoneCallbacks* callbacks) {
michaeln 2015/09/17 21:44:12 I'm very wary of the thread affinity all blink::We
jkarlin 2015/09/18 12:03:20 Yes, good catch. chasej@ is making good headway in
michaeln 2015/09/18 19:18:52 Glad to hear that. I hope it helps to establish sa
+ DCHECK(callbacks);
+
+ main_thread_task_runner_->PostTask(
+ FROM_HERE,
+ base::Bind(
+ &BackgroundSyncProvider::notifyWhenDone,
+ base::Unretained(sync_provider_), handle_id,
+ new CallbackThreadAdapter<blink::WebSyncNotifyWhenDoneCallbacks>(
+ make_scoped_ptr(callbacks), WorkerThread::GetCurrentId())));
+}
+
void BackgroundSyncProviderThreadProxy::DuplicateRegistrationHandle(
int64 handle_id,
const BackgroundSyncService::DuplicateRegistrationHandleCallback&

Powered by Google App Engine
This is Rietveld 408576698