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/service_worker/service_worker_context_client.h" | 5 #include "content/renderer/service_worker/service_worker_context_client.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 ServiceWorkerVersionAttributes version_attrs; | 366 ServiceWorkerVersionAttributes version_attrs; |
367 provider_context_->GetAssociatedRegistration(®istration_info, | 367 provider_context_->GetAssociatedRegistration(®istration_info, |
368 &version_attrs); | 368 &version_attrs); |
369 DCHECK_NE(registration_info.registration_id, | 369 DCHECK_NE(registration_info.registration_id, |
370 kInvalidServiceWorkerRegistrationId); | 370 kInvalidServiceWorkerRegistrationId); |
371 | 371 |
372 // Register Mojo services. | 372 // Register Mojo services. |
373 context_->service_registry.ServiceRegistry::AddService( | 373 context_->service_registry.ServiceRegistry::AddService( |
374 base::Bind(&ServicePortDispatcherImpl::Create, | 374 base::Bind(&ServicePortDispatcherImpl::Create, |
375 context_->proxy_weak_factory.GetWeakPtr())); | 375 context_->proxy_weak_factory.GetWeakPtr())); |
376 context_->service_registry.ServiceRegistry::AddService(base::Bind( | 376 context_->service_registry.ServiceRegistry::AddService( |
377 &BackgroundSyncClientImpl::Create, registration_info.registration_id)); | 377 base::Bind(&BackgroundSyncClientImpl::Create)); |
378 | 378 |
379 SetRegistrationInServiceWorkerGlobalScope(registration_info, version_attrs); | 379 SetRegistrationInServiceWorkerGlobalScope(registration_info, version_attrs); |
380 | 380 |
381 Send(new EmbeddedWorkerHostMsg_WorkerThreadStarted( | 381 Send(new EmbeddedWorkerHostMsg_WorkerThreadStarted( |
382 embedded_worker_id_, WorkerThread::GetCurrentId(), | 382 embedded_worker_id_, WorkerThread::GetCurrentId(), |
383 provider_context_->provider_id())); | 383 provider_context_->provider_id())); |
384 | 384 |
385 TRACE_EVENT_ASYNC_STEP_INTO0( | 385 TRACE_EVENT_ASYNC_STEP_INTO0( |
386 "ServiceWorker", | 386 "ServiceWorker", |
387 "ServiceWorkerContextClient::StartingWorkerContext", | 387 "ServiceWorkerContextClient::StartingWorkerContext", |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
985 } | 985 } |
986 | 986 |
987 base::WeakPtr<ServiceWorkerContextClient> | 987 base::WeakPtr<ServiceWorkerContextClient> |
988 ServiceWorkerContextClient::GetWeakPtr() { | 988 ServiceWorkerContextClient::GetWeakPtr() { |
989 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); | 989 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); |
990 DCHECK(context_); | 990 DCHECK(context_); |
991 return context_->weak_factory.GetWeakPtr(); | 991 return context_->weak_factory.GetWeakPtr(); |
992 } | 992 } |
993 | 993 |
994 } // namespace content | 994 } // namespace content |
OLD | NEW |