| 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 a5ecf2f8b9513ee02e9a6e7f65f90b40cd385c25..a556a5417b1cb5be8699e86dce21a2b2ffef33ac 100644
|
| --- a/content/child/background_sync/background_sync_provider_thread_proxy.cc
|
| +++ b/content/child/background_sync/background_sync_provider_thread_proxy.cc
|
| @@ -75,6 +75,24 @@ class CallbackThreadAdapter : public WebCallbacksMatcher<X>::WebCallbacks {
|
| LazyInstance<ThreadLocalPointer<BackgroundSyncProviderThreadProxy>>::Leaky
|
| g_sync_provider_tls = LAZY_INSTANCE_INITIALIZER;
|
|
|
| +void DuplicateRegistrationHandleCallbackOnSWThread(
|
| + const BackgroundSyncService::DuplicateRegistrationHandleCallback& callback,
|
| + BackgroundSyncError error,
|
| + SyncRegistrationPtr registration) {
|
| + callback.Run(error, registration.Pass());
|
| +}
|
| +
|
| +void DuplicateRegistrationHandleCallbackOnMainThread(
|
| + int worker_thread_id,
|
| + const BackgroundSyncService::DuplicateRegistrationHandleCallback& callback,
|
| + BackgroundSyncError error,
|
| + SyncRegistrationPtr registration) {
|
| + WorkerTaskRunner::Instance()->PostTask(
|
| + worker_thread_id,
|
| + base::Bind(&DuplicateRegistrationHandleCallbackOnSWThread, callback,
|
| + error, base::Passed(registration.Pass())));
|
| +}
|
| +
|
| } // anonymous namespace
|
|
|
| // static
|
| @@ -189,6 +207,27 @@ void BackgroundSyncProviderThreadProxy::getPermissionStatus(
|
| WorkerTaskRunner::Instance()->CurrentWorkerId())));
|
| }
|
|
|
| +void BackgroundSyncProviderThreadProxy::releaseRegistration(int64_t handle_id) {
|
| + main_thread_task_runner_->PostTask(
|
| + FROM_HERE, base::Bind(&BackgroundSyncProvider::releaseRegistration,
|
| + base::Unretained(sync_provider_), handle_id));
|
| +}
|
| +
|
| +void BackgroundSyncProviderThreadProxy::DuplicateRegistrationHandle(
|
| + int64 handle_id,
|
| + int64 service_worker_registration_id,
|
| + const BackgroundSyncService::DuplicateRegistrationHandleCallback&
|
| + callback) {
|
| + main_thread_task_runner_->PostTask(
|
| + FROM_HERE,
|
| + base::Bind(&BackgroundSyncProvider::DuplicateRegistrationHandle,
|
| + base::Unretained(sync_provider_), handle_id,
|
| + service_worker_registration_id,
|
| + base::Bind(&DuplicateRegistrationHandleCallbackOnMainThread,
|
| + WorkerTaskRunner::Instance()->CurrentWorkerId(),
|
| + callback)));
|
| +}
|
| +
|
| void BackgroundSyncProviderThreadProxy::OnWorkerRunLoopStopped() {
|
| delete this;
|
| }
|
|
|