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

Side by Side Diff: content/renderer/background_sync/background_sync_client_impl.cc

Issue 1220943003: [Background Sync] Use Mojo IPC to fire background sync events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mek
Patch Set: Addressing post-lgtm review comments Created 5 years, 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/renderer/background_sync/background_sync_client_impl.h"
6
7 #include "content/renderer/service_worker/service_worker_context_client.h"
8
9 namespace content {
10
11 // static
12 void BackgroundSyncClientImpl::Create(
13 mojo::InterfaceRequest<BackgroundSyncServiceClient> request) {
14 new BackgroundSyncClientImpl(request.Pass());
15 }
16
17 BackgroundSyncClientImpl::~BackgroundSyncClientImpl() {}
18
19 BackgroundSyncClientImpl::BackgroundSyncClientImpl(
20 mojo::InterfaceRequest<BackgroundSyncServiceClient> request)
21 : binding_(this, request.Pass()) {}
22
23 void BackgroundSyncClientImpl::Sync(content::SyncRegistrationPtr registration,
24 const SyncCallback& callback) {
25 ServiceWorkerContextClient* client =
26 ServiceWorkerContextClient::ThreadSpecificInstance();
27 if (!client) {
28 callback.Run(SERVICE_WORKER_EVENT_STATUS_ABORTED);
29 return;
30 }
31 client->DispatchSyncEvent(callback);
32 }
33
34 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698