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

Unified Diff: Source/core/dom/MessagePort.cpp

Issue 1150183007: Re-land: bindings: Use MessageEventInit for MessageEvent constructor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 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
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/events/MessageEvent.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/MessagePort.cpp
diff --git a/Source/core/dom/MessagePort.cpp b/Source/core/dom/MessagePort.cpp
index ebb399f19274ca7a7496ba59af3dda169f646bf1..3df2fde8f052b25304b7ab5fc42c341e3a839d97 100644
--- a/Source/core/dom/MessagePort.cpp
+++ b/Source/core/dom/MessagePort.cpp
@@ -259,8 +259,10 @@ PassOwnPtr<MessagePortChannelArray> MessagePort::disentanglePorts(ExecutionConte
PassOwnPtrWillBeRawPtr<MessagePortArray> MessagePort::entanglePorts(ExecutionContext& context, PassOwnPtr<MessagePortChannelArray> channels)
{
+ // https://html.spec.whatwg.org/multipage/comms.html#message-ports
+ // |ports| should be an empty array, not null even when there is no ports.
if (!channels || !channels->size())
- return nullptr;
+ return adoptPtrWillBeNoop(new MessagePortArray());
OwnPtrWillBeRawPtr<MessagePortArray> portArray = adoptPtrWillBeNoop(new MessagePortArray(channels->size()));
for (unsigned i = 0; i < channels->size(); ++i) {
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/events/MessageEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698