| 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/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 DCHECK(script_context_); | 390 DCHECK(script_context_); |
| 391 script_context_->FocusClient(client_id, callback); | 391 script_context_->FocusClient(client_id, callback); |
| 392 } | 392 } |
| 393 | 393 |
| 394 void EmbeddedWorkerContextClient::skipWaiting( | 394 void EmbeddedWorkerContextClient::skipWaiting( |
| 395 blink::WebServiceWorkerSkipWaitingCallbacks* callbacks) { | 395 blink::WebServiceWorkerSkipWaitingCallbacks* callbacks) { |
| 396 DCHECK(script_context_); | 396 DCHECK(script_context_); |
| 397 script_context_->SkipWaiting(callbacks); | 397 script_context_->SkipWaiting(callbacks); |
| 398 } | 398 } |
| 399 | 399 |
| 400 void EmbeddedWorkerContextClient::claim( |
| 401 blink::WebServiceWorkerClientsClaimCallbacks* callbacks) { |
| 402 DCHECK(script_context_); |
| 403 script_context_->ClaimClients(callbacks); |
| 404 } |
| 405 |
| 400 void EmbeddedWorkerContextClient::OnMessageToWorker( | 406 void EmbeddedWorkerContextClient::OnMessageToWorker( |
| 401 int thread_id, | 407 int thread_id, |
| 402 int embedded_worker_id, | 408 int embedded_worker_id, |
| 403 const IPC::Message& message) { | 409 const IPC::Message& message) { |
| 404 if (!script_context_) | 410 if (!script_context_) |
| 405 return; | 411 return; |
| 406 DCHECK_EQ(embedded_worker_id_, embedded_worker_id); | 412 DCHECK_EQ(embedded_worker_id_, embedded_worker_id); |
| 407 script_context_->OnMessageReceived(message); | 413 script_context_->OnMessageReceived(message); |
| 408 } | 414 } |
| 409 | 415 |
| 410 void EmbeddedWorkerContextClient::SendWorkerStarted() { | 416 void EmbeddedWorkerContextClient::SendWorkerStarted() { |
| 411 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); | 417 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); |
| 412 TRACE_EVENT_ASYNC_END0("ServiceWorker", | 418 TRACE_EVENT_ASYNC_END0("ServiceWorker", |
| 413 "EmbeddedWorkerContextClient::StartingWorkerContext", | 419 "EmbeddedWorkerContextClient::StartingWorkerContext", |
| 414 this); | 420 this); |
| 415 Send(new EmbeddedWorkerHostMsg_WorkerStarted(embedded_worker_id_)); | 421 Send(new EmbeddedWorkerHostMsg_WorkerStarted(embedded_worker_id_)); |
| 416 } | 422 } |
| 417 | 423 |
| 418 } // namespace content | 424 } // namespace content |
| OLD | NEW |