Changeset 230524 in webkit
- Timestamp:
- Apr 11, 2018 8:28:37 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r230445 r230524 1 2018-04-11 Jianjun Zhu <jianjun.zhu@intel.com> 2 3 Fix a WebRTC data channel issue for non-ASCII characters. 4 5 At the sender side, buffer size are calulcated after UTF8 encoding. At the 6 receiver side, strings are constructed with UTF8 data. 7 8 https://bugs.webkit.org/show_bug.cgi?id=184481 9 10 Reviewed by Youenn Fablet. 11 12 * web-platform-tests/webrtc/RTCDataChannel-send-expected.txt: 13 1 14 2018-04-09 Brendan McLoughlin <brendan@bocoup.com> 2 15 -
trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCDataChannel-send-expected.txt
r222307 r230524 2 2 PASS Calling send() when data channel is in connecting state should throw InvalidStateError 3 3 PASS Data channel should be able to send simple string and receive as string 4 FAIL Data channel should be able to send unicode string and receive as unicode string assert_equals: expected "世界你好" but got "ä¸ç" 4 PASS Data channel should be able to send unicode string and receive as unicode string 5 5 PASS Data channel should ignore binaryType and always receive string message as string 6 6 PASS Data channel should be able to send Uint8Array message and receive as ArrayBuffer -
trunk/Source/WebCore/ChangeLog
r230522 r230524 1 2018-04-11 Jianjun Zhu <jianjun.zhu@intel.com> 2 3 Fix a WebRTC data channel issue for non-ASCII characters. 4 5 At the sender side, buffer size are calulcated after UTF8 encoding. At the 6 receiver side, strings are constructed with UTF8 data. 7 8 https://bugs.webkit.org/show_bug.cgi?id=184481 9 10 Reviewed by Youenn Fablet. 11 12 Updated test: 13 LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCDataChannel-send-expected.txt 14 15 * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp: 16 (WebCore::LibWebRTCDataChannelHandler::sendStringData): 17 (WebCore::LibWebRTCDataChannelHandler::OnMessage): 18 1 19 2018-04-11 Antti Koivisto <antti@apple.com> 2 20 -
trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp
r215832 r230524 48 48 bool LibWebRTCDataChannelHandler::sendStringData(const String& text) 49 49 { 50 return m_channel->Send({rtc::CopyOnWriteBuffer(text.utf8().data(), text.length()), false}); 50 auto utf8Text = text.utf8(); 51 return m_channel->Send({ rtc::CopyOnWriteBuffer(utf8Text.data(), utf8Text.length()), false }); 51 52 } 52 53 … … 97 98 std::unique_ptr<webrtc::DataBuffer> protectedBuffer(new webrtc::DataBuffer(buffer)); 98 99 callOnMainThread([protectedClient = makeRef(*m_client), buffer = WTFMove(protectedBuffer)] { 99 // FIXME: Ensure this is correct by adding some tests with non-ASCII characters. 100 const char* data = reinterpret_cast<const char*>(buffer->data.data()); 100 const char* data = reinterpret_cast<const char*>(buffer->data.data<char>()); 101 101 if (buffer->binary) 102 102 protectedClient->didReceiveRawData(data, buffer->size()); 103 103 else 104 protectedClient->didReceiveStringData(String (data, buffer->size()));104 protectedClient->didReceiveStringData(String::fromUTF8(data, buffer->size())); 105 105 }); 106 106 }
Note: See TracChangeset
for help on using the changeset viewer.