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

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

Issue 2422793002: HTML MessagePort as mojo::MessagePipeHandle (Closed)
Patch Set: Remove unnecessary histogram Created 3 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/WebDOMMessageEvent.cpp
diff --git a/third_party/WebKit/Source/web/WebDOMMessageEvent.cpp b/third_party/WebKit/Source/web/WebDOMMessageEvent.cpp
index 897bb6de313ae8e86e50acbb2f795e3fe2393c16..de0f03809d2d10170637b27435992ef9025a5111 100644
--- a/third_party/WebKit/Source/web/WebDOMMessageEvent.cpp
+++ b/third_party/WebKit/Source/web/WebDOMMessageEvent.cpp
@@ -48,7 +48,7 @@ WebDOMMessageEvent::WebDOMMessageEvent(
const WebString& origin,
const WebFrame* sourceFrame,
const WebDocument& targetDocument,
- const WebMessagePortChannelArray& channels)
+ WebMessagePortChannelArray channels)
: WebDOMMessageEvent(MessageEvent::create()) {
DOMWindow* window = nullptr;
if (sourceFrame)
@@ -56,7 +56,7 @@ WebDOMMessageEvent::WebDOMMessageEvent(
MessagePortArray* ports = nullptr;
if (!targetDocument.isNull()) {
Document* coreDocument = targetDocument;
- ports = MessagePort::toMessagePortArray(coreDocument, channels);
+ ports = MessagePort::toMessagePortArray(coreDocument, std::move(channels));
}
// Use an empty array for |ports| when it is null because this function
// is used to implement postMessage().
@@ -83,7 +83,7 @@ WebMessagePortChannelArray WebDOMMessageEvent::releaseChannels() {
WebMessagePortChannelArray webChannels(channels ? channels->size() : 0);
if (channels) {
for (size_t i = 0; i < channels->size(); ++i)
- webChannels[i] = (*channels)[i].release();
+ webChannels[i].reset((*channels)[i].release());
dcheng 2017/02/07 00:01:37 Nit: does webChannels[i] = std::move((*channels)[i
darin (slow to review) 2017/02/07 00:06:13 Yes, it does. Thanks!
}
return webChannels;
}

Powered by Google App Engine
This is Rietveld 408576698