| 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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 script_context_->DidHandleNotificationClickEvent(request_id, result); | 327 script_context_->DidHandleNotificationClickEvent(request_id, result); |
| 328 } | 328 } |
| 329 | 329 |
| 330 void EmbeddedWorkerContextClient::didHandlePushEvent( | 330 void EmbeddedWorkerContextClient::didHandlePushEvent( |
| 331 int request_id, | 331 int request_id, |
| 332 blink::WebServiceWorkerEventResult result) { | 332 blink::WebServiceWorkerEventResult result) { |
| 333 DCHECK(script_context_); | 333 DCHECK(script_context_); |
| 334 script_context_->DidHandlePushEvent(request_id, result); | 334 script_context_->DidHandlePushEvent(request_id, result); |
| 335 } | 335 } |
| 336 | 336 |
| 337 // TODO(chasej): crbug.com/486890 - Remove when matching blink changes land |
| 337 void EmbeddedWorkerContextClient::didHandleSyncEvent(int request_id) { | 338 void EmbeddedWorkerContextClient::didHandleSyncEvent(int request_id) { |
| 339 didHandleSyncEvent(request_id, blink::WebServiceWorkerEventResultCompleted); |
| 340 } |
| 341 |
| 342 void EmbeddedWorkerContextClient::didHandleSyncEvent( |
| 343 int request_id, |
| 344 blink::WebServiceWorkerEventResult result) { |
| 338 DCHECK(script_context_); | 345 DCHECK(script_context_); |
| 339 script_context_->DidHandleSyncEvent(request_id); | 346 script_context_->DidHandleSyncEvent(request_id, result); |
| 340 } | 347 } |
| 341 | 348 |
| 342 void EmbeddedWorkerContextClient::didHandleCrossOriginConnectEvent( | 349 void EmbeddedWorkerContextClient::didHandleCrossOriginConnectEvent( |
| 343 int request_id, | 350 int request_id, |
| 344 bool accept_connection) { | 351 bool accept_connection) { |
| 345 DCHECK(script_context_); | 352 DCHECK(script_context_); |
| 346 script_context_->DidHandleCrossOriginConnectEvent(request_id, | 353 script_context_->DidHandleCrossOriginConnectEvent(request_id, |
| 347 accept_connection); | 354 accept_connection); |
| 348 } | 355 } |
| 349 | 356 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 registration->SetWaiting( | 477 registration->SetWaiting( |
| 471 dispatcher->GetServiceWorker(attrs.waiting, false)); | 478 dispatcher->GetServiceWorker(attrs.waiting, false)); |
| 472 registration->SetActive( | 479 registration->SetActive( |
| 473 dispatcher->GetServiceWorker(attrs.active, false)); | 480 dispatcher->GetServiceWorker(attrs.active, false)); |
| 474 | 481 |
| 475 script_context_->SetRegistrationInServiceWorkerGlobalScope( | 482 script_context_->SetRegistrationInServiceWorkerGlobalScope( |
| 476 registration.Pass()); | 483 registration.Pass()); |
| 477 } | 484 } |
| 478 | 485 |
| 479 } // namespace content | 486 } // namespace content |
| OLD | NEW |