Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Unified Diff: third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp

Issue 1658073002: ServiceWorker: Implement attributes of ExtendableMessageEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: templatize duplicate code Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp
diff --git a/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp b/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp
index 4c206b4f4b2aa662c677f461d8571d762817eb71..88cf3c493538b050fe97bc49cef68b6eaa97dac1 100644
--- a/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp
+++ b/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp
@@ -106,10 +106,14 @@ void ServiceWorkerGlobalScopeProxy::dispatchExtendableMessageEvent(int eventID,
{
ASSERT(RuntimeEnabledFeatures::serviceWorkerExtendableMessageEventEnabled());
- ExtendableMessageEventInit initializer;
+ WebSerializedScriptValue value = WebSerializedScriptValue::fromString(message);
+ OwnPtrWillBeRawPtr<MessagePortArray> ports = MessagePort::toMessagePortArray(m_workerGlobalScope, webChannels);
+ // TODO(nhiroki): Support |origin| and |source| attributes.
+ // (http://crbug.com/543198)
+
WaitUntilObserver* observer = WaitUntilObserver::create(workerGlobalScope(), WaitUntilObserver::Message, eventID);
- RefPtrWillBeRawPtr<Event> event(ExtendableMessageEvent::create(EventTypeNames::message, initializer, observer));
+ RefPtrWillBeRawPtr<Event> event(ExtendableMessageEvent::create(value, String(), ports, observer));
workerGlobalScope()->dispatchExtendableEvent(event.release(), observer);
}

Powered by Google App Engine
This is Rietveld 408576698