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/child/background_sync/background_sync_provider.h" | 5 #include "content/child/background_sync/background_sync_provider.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 18 matching lines...) Expand all Loading... |
29 // is only available on the implementation of the interface. | 29 // is only available on the implementation of the interface. |
30 int64_t GetServiceWorkerRegistrationId( | 30 int64_t GetServiceWorkerRegistrationId( |
31 blink::WebServiceWorkerRegistration* service_worker_registration) { | 31 blink::WebServiceWorkerRegistration* service_worker_registration) { |
32 return static_cast<WebServiceWorkerRegistrationImpl*>( | 32 return static_cast<WebServiceWorkerRegistrationImpl*>( |
33 service_worker_registration)->registration_id(); | 33 service_worker_registration)->registration_id(); |
34 } | 34 } |
35 | 35 |
36 void ConnectToServiceOnMainThread( | 36 void ConnectToServiceOnMainThread( |
37 blink::mojom::BackgroundSyncServiceRequest request) { | 37 blink::mojom::BackgroundSyncServiceRequest request) { |
38 DCHECK(ChildThreadImpl::current()); | 38 DCHECK(ChildThreadImpl::current()); |
39 ChildThreadImpl::current()->remote_interfaces()->GetInterface( | 39 ChildThreadImpl::current()->GetRemoteInterfaces()->GetInterface( |
40 std::move(request)); | 40 std::move(request)); |
41 } | 41 } |
42 | 42 |
43 LazyInstance<ThreadLocalPointer<BackgroundSyncProvider>>::Leaky | 43 LazyInstance<ThreadLocalPointer<BackgroundSyncProvider>>::Leaky |
44 g_sync_provider_tls = LAZY_INSTANCE_INITIALIZER; | 44 g_sync_provider_tls = LAZY_INSTANCE_INITIALIZER; |
45 | 45 |
46 } // namespace | 46 } // namespace |
47 | 47 |
48 BackgroundSyncProvider::BackgroundSyncProvider( | 48 BackgroundSyncProvider::BackgroundSyncProvider( |
49 const scoped_refptr<base::SingleThreadTaskRunner> main_task_runner) | 49 const scoped_refptr<base::SingleThreadTaskRunner> main_task_runner) |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 mojo::InterfaceRequest<blink::mojom::BackgroundSyncService> request = | 212 mojo::InterfaceRequest<blink::mojom::BackgroundSyncService> request = |
213 mojo::GetProxy(&background_sync_service_); | 213 mojo::GetProxy(&background_sync_service_); |
214 main_thread_task_runner_->PostTask( | 214 main_thread_task_runner_->PostTask( |
215 FROM_HERE, | 215 FROM_HERE, |
216 base::Bind(&ConnectToServiceOnMainThread, base::Passed(&request))); | 216 base::Bind(&ConnectToServiceOnMainThread, base::Passed(&request))); |
217 } | 217 } |
218 return background_sync_service_; | 218 return background_sync_service_; |
219 } | 219 } |
220 | 220 |
221 } // namespace content | 221 } // namespace content |
OLD | NEW |