| 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 script_context_->GetClientDocuments(callbacks); | 155 script_context_->GetClientDocuments(callbacks); |
| 156 } | 156 } |
| 157 | 157 |
| 158 void EmbeddedWorkerContextClient::openWindow( | 158 void EmbeddedWorkerContextClient::openWindow( |
| 159 const blink::WebURL& url, | 159 const blink::WebURL& url, |
| 160 blink::WebServiceWorkerClientCallbacks* callbacks) { | 160 blink::WebServiceWorkerClientCallbacks* callbacks) { |
| 161 DCHECK(script_context_); | 161 DCHECK(script_context_); |
| 162 script_context_->OpenWindow(url, callbacks); | 162 script_context_->OpenWindow(url, callbacks); |
| 163 } | 163 } |
| 164 | 164 |
| 165 void EmbeddedWorkerContextClient::setCachedMetadata(const blink::WebURL& url, |
| 166 const char* data, |
| 167 size_t size) { |
| 168 DCHECK(script_context_); |
| 169 script_context_->setCachedMetadata(url, data, size); |
| 170 } |
| 171 |
| 172 void EmbeddedWorkerContextClient::clearCachedMetadata( |
| 173 const blink::WebURL& url) { |
| 174 DCHECK(script_context_); |
| 175 script_context_->clearCachedMetadata(url); |
| 176 } |
| 177 |
| 165 void EmbeddedWorkerContextClient::workerReadyForInspection() { | 178 void EmbeddedWorkerContextClient::workerReadyForInspection() { |
| 166 Send(new EmbeddedWorkerHostMsg_WorkerReadyForInspection(embedded_worker_id_)); | 179 Send(new EmbeddedWorkerHostMsg_WorkerReadyForInspection(embedded_worker_id_)); |
| 167 } | 180 } |
| 168 | 181 |
| 169 void EmbeddedWorkerContextClient::workerContextFailedToStart() { | 182 void EmbeddedWorkerContextClient::workerContextFailedToStart() { |
| 170 DCHECK(main_thread_proxy_->RunsTasksOnCurrentThread()); | 183 DCHECK(main_thread_proxy_->RunsTasksOnCurrentThread()); |
| 171 DCHECK(!script_context_); | 184 DCHECK(!script_context_); |
| 172 | 185 |
| 173 Send(new EmbeddedWorkerHostMsg_WorkerScriptLoadFailed(embedded_worker_id_)); | 186 Send(new EmbeddedWorkerHostMsg_WorkerScriptLoadFailed(embedded_worker_id_)); |
| 174 | 187 |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 registration->SetWaiting( | 467 registration->SetWaiting( |
| 455 dispatcher->GetServiceWorker(attrs.waiting, false)); | 468 dispatcher->GetServiceWorker(attrs.waiting, false)); |
| 456 registration->SetActive( | 469 registration->SetActive( |
| 457 dispatcher->GetServiceWorker(attrs.active, false)); | 470 dispatcher->GetServiceWorker(attrs.active, false)); |
| 458 | 471 |
| 459 script_context_->SetRegistrationInServiceWorkerGlobalScope( | 472 script_context_->SetRegistrationInServiceWorkerGlobalScope( |
| 460 registration.Pass()); | 473 registration.Pass()); |
| 461 } | 474 } |
| 462 | 475 |
| 463 } // namespace content | 476 } // namespace content |
| OLD | NEW |