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

Side by Side Diff: Source/modules/websockets/MainThreadWebSocketChannel.cpp

Issue 124003003: Add ascii() / latin1() / utf8() methods to AtomicString to avoid having to call string() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 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) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 return ""; 121 return "";
122 String extensions = m_handshake->acceptedExtensions(); 122 String extensions = m_handshake->acceptedExtensions();
123 if (extensions.isNull()) 123 if (extensions.isNull())
124 return ""; 124 return "";
125 return extensions; 125 return extensions;
126 } 126 }
127 127
128 WebSocketChannel::SendResult MainThreadWebSocketChannel::send(const String& mess age) 128 WebSocketChannel::SendResult MainThreadWebSocketChannel::send(const String& mess age)
129 { 129 {
130 WTF_LOG(Network, "MainThreadWebSocketChannel %p send() Sending String '%s'", this, message.utf8().data()); 130 WTF_LOG(Network, "MainThreadWebSocketChannel %p send() Sending String '%s'", this, message.utf8().data());
131 CString utf8 = message.utf8(String::StrictConversionReplacingUnpairedSurroga tesWithFFFD); 131 CString utf8 = message.utf8(StrictUTF8ConversionReplacingUnpairedSurrogatesW ithFFFD);
132 enqueueTextFrame(utf8); 132 enqueueTextFrame(utf8);
133 processOutgoingFrameQueue(); 133 processOutgoingFrameQueue();
134 // m_channel->send() may happen later, thus it's not always possible to know whether 134 // m_channel->send() may happen later, thus it's not always possible to know whether
135 // the message has been sent to the socket successfully. In this case, we ha ve no choice 135 // the message has been sent to the socket successfully. In this case, we ha ve no choice
136 // but to return SendSuccess. 136 // but to return SendSuccess.
137 return WebSocketChannel::SendSuccess; 137 return WebSocketChannel::SendSuccess;
138 } 138 }
139 139
140 WebSocketChannel::SendResult MainThreadWebSocketChannel::send(const ArrayBuffer& binaryData, unsigned byteOffset, unsigned byteLength) 140 WebSocketChannel::SendResult MainThreadWebSocketChannel::send(const ArrayBuffer& binaryData, unsigned byteOffset, unsigned byteLength)
141 { 141 {
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 } 814 }
815 815
816 Vector<char> frameData; 816 Vector<char> frameData;
817 frame.makeFrameData(frameData); 817 frame.makeFrameData(frameData);
818 818
819 m_perMessageDeflate.resetDeflateBuffer(); 819 m_perMessageDeflate.resetDeflateBuffer();
820 return m_handle->send(frameData.data(), frameData.size()); 820 return m_handle->send(frameData.data(), frameData.size());
821 } 821 }
822 822
823 } // namespace WebCore 823 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/mediasource/MediaSourceBase.cpp ('k') | Source/modules/websockets/NewWebSocketChannelImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698