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

Side by Side Diff: Source/core/dom/MessageEvent.cpp

Issue 23591059: Use null Strings for default values of MessageEvent properties (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
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, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 if (m_dataAsSerializedScriptValue) 85 if (m_dataAsSerializedScriptValue)
86 m_dataAsSerializedScriptValue->registerMemoryAllocatedWithCurrentScriptC ontext(); 86 m_dataAsSerializedScriptValue->registerMemoryAllocatedWithCurrentScriptC ontext();
87 ASSERT(isValidSource(m_source.get())); 87 ASSERT(isValidSource(m_source.get()));
88 } 88 }
89 89
90 MessageEvent::MessageEvent(const String& data, const String& origin) 90 MessageEvent::MessageEvent(const String& data, const String& origin)
91 : Event(eventNames().messageEvent, false, false) 91 : Event(eventNames().messageEvent, false, false)
92 , m_dataType(DataTypeString) 92 , m_dataType(DataTypeString)
93 , m_dataAsString(data) 93 , m_dataAsString(data)
94 , m_origin(origin) 94 , m_origin(origin)
95 , m_lastEventId("")
96 { 95 {
97 ScriptWrappable::init(this); 96 ScriptWrappable::init(this);
98 } 97 }
99 98
100 MessageEvent::MessageEvent(PassRefPtr<Blob> data, const String& origin) 99 MessageEvent::MessageEvent(PassRefPtr<Blob> data, const String& origin)
101 : Event(eventNames().messageEvent, false, false) 100 : Event(eventNames().messageEvent, false, false)
102 , m_dataType(DataTypeBlob) 101 , m_dataType(DataTypeBlob)
103 , m_dataAsBlob(data) 102 , m_dataAsBlob(data)
104 , m_origin(origin) 103 , m_origin(origin)
105 , m_lastEventId("")
106 { 104 {
107 ScriptWrappable::init(this); 105 ScriptWrappable::init(this);
108 } 106 }
109 107
110 MessageEvent::MessageEvent(PassRefPtr<ArrayBuffer> data, const String& origin) 108 MessageEvent::MessageEvent(PassRefPtr<ArrayBuffer> data, const String& origin)
111 : Event(eventNames().messageEvent, false, false) 109 : Event(eventNames().messageEvent, false, false)
112 , m_dataType(DataTypeArrayBuffer) 110 , m_dataType(DataTypeArrayBuffer)
113 , m_dataAsArrayBuffer(data) 111 , m_dataAsArrayBuffer(data)
114 , m_origin(origin) 112 , m_origin(origin)
115 , m_lastEventId("")
116 { 113 {
117 ScriptWrappable::init(this); 114 ScriptWrappable::init(this);
118 } 115 }
119 116
120 MessageEvent::~MessageEvent() 117 MessageEvent::~MessageEvent()
121 { 118 {
122 } 119 }
123 120
124 void MessageEvent::initMessageEvent(const AtomicString& type, bool canBubble, bo ol cancelable, const String& origin, const String& lastEventId, DOMWindow* sourc e, PassOwnPtr<MessagePortArray> ports) 121 void MessageEvent::initMessageEvent(const AtomicString& type, bool canBubble, bo ol cancelable, const String& origin, const String& lastEventId, DOMWindow* sourc e, PassOwnPtr<MessagePortArray> ports)
125 { 122 {
(...skipping 26 matching lines...) Expand all
152 if (m_dataAsSerializedScriptValue) 149 if (m_dataAsSerializedScriptValue)
153 m_dataAsSerializedScriptValue->registerMemoryAllocatedWithCurrentScriptC ontext(); 150 m_dataAsSerializedScriptValue->registerMemoryAllocatedWithCurrentScriptC ontext();
154 } 151 }
155 152
156 const AtomicString& MessageEvent::interfaceName() const 153 const AtomicString& MessageEvent::interfaceName() const
157 { 154 {
158 return eventNames().interfaceForMessageEvent; 155 return eventNames().interfaceForMessageEvent;
159 } 156 }
160 157
161 } // namespace WebCore 158 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698