| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/embedded_worker_context_client.h" | 5 #include "content/renderer/service_worker/embedded_worker_context_client.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 if (!found) | 422 if (!found) |
| 423 return; // Cannot be associated with a registration in some tests. | 423 return; // Cannot be associated with a registration in some tests. |
| 424 | 424 |
| 425 ServiceWorkerDispatcher* dispatcher = | 425 ServiceWorkerDispatcher* dispatcher = |
| 426 ServiceWorkerDispatcher::GetOrCreateThreadSpecificInstance( | 426 ServiceWorkerDispatcher::GetOrCreateThreadSpecificInstance( |
| 427 thread_safe_sender()); | 427 thread_safe_sender()); |
| 428 | 428 |
| 429 // Register a registration and its version attributes with the dispatcher | 429 // Register a registration and its version attributes with the dispatcher |
| 430 // living on the worker thread. | 430 // living on the worker thread. |
| 431 scoped_ptr<WebServiceWorkerRegistrationImpl> registration( | 431 scoped_ptr<WebServiceWorkerRegistrationImpl> registration( |
| 432 dispatcher->CreateServiceWorkerRegistration(info, false)); | 432 dispatcher->CreateServiceWorkerRegistration( |
| 433 provider_context_->provider_id(), info, false)); |
| 433 registration->SetInstalling( | 434 registration->SetInstalling( |
| 434 dispatcher->GetServiceWorker(attrs.installing, false)); | 435 dispatcher->GetServiceWorker(attrs.installing, false)); |
| 435 registration->SetWaiting( | 436 registration->SetWaiting( |
| 436 dispatcher->GetServiceWorker(attrs.waiting, false)); | 437 dispatcher->GetServiceWorker(attrs.waiting, false)); |
| 437 registration->SetActive( | 438 registration->SetActive( |
| 438 dispatcher->GetServiceWorker(attrs.active, false)); | 439 dispatcher->GetServiceWorker(attrs.active, false)); |
| 439 | 440 |
| 440 script_context_->SetRegistrationInServiceWorkerGlobalScope( | 441 script_context_->SetRegistrationInServiceWorkerGlobalScope( |
| 441 registration.Pass()); | 442 registration.Pass()); |
| 442 } | 443 } |
| 443 | 444 |
| 444 } // namespace content | 445 } // namespace content |
| OLD | NEW |