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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 void EmbeddedWorkerContextClient::didPauseAfterDownload() { | 146 void EmbeddedWorkerContextClient::didPauseAfterDownload() { |
147 Send(new EmbeddedWorkerHostMsg_DidPauseAfterDownload(embedded_worker_id_)); | 147 Send(new EmbeddedWorkerHostMsg_DidPauseAfterDownload(embedded_worker_id_)); |
148 } | 148 } |
149 | 149 |
150 void EmbeddedWorkerContextClient::getClients( | 150 void EmbeddedWorkerContextClient::getClients( |
151 blink::WebServiceWorkerClientsCallbacks* callbacks) { | 151 blink::WebServiceWorkerClientsCallbacks* callbacks) { |
152 DCHECK(script_context_); | 152 DCHECK(script_context_); |
153 script_context_->GetClientDocuments(callbacks); | 153 script_context_->GetClientDocuments(callbacks); |
154 } | 154 } |
155 | 155 |
| 156 void EmbeddedWorkerContextClient::openWindow( |
| 157 const blink::WebURL& url, |
| 158 blink::WebServiceWorkerClientCallbacks* callbacks) { |
| 159 DCHECK(script_context_); |
| 160 script_context_->OpenWindow(url, callbacks); |
| 161 } |
| 162 |
156 void EmbeddedWorkerContextClient::workerReadyForInspection() { | 163 void EmbeddedWorkerContextClient::workerReadyForInspection() { |
157 Send(new EmbeddedWorkerHostMsg_WorkerReadyForInspection(embedded_worker_id_)); | 164 Send(new EmbeddedWorkerHostMsg_WorkerReadyForInspection(embedded_worker_id_)); |
158 } | 165 } |
159 | 166 |
160 void EmbeddedWorkerContextClient::workerContextFailedToStart() { | 167 void EmbeddedWorkerContextClient::workerContextFailedToStart() { |
161 DCHECK(main_thread_proxy_->RunsTasksOnCurrentThread()); | 168 DCHECK(main_thread_proxy_->RunsTasksOnCurrentThread()); |
162 DCHECK(!script_context_); | 169 DCHECK(!script_context_); |
163 | 170 |
164 Send(new EmbeddedWorkerHostMsg_WorkerScriptLoadFailed(embedded_worker_id_)); | 171 Send(new EmbeddedWorkerHostMsg_WorkerScriptLoadFailed(embedded_worker_id_)); |
165 | 172 |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 registration->SetWaiting( | 448 registration->SetWaiting( |
442 dispatcher->GetServiceWorker(attrs.waiting, false)); | 449 dispatcher->GetServiceWorker(attrs.waiting, false)); |
443 registration->SetActive( | 450 registration->SetActive( |
444 dispatcher->GetServiceWorker(attrs.active, false)); | 451 dispatcher->GetServiceWorker(attrs.active, false)); |
445 | 452 |
446 script_context_->SetRegistrationInServiceWorkerGlobalScope( | 453 script_context_->SetRegistrationInServiceWorkerGlobalScope( |
447 registration.Pass()); | 454 registration.Pass()); |
448 } | 455 } |
449 | 456 |
450 } // namespace content | 457 } // namespace content |
OLD | NEW |