OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/background_sync/background_sync_client_impl.h" | 5 #include "content/renderer/background_sync/background_sync_client_impl.h" |
6 | 6 |
7 #include "content/child/background_sync/background_sync_provider.h" | 7 #include "content/child/background_sync/background_sync_provider.h" |
8 #include "content/child/background_sync/background_sync_type_converters.h" | 8 #include "content/child/background_sync/background_sync_type_converters.h" |
9 #include "content/renderer/service_worker/service_worker_context_client.h" | 9 #include "content/renderer/service_worker/service_worker_context_client.h" |
10 #include "third_party/WebKit/public/platform/Platform.h" | 10 #include "third_party/WebKit/public/platform/Platform.h" |
11 #include "third_party/WebKit/public/platform/WebThread.h" | 11 #include "third_party/WebKit/public/platform/WebThread.h" |
12 #include "third_party/WebKit/public/platform/modules/background_sync/WebSyncProv
ider.h" | 12 #include "third_party/WebKit/public/platform/modules/background_sync/WebSyncProv
ider.h" |
13 #include "third_party/WebKit/public/platform/modules/background_sync/WebSyncRegi
stration.h" | 13 #include "third_party/WebKit/public/platform/modules/background_sync/WebSyncRegi
stration.h" |
14 #include "third_party/WebKit/public/web/modules/serviceworker/WebServiceWorkerCo
ntextProxy.h" | 14 #include "third_party/WebKit/public/web/modules/serviceworker/WebServiceWorkerCo
ntextProxy.h" |
15 | 15 |
16 namespace content { | 16 namespace content { |
17 | 17 |
18 // static | 18 // static |
19 void BackgroundSyncClientImpl::Create( | 19 void BackgroundSyncClientImpl::Create( |
20 int64 service_worker_registration_id, | 20 int64_t service_worker_registration_id, |
21 mojo::InterfaceRequest<BackgroundSyncServiceClient> request) { | 21 mojo::InterfaceRequest<BackgroundSyncServiceClient> request) { |
22 new BackgroundSyncClientImpl(service_worker_registration_id, request.Pass()); | 22 new BackgroundSyncClientImpl(service_worker_registration_id, request.Pass()); |
23 } | 23 } |
24 | 24 |
25 BackgroundSyncClientImpl::~BackgroundSyncClientImpl() {} | 25 BackgroundSyncClientImpl::~BackgroundSyncClientImpl() {} |
26 | 26 |
27 BackgroundSyncClientImpl::BackgroundSyncClientImpl( | 27 BackgroundSyncClientImpl::BackgroundSyncClientImpl( |
28 int64 service_worker_registration_id, | 28 int64_t service_worker_registration_id, |
29 mojo::InterfaceRequest<BackgroundSyncServiceClient> request) | 29 mojo::InterfaceRequest<BackgroundSyncServiceClient> request) |
30 : service_worker_registration_id_(service_worker_registration_id), | 30 : service_worker_registration_id_(service_worker_registration_id), |
31 binding_(this, request.Pass()), | 31 binding_(this, request.Pass()), |
32 callback_seq_num_(0) {} | 32 callback_seq_num_(0) {} |
33 | 33 |
34 void BackgroundSyncClientImpl::Sync( | 34 void BackgroundSyncClientImpl::Sync( |
35 int64_t handle_id, | 35 int64_t handle_id, |
36 content::BackgroundSyncEventLastChance last_chance, | 36 content::BackgroundSyncEventLastChance last_chance, |
37 const SyncCallback& callback) { | 37 const SyncCallback& callback) { |
38 DCHECK(!blink::Platform::current()->mainThread()->isCurrentThread()); | 38 DCHECK(!blink::Platform::current()->mainThread()->isCurrentThread()); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 mojo::ConvertTo<scoped_ptr<blink::WebSyncRegistration>>(registration); | 88 mojo::ConvertTo<scoped_ptr<blink::WebSyncRegistration>>(registration); |
89 | 89 |
90 blink::WebServiceWorkerContextProxy::LastChanceOption web_last_chance = | 90 blink::WebServiceWorkerContextProxy::LastChanceOption web_last_chance = |
91 mojo::ConvertTo<blink::WebServiceWorkerContextProxy::LastChanceOption>( | 91 mojo::ConvertTo<blink::WebServiceWorkerContextProxy::LastChanceOption>( |
92 last_chance); | 92 last_chance); |
93 | 93 |
94 client->DispatchSyncEvent(*web_registration, web_last_chance, callback); | 94 client->DispatchSyncEvent(*web_registration, web_last_chance, callback); |
95 } | 95 } |
96 | 96 |
97 } // namespace content | 97 } // namespace content |
OLD | NEW |