Changeset 131494 in webkit
- Timestamp:
- Oct 16, 2012 1:41:36 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r131491 r131494 1 2012-10-16 Tommy Widenflycht <tommyw@google.com> 2 3 MediaStream API: Add the chromium API for RTCDataChannel 4 https://bugs.webkit.org/show_bug.cgi?id=99435 5 6 Reviewed by Adam Barth. 7 8 Adding tests for RTCDataChannel. 9 10 * fast/mediastream/RTCPeerConnection-datachannel-expected.txt: Added. 11 * fast/mediastream/RTCPeerConnection-datachannel.html: Added. 12 1 13 2012-10-16 Tony Chang <tony@chromium.org> 2 14 -
trunk/Source/Platform/ChangeLog
r131262 r131494 1 2012-10-16 Tommy Widenflycht <tommyw@google.com> 2 3 MediaStream API: Add the chromium API for RTCDataChannel 4 https://bugs.webkit.org/show_bug.cgi?id=99435 5 6 Reviewed by Adam Barth. 7 8 Adding WebRTCDataChannel. 9 10 * Platform.gypi: 11 * chromium/public/WebRTCDataChannel.h: Added. 12 (WebCore): 13 (WebKit): 14 (WebRTCDataChannel): 15 (ExtraData): 16 (WebKit::WebRTCDataChannel::ExtraData::~ExtraData): 17 (WebKit::WebRTCDataChannel::WebRTCDataChannel): 18 (WebKit::WebRTCDataChannel::~WebRTCDataChannel): 19 (WebKit::WebRTCDataChannel::operator=): 20 (WebKit::WebRTCDataChannel::isNull): 21 * chromium/public/WebRTCPeerConnectionHandler.h: 22 (WebKit): 23 (WebRTCPeerConnectionHandler): 24 (WebKit::WebRTCPeerConnectionHandler::openDataChannel): 25 (WebKit::WebRTCPeerConnectionHandler::sendStringData): 26 (WebKit::WebRTCPeerConnectionHandler::sendRawData): 27 (WebKit::WebRTCPeerConnectionHandler::closeDataChannel): 28 1 29 2012-10-13 Chris Rogers <crogers@google.com> 2 30 -
trunk/Source/Platform/Platform.gypi
r130260 r131494 108 108 'chromium/public/WebPrivatePtr.h', 109 109 'chromium/public/WebRTCConfiguration.h', 110 'chromium/public/WebRTCDataChannel.h', 110 111 'chromium/public/WebRTCICECandidate.h', 111 112 'chromium/public/WebRTCPeerConnectionHandler.h', -
trunk/Source/Platform/chromium/public/WebRTCPeerConnectionHandler.h
r129908 r131494 36 36 class WebMediaStreamDescriptor; 37 37 class WebRTCConfiguration; 38 class WebRTCDataChannel; 38 39 class WebRTCICECandidate; 39 40 class WebRTCPeerConnectionHandlerClient; … … 42 43 class WebRTCStatsRequest; 43 44 class WebRTCVoidRequest; 45 class WebString; 44 46 45 47 class WebRTCPeerConnectionHandler { … … 62 64 virtual void getStats(const WebRTCStatsRequest&) { } 63 65 virtual void stop() = 0; 66 67 // RTCDataChannel 68 virtual bool openDataChannel(const WebRTCDataChannel&) { return false; } 69 virtual bool sendStringData(const WebRTCDataChannel&, const WebString&) { return false; } 70 virtual bool sendRawData(const WebRTCDataChannel&, const char*, size_t) { return false; } 71 virtual void closeDataChannel(const WebRTCDataChannel&) { } 64 72 }; 65 73 -
trunk/Source/WebCore/ChangeLog
r131492 r131494 1 2012-10-16 Tommy Widenflycht <tommyw@google.com> 2 3 MediaStream API: Add the chromium API for RTCDataChannel 4 https://bugs.webkit.org/show_bug.cgi?id=99435 5 6 Reviewed by Adam Barth. 7 8 Adding WebRTCDataChannel. 9 10 Test: fast/mediastream/RTCPeerConnection-datachannel.html 11 12 * WebCore.gypi: 13 * platform/chromium/support/WebRTCDataChannel.cpp: Added. 14 (WebKit): 15 (ExtraDataContainer): 16 (WebKit::ExtraDataContainer::ExtraDataContainer): 17 (WebKit::ExtraDataContainer::extraData): 18 (WebKit::WebRTCDataChannel::WebRTCDataChannel): 19 (WebKit::WebRTCDataChannel::initialize): 20 (WebKit::WebRTCDataChannel::assign): 21 (WebKit::WebRTCDataChannel::reset): 22 (WebKit::WebRTCDataChannel::operator PassRefPtr<WebCore::RTCDataChannelDescriptor>): 23 (WebKit::WebRTCDataChannel::operator WebCore::RTCDataChannelDescriptor*): 24 (WebKit::WebRTCDataChannel::extraData): 25 (WebKit::WebRTCDataChannel::setExtraData): 26 (WebKit::WebRTCDataChannel::label): 27 (WebKit::WebRTCDataChannel::reliable): 28 (WebKit::WebRTCDataChannel::setBufferedAmount): 29 (WebKit::WebRTCDataChannel::readyStateChanged): 30 (WebKit::WebRTCDataChannel::dataArrived): 31 (WebKit::WebRTCDataChannel::error): 32 * platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.cpp: 33 (WebCore::RTCPeerConnectionHandlerChromium::negotiationNeeded): 34 (WebCore::RTCPeerConnectionHandlerChromium::didGenerateICECandidate): 35 (WebCore): 36 (WebCore::RTCPeerConnectionHandlerChromium::didChangeReadyState): 37 (WebCore::RTCPeerConnectionHandlerChromium::didChangeICEState): 38 (WebCore::RTCPeerConnectionHandlerChromium::didRemoveRemoteStream): 39 1 40 2012-10-16 Brady Eidson <beidson@apple.com> 2 41 -
trunk/Source/WebCore/WebCore.gypi
r131486 r131494 8392 8392 'platform/chromium/support/WebPrerender.cpp', 8393 8393 'platform/chromium/support/WebRTCConfiguration.cpp', 8394 'platform/chromium/support/WebRTCDataChannel.cpp', 8394 8395 'platform/chromium/support/WebRTCICECandidate.cpp', 8395 8396 'platform/chromium/support/WebRTCSessionDescription.cpp', -
trunk/Source/WebCore/platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.cpp
r131372 r131494 48 48 #include <public/WebMediaStreamDescriptor.h> 49 49 #include <public/WebRTCConfiguration.h> 50 #include <public/WebRTCDataChannel.h> 50 51 #include <public/WebRTCICECandidate.h> 51 52 #include <public/WebRTCSessionDescription.h> … … 176 177 } 177 178 179 bool RTCPeerConnectionHandlerChromium::openDataChannel(PassRefPtr<RTCDataChannelDescriptor> dataChannel) 180 { 181 if (!m_webHandler) 182 return false; 183 184 return m_webHandler->openDataChannel(dataChannel); 185 } 186 187 bool RTCPeerConnectionHandlerChromium::sendStringData(PassRefPtr<RTCDataChannelDescriptor> dataChannel, const String& data) 188 { 189 if (!m_webHandler) 190 return false; 191 192 return m_webHandler->sendStringData(dataChannel, data); 193 } 194 195 bool RTCPeerConnectionHandlerChromium::sendRawData(PassRefPtr<RTCDataChannelDescriptor> dataChannel, const char* data, size_t dataLength) 196 { 197 if (!m_webHandler) 198 return false; 199 200 return m_webHandler->sendRawData(dataChannel, data, dataLength); 201 } 202 203 void RTCPeerConnectionHandlerChromium::closeDataChannel(PassRefPtr<RTCDataChannelDescriptor> dataChannel) 204 { 205 if (!m_webHandler) 206 return; 207 208 return m_webHandler->closeDataChannel(dataChannel); 209 } 210 178 211 void RTCPeerConnectionHandlerChromium::stop() 179 212 { … … 214 247 } 215 248 216 bool RTCPeerConnectionHandlerChromium::openDataChannel(PassRefPtr<RTCDataChannelDescriptor> dataChannel)217 {218 // FIXME: Implement when WebKit changes have landed.219 return false;220 }221 222 bool RTCPeerConnectionHandlerChromium::sendStringData(PassRefPtr<RTCDataChannelDescriptor> dataChannel, const String& data)223 {224 // FIXME: Implement when WebKit changes have landed.225 return false;226 }227 228 bool RTCPeerConnectionHandlerChromium::sendRawData(PassRefPtr<RTCDataChannelDescriptor> dataChannel, const char* data, size_t dataLength)229 {230 // FIXME: Implement when WebKit changes have landed.231 return false;232 }233 234 void RTCPeerConnectionHandlerChromium::closeDataChannel(PassRefPtr<RTCDataChannelDescriptor> dataChannel)235 {236 // FIXME: Implement when WebKit changes have landed.237 }238 239 249 } // namespace WebCore 240 250 -
trunk/Source/WebKit/chromium/ChangeLog
r131493 r131494 1 2012-10-16 Tommy Widenflycht <tommyw@google.com> 2 3 MediaStream API: Add the chromium API for RTCDataChannel 4 https://bugs.webkit.org/show_bug.cgi?id=99435 5 6 Reviewed by Adam Barth. 7 8 Adding checks for RTCDataChannel. 9 10 * src/AssertMatchingEnums.cpp: 11 1 12 2012-10-16 Sheriff Bot <webkit.review.bot@gmail.com> 2 13 -
trunk/Source/WebKit/chromium/src/AssertMatchingEnums.cpp
r129799 r131494 65 65 #include "PeerConnection00.h" 66 66 #include "PlatformCursor.h" 67 #include "RTCDataChannelDescriptor.h" 67 68 #include "RTCPeerConnectionHandlerClient.h" 68 69 #include "ReferrerPolicy.h" … … 117 118 #include <public/WebPeerConnection00Handler.h> 118 119 #include <public/WebPeerConnection00HandlerClient.h> 120 #include <public/WebRTCDataChannel.h> 119 121 #include <public/WebRTCPeerConnectionHandler.h> 120 122 #include <public/WebRTCPeerConnectionHandlerClient.h> … … 592 594 COMPILE_ASSERT_MATCHING_ENUM(WebRTCPeerConnectionHandlerClient::ICEStateFailed, RTCPeerConnectionHandlerClient::IceStateFailed); 593 595 COMPILE_ASSERT_MATCHING_ENUM(WebRTCPeerConnectionHandlerClient::ICEStateClosed, RTCPeerConnectionHandlerClient::IceStateClosed); 596 597 COMPILE_ASSERT_MATCHING_ENUM(WebRTCDataChannel::ReadyStateConnecting, RTCDataChannelDescriptor::ReadyStateConnecting); 598 COMPILE_ASSERT_MATCHING_ENUM(WebRTCDataChannel::ReadyStateOpen, RTCDataChannelDescriptor::ReadyStateOpen); 599 COMPILE_ASSERT_MATCHING_ENUM(WebRTCDataChannel::ReadyStateClosing, RTCDataChannelDescriptor::ReadyStateClosing); 600 COMPILE_ASSERT_MATCHING_ENUM(WebRTCDataChannel::ReadyStateClosed, RTCDataChannelDescriptor::ReadyStateClosed); 594 601 #endif 595 602 -
trunk/Tools/ChangeLog
r131486 r131494 1 2012-10-16 Tommy Widenflycht <tommyw@google.com> 2 3 MediaStream API: Add the chromium API for RTCDataChannel 4 https://bugs.webkit.org/show_bug.cgi?id=99435 5 6 Reviewed by Adam Barth. 7 8 Adding mock support for WebRTCDataChannel. 9 10 * DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.cpp: 11 (StringDataTask): 12 (StringDataTask::StringDataTask): 13 (CharPtrDataTask): 14 (CharPtrDataTask::CharPtrDataTask): 15 (DataChannelReadyStateTask): 16 (DataChannelReadyStateTask::DataChannelReadyStateTask): 17 (RTCPeerConnectionReadyStateTask): 18 (RTCPeerConnectionReadyStateTask::RTCPeerConnectionReadyStateTask): 19 (MockWebRTCPeerConnectionHandler::MockWebRTCPeerConnectionHandler): 20 (MockWebRTCPeerConnectionHandler::initialize): 21 (MockWebRTCPeerConnectionHandler::stop): 22 (MockWebRTCPeerConnectionHandler::openDataChannel): 23 (MockWebRTCPeerConnectionHandler::closeDataChannel): 24 (MockWebRTCPeerConnectionHandler::sendStringData): 25 (MockWebRTCPeerConnectionHandler::sendRawData): 26 * DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.h: 27 (MockWebRTCPeerConnectionHandler): 28 1 29 2012-10-16 Chris Rogers <crogers@google.com> 2 30 -
trunk/Tools/DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.cpp
r130768 r131494 125 125 }; 126 126 127 class StringDataTask : public MethodTask<MockWebRTCPeerConnectionHandler> { 128 public: 129 StringDataTask(MockWebRTCPeerConnectionHandler* object, const WebRTCDataChannel& dataChannel, const WebString& data) 130 : MethodTask<MockWebRTCPeerConnectionHandler>(object) 131 , m_dataChannel(dataChannel) 132 , m_data(data) 133 { 134 } 135 136 virtual void runIfValid() OVERRIDE 137 { 138 m_dataChannel.dataArrived(m_data); 139 } 140 141 private: 142 WebRTCDataChannel m_dataChannel; 143 WebString m_data; 144 }; 145 146 class CharPtrDataTask : public MethodTask<MockWebRTCPeerConnectionHandler> { 147 public: 148 CharPtrDataTask(MockWebRTCPeerConnectionHandler* object, const WebRTCDataChannel& dataChannel, const char* data, size_t length) 149 : MethodTask<MockWebRTCPeerConnectionHandler>(object) 150 , m_dataChannel(dataChannel) 151 , m_length(length) 152 { 153 m_data = new char[m_length]; 154 memcpy(m_data, data, m_length); 155 } 156 157 virtual void runIfValid() OVERRIDE 158 { 159 m_dataChannel.dataArrived(m_data, m_length); 160 delete m_data; 161 } 162 163 private: 164 WebRTCDataChannel m_dataChannel; 165 char* m_data; 166 size_t m_length; 167 }; 168 169 class DataChannelReadyStateTask : public MethodTask<MockWebRTCPeerConnectionHandler> { 170 public: 171 DataChannelReadyStateTask(MockWebRTCPeerConnectionHandler* object, const WebRTCDataChannel& dataChannel, WebRTCDataChannel::ReadyState state) 172 : MethodTask<MockWebRTCPeerConnectionHandler>(object) 173 , m_dataChannel(dataChannel) 174 , m_state(state) 175 { 176 } 177 178 virtual void runIfValid() OVERRIDE 179 { 180 m_dataChannel.readyStateChanged(m_state); 181 } 182 183 private: 184 WebRTCDataChannel m_dataChannel; 185 WebRTCDataChannel::ReadyState m_state; 186 }; 187 188 class RTCPeerConnectionReadyStateTask : public MethodTask<MockWebRTCPeerConnectionHandler> { 189 public: 190 RTCPeerConnectionReadyStateTask(MockWebRTCPeerConnectionHandler* object, WebRTCPeerConnectionHandlerClient* client, WebRTCPeerConnectionHandlerClient::ReadyState state) 191 : MethodTask<MockWebRTCPeerConnectionHandler>(object) 192 , m_client(client) 193 , m_state(state) 194 { 195 } 196 197 virtual void runIfValid() OVERRIDE 198 { 199 m_client->didChangeReadyState(m_state); 200 } 201 202 private: 203 WebRTCPeerConnectionHandlerClient* m_client; 204 WebRTCPeerConnectionHandlerClient::ReadyState m_state; 205 }; 206 127 207 ///////////////////// 128 208 129 209 MockWebRTCPeerConnectionHandler::MockWebRTCPeerConnectionHandler(WebRTCPeerConnectionHandlerClient* client) 130 210 : m_client(client) 211 , m_stopped(false) 131 212 , m_streamCount(0) 132 213 { … … 135 216 bool MockWebRTCPeerConnectionHandler::initialize(const WebRTCConfiguration&, const WebMediaConstraints& constraints) 136 217 { 137 return MockConstraints::verifyConstraints(constraints); 218 if (MockConstraints::verifyConstraints(constraints)) { 219 postTask(new RTCPeerConnectionReadyStateTask(this, m_client, WebRTCPeerConnectionHandlerClient::ReadyStateActive)); 220 return true; 221 } 222 223 return false; 138 224 } 139 225 … … 231 317 void MockWebRTCPeerConnectionHandler::stop() 232 318 { 319 m_stopped = true; 320 } 321 322 bool MockWebRTCPeerConnectionHandler::openDataChannel(const WebRTCDataChannel& dataChannel) 323 { 324 if (m_stopped) 325 return false; 326 327 postTask(new DataChannelReadyStateTask(this, dataChannel, WebRTCDataChannel::ReadyStateOpen)); 328 return true; 329 } 330 331 void MockWebRTCPeerConnectionHandler::closeDataChannel(const WebRTCDataChannel& dataChannel) 332 { 333 postTask(new DataChannelReadyStateTask(this, dataChannel, WebRTCDataChannel::ReadyStateClosed)); 334 } 335 336 bool MockWebRTCPeerConnectionHandler::sendStringData(const WebRTCDataChannel& dataChannel, const WebString& data) 337 { 338 if (m_stopped) 339 return false; 340 341 postTask(new StringDataTask(this, dataChannel, data)); 342 return true; 343 } 344 345 bool MockWebRTCPeerConnectionHandler::sendRawData(const WebRTCDataChannel& dataChannel, const char* data, size_t length) 346 { 347 if (m_stopped) 348 return false; 349 350 postTask(new CharPtrDataTask(this, dataChannel, data, length)); 351 return true; 233 352 } 234 353 -
trunk/Tools/DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.h
r130260 r131494 35 35 36 36 #include "Task.h" 37 #include <public/WebRTCDataChannel.h> 37 38 #include <public/WebRTCPeerConnectionHandler.h> 38 39 #include <public/WebRTCSessionDescription.h> … … 63 64 virtual void stop() OVERRIDE; 64 65 66 virtual bool openDataChannel(const WebKit::WebRTCDataChannel&) OVERRIDE; 67 virtual bool sendStringData(const WebKit::WebRTCDataChannel&, const WebKit::WebString&) OVERRIDE; 68 virtual bool sendRawData(const WebKit::WebRTCDataChannel&, const char*, size_t) OVERRIDE; 69 virtual void closeDataChannel(const WebKit::WebRTCDataChannel&) OVERRIDE; 70 65 71 // Task related methods 66 72 TaskList* taskList() { return &m_taskList; } … … 70 76 71 77 WebKit::WebRTCPeerConnectionHandlerClient* m_client; 78 bool m_stopped; 72 79 TaskList m_taskList; 73 80 WebKit::WebRTCSessionDescription m_localDescription;
Note: See TracChangeset
for help on using the changeset viewer.