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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 RefPtr<RespondWithObserver> observer = RespondWithObserver::create(m_workerG
lobalScope, eventID); | 85 RefPtr<RespondWithObserver> observer = RespondWithObserver::create(m_workerG
lobalScope, eventID); |
86 RefPtr<Request> request = Request::create(webRequest); | 86 RefPtr<Request> request = Request::create(webRequest); |
87 m_workerGlobalScope->dispatchEvent(FetchEvent::create(observer, request)); | 87 m_workerGlobalScope->dispatchEvent(FetchEvent::create(observer, request)); |
88 observer->didDispatchEvent(); | 88 observer->didDispatchEvent(); |
89 } | 89 } |
90 | 90 |
91 void ServiceWorkerGlobalScopeProxy::dispatchMessageEvent(const WebString& messag
e, const WebMessagePortChannelArray& webChannels) | 91 void ServiceWorkerGlobalScopeProxy::dispatchMessageEvent(const WebString& messag
e, const WebMessagePortChannelArray& webChannels) |
92 { | 92 { |
93 ASSERT(m_workerGlobalScope); | 93 ASSERT(m_workerGlobalScope); |
94 | 94 |
95 OwnPtr<MessagePortArray> ports = MessagePort::toMessagePortArray(m_workerGlo
balScope, webChannels); | 95 OwnPtrWillBeRawPtr<MessagePortArray> ports = MessagePort::toMessagePortArray
(m_workerGlobalScope, webChannels); |
96 WebSerializedScriptValue value = WebSerializedScriptValue::fromString(messag
e); | 96 WebSerializedScriptValue value = WebSerializedScriptValue::fromString(messag
e); |
97 m_workerGlobalScope->dispatchEvent(MessageEvent::create(ports.release(), val
ue)); | 97 m_workerGlobalScope->dispatchEvent(MessageEvent::create(ports.release(), val
ue)); |
98 } | 98 } |
99 | 99 |
100 void ServiceWorkerGlobalScopeProxy::dispatchPushEvent(int eventID, const WebStri
ng& data) | 100 void ServiceWorkerGlobalScopeProxy::dispatchPushEvent(int eventID, const WebStri
ng& data) |
101 { | 101 { |
102 ASSERT(m_workerGlobalScope); | 102 ASSERT(m_workerGlobalScope); |
103 m_workerGlobalScope->dispatchEvent(PushEvent::create(EventTypeNames::push, d
ata)); | 103 m_workerGlobalScope->dispatchEvent(PushEvent::create(EventTypeNames::push, d
ata)); |
104 } | 104 } |
105 | 105 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 155 |
156 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm
pl& embeddedWorker, ExecutionContext& executionContext, WebServiceWorkerContextC
lient& client) | 156 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm
pl& embeddedWorker, ExecutionContext& executionContext, WebServiceWorkerContextC
lient& client) |
157 : m_embeddedWorker(embeddedWorker) | 157 : m_embeddedWorker(embeddedWorker) |
158 , m_executionContext(executionContext) | 158 , m_executionContext(executionContext) |
159 , m_client(client) | 159 , m_client(client) |
160 , m_workerGlobalScope(0) | 160 , m_workerGlobalScope(0) |
161 { | 161 { |
162 } | 162 } |
163 | 163 |
164 } // namespace blink | 164 } // namespace blink |
OLD | NEW |