| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 dispatchEvent(Event::create(EventTypeNames::controllerchange)); | 372 dispatchEvent(Event::create(EventTypeNames::controllerchange)); |
| 373 } | 373 } |
| 374 | 374 |
| 375 void ServiceWorkerContainer::dispatchMessageEvent(WebServiceWorker* serviceWorke
r, const WebString& message, const WebMessagePortChannelArray& webChannels) | 375 void ServiceWorkerContainer::dispatchMessageEvent(WebServiceWorker* serviceWorke
r, const WebString& message, const WebMessagePortChannelArray& webChannels) |
| 376 { | 376 { |
| 377 if (!executionContext() || !executionContext()->executingWindow()) | 377 if (!executionContext() || !executionContext()->executingWindow()) |
| 378 return; | 378 return; |
| 379 | 379 |
| 380 MessagePortArray* ports = MessagePort::toMessagePortArray(executionContext()
, webChannels); | 380 MessagePortArray* ports = MessagePort::toMessagePortArray(executionContext()
, webChannels); |
| 381 RefPtr<SerializedScriptValue> value = SerializedScriptValueFactory::instance
().createFromWire(message); | 381 RefPtr<SerializedScriptValue> value = SerializedScriptValueFactory::instance
().createFromWire(message); |
| 382 RefPtrWillBeRawPtr<ServiceWorker> source = ServiceWorker::from(executionCont
ext(), serviceWorker); | 382 ServiceWorker* source = ServiceWorker::from(executionContext(), serviceWorke
r); |
| 383 dispatchEvent(ServiceWorkerMessageEvent::create(ports, value, source, execut
ionContext()->securityOrigin()->toString())); | 383 dispatchEvent(ServiceWorkerMessageEvent::create(ports, value, source, execut
ionContext()->securityOrigin()->toString())); |
| 384 } | 384 } |
| 385 | 385 |
| 386 const AtomicString& ServiceWorkerContainer::interfaceName() const | 386 const AtomicString& ServiceWorkerContainer::interfaceName() const |
| 387 { | 387 { |
| 388 return EventTargetNames::ServiceWorkerContainer; | 388 return EventTargetNames::ServiceWorkerContainer; |
| 389 } | 389 } |
| 390 | 390 |
| 391 ServiceWorkerContainer::ServiceWorkerContainer(ExecutionContext* executionContex
t) | 391 ServiceWorkerContainer::ServiceWorkerContainer(ExecutionContext* executionContex
t) |
| 392 : ContextLifecycleObserver(executionContext) | 392 : ContextLifecycleObserver(executionContext) |
| 393 , m_provider(0) | 393 , m_provider(0) |
| 394 { | 394 { |
| 395 | 395 |
| 396 if (!executionContext) | 396 if (!executionContext) |
| 397 return; | 397 return; |
| 398 | 398 |
| 399 if (ServiceWorkerContainerClient* client = ServiceWorkerContainerClient::fro
m(executionContext)) { | 399 if (ServiceWorkerContainerClient* client = ServiceWorkerContainerClient::fro
m(executionContext)) { |
| 400 m_provider = client->provider(); | 400 m_provider = client->provider(); |
| 401 if (m_provider) | 401 if (m_provider) |
| 402 m_provider->setClient(this); | 402 m_provider->setClient(this); |
| 403 } | 403 } |
| 404 } | 404 } |
| 405 | 405 |
| 406 } // namespace blink | 406 } // namespace blink |
| OLD | NEW |