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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 return; | 199 return; |
200 } | 200 } |
201 m_waiting = ServiceWorker::from(executionContext(), serviceWorker); | 201 m_waiting = ServiceWorker::from(executionContext(), serviceWorker); |
202 } | 202 } |
203 | 203 |
204 void ServiceWorkerContainer::dispatchMessageEvent(const blink::WebString& messag
e, const blink::WebMessagePortChannelArray& webChannels) | 204 void ServiceWorkerContainer::dispatchMessageEvent(const blink::WebString& messag
e, const blink::WebMessagePortChannelArray& webChannels) |
205 { | 205 { |
206 if (!executionContext() || !executionContext()->executingWindow()) | 206 if (!executionContext() || !executionContext()->executingWindow()) |
207 return; | 207 return; |
208 | 208 |
209 OwnPtr<MessagePortArray> ports = MessagePort::toMessagePortArray(executionCo
ntext(), webChannels); | 209 OwnPtrWillBeRawPtr<MessagePortArray> ports = MessagePort::toMessagePortArray
(executionContext(), webChannels); |
210 RefPtr<SerializedScriptValue> value = SerializedScriptValue::createFromWire(
message); | 210 RefPtr<SerializedScriptValue> value = SerializedScriptValue::createFromWire(
message); |
211 executionContext()->executingWindow()->dispatchEvent(MessageEvent::create(po
rts.release(), value)); | 211 executionContext()->executingWindow()->dispatchEvent(MessageEvent::create(po
rts.release(), value)); |
212 } | 212 } |
213 | 213 |
214 ServiceWorkerContainer::ServiceWorkerContainer(ExecutionContext* executionContex
t) | 214 ServiceWorkerContainer::ServiceWorkerContainer(ExecutionContext* executionContex
t) |
215 : ContextLifecycleObserver(executionContext) | 215 : ContextLifecycleObserver(executionContext) |
216 , m_provider(0) | 216 , m_provider(0) |
217 { | 217 { |
218 ScriptWrappable::init(this); | 218 ScriptWrappable::init(this); |
219 | 219 |
220 if (!executionContext) | 220 if (!executionContext) |
221 return; | 221 return; |
222 | 222 |
223 if (ServiceWorkerContainerClient* client = ServiceWorkerContainerClient::fro
m(executionContext)) { | 223 if (ServiceWorkerContainerClient* client = ServiceWorkerContainerClient::fro
m(executionContext)) { |
224 m_provider = client->provider(); | 224 m_provider = client->provider(); |
225 if (m_provider) | 225 if (m_provider) |
226 m_provider->setClient(this); | 226 m_provider->setClient(this); |
227 } | 227 } |
228 } | 228 } |
229 | 229 |
230 } // namespace WebCore | 230 } // namespace WebCore |
OLD | NEW |