Index: Source/modules/serviceworkers/ServiceWorkerContainer.cpp |
diff --git a/Source/modules/serviceworkers/ServiceWorkerContainer.cpp b/Source/modules/serviceworkers/ServiceWorkerContainer.cpp |
index 18c70a8ec0ec9b0261d954757091aa55cd99d39f..4f267bb9f662050552d3e7724c5fdfe9d89295a0 100644 |
--- a/Source/modules/serviceworkers/ServiceWorkerContainer.cpp |
+++ b/Source/modules/serviceworkers/ServiceWorkerContainer.cpp |
@@ -64,6 +64,7 @@ PassRefPtr<ServiceWorkerContainer> ServiceWorkerContainer::create(ExecutionConte |
ServiceWorkerContainer::~ServiceWorkerContainer() |
{ |
+ ASSERT(!m_provider); |
} |
void ServiceWorkerContainer::detachClient() |
@@ -189,17 +190,16 @@ void ServiceWorkerContainer::setController(blink::WebServiceWorker* serviceWorke |
void ServiceWorkerContainer::dispatchMessageEvent(const blink::WebString& message, const blink::WebMessagePortChannelArray& webChannels) |
{ |
- if (!executionContext() || !window()) |
+ if (!executionContext() || !executionContext()->executingWindow()) |
return; |
OwnPtr<MessagePortArray> ports = MessagePort::toMessagePortArray(executionContext(), webChannels); |
RefPtr<SerializedScriptValue> value = SerializedScriptValue::createFromWire(message); |
- window()->dispatchEvent(MessageEvent::create(ports.release(), value)); |
+ executionContext()->executingWindow()->dispatchEvent(MessageEvent::create(ports.release(), value)); |
} |
ServiceWorkerContainer::ServiceWorkerContainer(ExecutionContext* executionContext) |
: ContextLifecycleObserver(executionContext) |
- , DOMWindowLifecycleObserver(executionContext->isDocument() ? toDocument(executionContext)->domWindow() : 0) |
, m_provider(0) |
{ |
ScriptWrappable::init(this); |