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

Side by Side Diff: third_party/WebKit/Source/core/events/MessageEvent.h

Issue 2422793002: HTML MessagePort as mojo::MessagePipeHandle (Closed)
Patch Set: Add missing ScopedAsyncTaskScheduler instance for the new unit tests; required by a recent change t… 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Henry Mason (hmason@mac.com) 2 * Copyright (C) 2007 Henry Mason (hmason@mac.com)
3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights
4 * reserved. 4 * reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 } 56 }
57 static MessageEvent* create(MessagePortArray* ports, 57 static MessageEvent* create(MessagePortArray* ports,
58 PassRefPtr<SerializedScriptValue> data, 58 PassRefPtr<SerializedScriptValue> data,
59 const String& origin = String(), 59 const String& origin = String(),
60 const String& lastEventId = String(), 60 const String& lastEventId = String(),
61 EventTarget* source = nullptr, 61 EventTarget* source = nullptr,
62 const String& suborigin = String()) { 62 const String& suborigin = String()) {
63 return new MessageEvent(std::move(data), origin, lastEventId, source, ports, 63 return new MessageEvent(std::move(data), origin, lastEventId, source, ports,
64 suborigin); 64 suborigin);
65 } 65 }
66 static MessageEvent* create(std::unique_ptr<MessagePortChannelArray> channels, 66 static MessageEvent* create(MessagePortChannelArray channels,
67 PassRefPtr<SerializedScriptValue> data, 67 PassRefPtr<SerializedScriptValue> data,
68 const String& origin = String(), 68 const String& origin = String(),
69 const String& lastEventId = String(), 69 const String& lastEventId = String(),
70 EventTarget* source = nullptr, 70 EventTarget* source = nullptr,
71 const String& suborigin = String()) { 71 const String& suborigin = String()) {
72 return new MessageEvent(std::move(data), origin, lastEventId, source, 72 return new MessageEvent(std::move(data), origin, lastEventId, source,
73 std::move(channels), suborigin); 73 std::move(channels), suborigin);
74 } 74 }
75 static MessageEvent* create(const String& data, 75 static MessageEvent* create(const String& data,
76 const String& origin = String(), 76 const String& origin = String(),
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 const String& lastEventId, 116 const String& lastEventId,
117 EventTarget* source, 117 EventTarget* source,
118 MessagePortArray*); 118 MessagePortArray*);
119 119
120 const String& origin() const { return m_origin; } 120 const String& origin() const { return m_origin; }
121 const String& suborigin() const { return m_suborigin; } 121 const String& suborigin() const { return m_suborigin; }
122 const String& lastEventId() const { return m_lastEventId; } 122 const String& lastEventId() const { return m_lastEventId; }
123 EventTarget* source() const { return m_source.get(); } 123 EventTarget* source() const { return m_source.get(); }
124 MessagePortArray ports(bool& isNull) const; 124 MessagePortArray ports(bool& isNull) const;
125 MessagePortArray ports() const; 125 MessagePortArray ports() const;
126 MessagePortChannelArray* channels() const { 126
127 return m_channels ? m_channels.get() : nullptr; 127 MessagePortChannelArray releaseChannels() { return std::move(m_channels); }
128 }
129 128
130 const AtomicString& interfaceName() const override; 129 const AtomicString& interfaceName() const override;
131 130
132 enum DataType { 131 enum DataType {
133 DataTypeScriptValue, 132 DataTypeScriptValue,
134 DataTypeSerializedScriptValue, 133 DataTypeSerializedScriptValue,
135 DataTypeString, 134 DataTypeString,
136 DataTypeBlob, 135 DataTypeBlob,
137 DataTypeArrayBuffer 136 DataTypeArrayBuffer
138 }; 137 };
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 MessageEvent(PassRefPtr<SerializedScriptValue> data, 182 MessageEvent(PassRefPtr<SerializedScriptValue> data,
184 const String& origin, 183 const String& origin,
185 const String& lastEventId, 184 const String& lastEventId,
186 EventTarget* source, 185 EventTarget* source,
187 MessagePortArray*, 186 MessagePortArray*,
188 const String& suborigin); 187 const String& suborigin);
189 MessageEvent(PassRefPtr<SerializedScriptValue> data, 188 MessageEvent(PassRefPtr<SerializedScriptValue> data,
190 const String& origin, 189 const String& origin,
191 const String& lastEventId, 190 const String& lastEventId,
192 EventTarget* source, 191 EventTarget* source,
193 std::unique_ptr<MessagePortChannelArray>, 192 MessagePortChannelArray,
194 const String& suborigin); 193 const String& suborigin);
195 194
196 MessageEvent(const String& data, 195 MessageEvent(const String& data,
197 const String& origin, 196 const String& origin,
198 const String& suborigin); 197 const String& suborigin);
199 MessageEvent(Blob* data, const String& origin, const String& suborigin); 198 MessageEvent(Blob* data, const String& origin, const String& suborigin);
200 MessageEvent(DOMArrayBuffer* data, 199 MessageEvent(DOMArrayBuffer* data,
201 const String& origin, 200 const String& origin,
202 const String& suborigin); 201 const String& suborigin);
203 202
204 DataType m_dataType; 203 DataType m_dataType;
205 ScriptValue m_dataAsScriptValue; 204 ScriptValue m_dataAsScriptValue;
206 RefPtr<SerializedScriptValue> m_dataAsSerializedScriptValue; 205 RefPtr<SerializedScriptValue> m_dataAsSerializedScriptValue;
207 String m_dataAsString; 206 String m_dataAsString;
208 Member<Blob> m_dataAsBlob; 207 Member<Blob> m_dataAsBlob;
209 Member<DOMArrayBuffer> m_dataAsArrayBuffer; 208 Member<DOMArrayBuffer> m_dataAsArrayBuffer;
210 String m_origin; 209 String m_origin;
211 String m_lastEventId; 210 String m_lastEventId;
212 Member<EventTarget> m_source; 211 Member<EventTarget> m_source;
213 // m_ports are the MessagePorts in an engtangled state, and m_channels are 212 // m_ports are the MessagePorts in an entangled state, and m_channels are
214 // the MessageChannels in a disentangled state. Only one of them can be 213 // the MessageChannels in a disentangled state. Only one of them can be
215 // non-empty at a time. entangleMessagePorts() moves between the states. 214 // non-empty at a time. entangleMessagePorts() moves between the states.
216 Member<MessagePortArray> m_ports; 215 Member<MessagePortArray> m_ports;
217 std::unique_ptr<MessagePortChannelArray> m_channels; 216 MessagePortChannelArray m_channels;
218 String m_suborigin; 217 String m_suborigin;
219 }; 218 };
220 219
221 } // namespace blink 220 } // namespace blink
222 221
223 #endif // MessageEvent_h 222 #endif // MessageEvent_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/MessagePort.cpp ('k') | third_party/WebKit/Source/core/events/MessageEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698