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

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

Issue 1878463002: Move DOMArrayBuffer, DOMArrayBufferViews and DataView to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tidy Created 4 years, 8 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 reserv ed. 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 return new MessageEvent(data, origin, lastEventId, source, std::move(cha nnels), suborigin); 60 return new MessageEvent(data, origin, lastEventId, source, std::move(cha nnels), suborigin);
61 } 61 }
62 static MessageEvent* create(const String& data, const String& origin = Strin g(), const String& suborigin = String()) 62 static MessageEvent* create(const String& data, const String& origin = Strin g(), const String& suborigin = String())
63 { 63 {
64 return new MessageEvent(data, origin, suborigin); 64 return new MessageEvent(data, origin, suborigin);
65 } 65 }
66 static MessageEvent* create(Blob* data, const String& origin = String(), con st String& suborigin = String()) 66 static MessageEvent* create(Blob* data, const String& origin = String(), con st String& suborigin = String())
67 { 67 {
68 return new MessageEvent(data, origin, suborigin); 68 return new MessageEvent(data, origin, suborigin);
69 } 69 }
70 static MessageEvent* create(PassRefPtr<DOMArrayBuffer> data, const String& o rigin = String(), const String& suborigin = String()) 70 static MessageEvent* create(DOMArrayBuffer* data, const String& origin = Str ing(), const String& suborigin = String())
71 { 71 {
72 return new MessageEvent(data, origin, suborigin); 72 return new MessageEvent(data, origin, suborigin);
73 } 73 }
74 static MessageEvent* create(const AtomicString& type, const MessageEventInit & initializer, ExceptionState&); 74 static MessageEvent* create(const AtomicString& type, const MessageEventInit & initializer, ExceptionState&);
75 ~MessageEvent() override; 75 ~MessageEvent() override;
76 76
77 void initMessageEvent(const AtomicString& type, bool canBubble, bool cancela ble, ScriptValue data, const String& origin, const String& lastEventId, DOMWindo w* source, MessagePortArray*); 77 void initMessageEvent(const AtomicString& type, bool canBubble, bool cancela ble, ScriptValue data, const String& origin, const String& lastEventId, DOMWindo w* source, MessagePortArray*);
78 void initMessageEvent(const AtomicString& type, bool canBubble, bool cancela ble, PassRefPtr<SerializedScriptValue> data, const String& origin, const String& lastEventId, DOMWindow* source, MessagePortArray*); 78 void initMessageEvent(const AtomicString& type, bool canBubble, bool cancela ble, PassRefPtr<SerializedScriptValue> data, const String& origin, const String& lastEventId, DOMWindow* source, MessagePortArray*);
79 79
80 const String& origin() const { return m_origin; } 80 const String& origin() const { return m_origin; }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 115
116 private: 116 private:
117 MessageEvent(); 117 MessageEvent();
118 MessageEvent(const AtomicString&, const MessageEventInit&); 118 MessageEvent(const AtomicString&, const MessageEventInit&);
119 MessageEvent(const String& origin, const String& lastEventId, EventTarget* s ource, MessagePortArray*, const String& suborigin); 119 MessageEvent(const String& origin, const String& lastEventId, EventTarget* s ource, MessagePortArray*, const String& suborigin);
120 MessageEvent(PassRefPtr<SerializedScriptValue> data, const String& origin, c onst String& lastEventId, EventTarget* source, MessagePortArray*, const String& suborigin); 120 MessageEvent(PassRefPtr<SerializedScriptValue> data, const String& origin, c onst String& lastEventId, EventTarget* source, MessagePortArray*, const String& suborigin);
121 MessageEvent(PassRefPtr<SerializedScriptValue> data, const String& origin, c onst String& lastEventId, EventTarget* source, PassOwnPtr<MessagePortChannelArra y>, const String& suborigin); 121 MessageEvent(PassRefPtr<SerializedScriptValue> data, const String& origin, c onst String& lastEventId, EventTarget* source, PassOwnPtr<MessagePortChannelArra y>, const String& suborigin);
122 122
123 MessageEvent(const String& data, const String& origin, const String& suborig in); 123 MessageEvent(const String& data, const String& origin, const String& suborig in);
124 MessageEvent(Blob* data, const String& origin, const String& suborigin); 124 MessageEvent(Blob* data, const String& origin, const String& suborigin);
125 MessageEvent(PassRefPtr<DOMArrayBuffer> data, const String& origin, const St ring& suborigin); 125 MessageEvent(DOMArrayBuffer* data, const String& origin, const String& subor igin);
126 126
127 DataType m_dataType; 127 DataType m_dataType;
128 ScriptValue m_dataAsScriptValue; 128 ScriptValue m_dataAsScriptValue;
129 RefPtr<SerializedScriptValue> m_dataAsSerializedScriptValue; 129 RefPtr<SerializedScriptValue> m_dataAsSerializedScriptValue;
130 String m_dataAsString; 130 String m_dataAsString;
131 Member<Blob> m_dataAsBlob; 131 Member<Blob> m_dataAsBlob;
132 RefPtr<DOMArrayBuffer> m_dataAsArrayBuffer; 132 Member<DOMArrayBuffer> m_dataAsArrayBuffer;
133 String m_origin; 133 String m_origin;
134 String m_lastEventId; 134 String m_lastEventId;
135 Member<EventTarget> m_source; 135 Member<EventTarget> m_source;
136 // m_ports are the MessagePorts in an engtangled state, and m_channels are 136 // m_ports are the MessagePorts in an engtangled state, and m_channels are
137 // the MessageChannels in a disentangled state. Only one of them can be 137 // the MessageChannels in a disentangled state. Only one of them can be
138 // non-empty at a time. entangleMessagePorts() moves between the states. 138 // non-empty at a time. entangleMessagePorts() moves between the states.
139 Member<MessagePortArray> m_ports; 139 Member<MessagePortArray> m_ports;
140 OwnPtr<MessagePortChannelArray> m_channels; 140 OwnPtr<MessagePortChannelArray> m_channels;
141 String m_suborigin; 141 String m_suborigin;
142 }; 142 };
143 143
144 } // namespace blink 144 } // namespace blink
145 145
146 #endif // MessageEvent_h 146 #endif // MessageEvent_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698