| 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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 DCHECK(script_context_); | 414 DCHECK(script_context_); |
| 415 script_context_->SkipWaiting(callbacks); | 415 script_context_->SkipWaiting(callbacks); |
| 416 } | 416 } |
| 417 | 417 |
| 418 void EmbeddedWorkerContextClient::claim( | 418 void EmbeddedWorkerContextClient::claim( |
| 419 blink::WebServiceWorkerClientsClaimCallbacks* callbacks) { | 419 blink::WebServiceWorkerClientsClaimCallbacks* callbacks) { |
| 420 DCHECK(script_context_); | 420 DCHECK(script_context_); |
| 421 script_context_->ClaimClients(callbacks); | 421 script_context_->ClaimClients(callbacks); |
| 422 } | 422 } |
| 423 | 423 |
| 424 void EmbeddedWorkerContextClient::stashMessagePort( |
| 425 blink::WebMessagePortChannel* channel, |
| 426 const blink::WebString& name) { |
| 427 DCHECK(script_context_); |
| 428 script_context_->StashMessagePort(channel, name); |
| 429 } |
| 430 |
| 424 void EmbeddedWorkerContextClient::OnMessageToWorker( | 431 void EmbeddedWorkerContextClient::OnMessageToWorker( |
| 425 int thread_id, | 432 int thread_id, |
| 426 int embedded_worker_id, | 433 int embedded_worker_id, |
| 427 const IPC::Message& message) { | 434 const IPC::Message& message) { |
| 428 if (!script_context_) | 435 if (!script_context_) |
| 429 return; | 436 return; |
| 430 DCHECK_EQ(embedded_worker_id_, embedded_worker_id); | 437 DCHECK_EQ(embedded_worker_id_, embedded_worker_id); |
| 431 script_context_->OnMessageReceived(message); | 438 script_context_->OnMessageReceived(message); |
| 432 } | 439 } |
| 433 | 440 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 464 registration->SetWaiting( | 471 registration->SetWaiting( |
| 465 dispatcher->GetServiceWorker(attrs.waiting, false)); | 472 dispatcher->GetServiceWorker(attrs.waiting, false)); |
| 466 registration->SetActive( | 473 registration->SetActive( |
| 467 dispatcher->GetServiceWorker(attrs.active, false)); | 474 dispatcher->GetServiceWorker(attrs.active, false)); |
| 468 | 475 |
| 469 script_context_->SetRegistrationInServiceWorkerGlobalScope( | 476 script_context_->SetRegistrationInServiceWorkerGlobalScope( |
| 470 registration.Pass()); | 477 registration.Pass()); |
| 471 } | 478 } |
| 472 | 479 |
| 473 } // namespace content | 480 } // namespace content |
| OLD | NEW |