diff options
Diffstat (limited to 'WebCore/websockets')
-rw-r--r-- | WebCore/websockets/WebSocket.cpp | 7 | ||||
-rw-r--r-- | WebCore/websockets/WebSocketChannel.cpp | 5 | ||||
-rw-r--r-- | WebCore/websockets/WebSocketHandshake.cpp | 7 |
3 files changed, 11 insertions, 8 deletions
diff --git a/WebCore/websockets/WebSocket.cpp b/WebCore/websockets/WebSocket.cpp index 073a924..358a742 100644 --- a/WebCore/websockets/WebSocket.cpp +++ b/WebCore/websockets/WebSocket.cpp @@ -42,11 +42,12 @@ #include "Logging.h" #include "MessageEvent.h" #include "ScriptExecutionContext.h" -#include "StringBuilder.h" #include "ThreadableWebSocketChannel.h" #include "WebSocketChannel.h" -#include <wtf/text/CString.h> #include <wtf/StdLibExtras.h> +#include <wtf/text/CString.h> +#include <wtf/text/StringBuilder.h> +#include <wtf/text/StringConcatenate.h> namespace WebCore { @@ -140,7 +141,7 @@ void WebSocket::connect(const KURL& url, const String& protocol, ExceptionCode& return; } if (!portAllowed(url)) { - scriptExecutionContext()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, String::format("WebSocket port %d blocked", url.port()), 0, scriptExecutionContext()->securityOrigin()->toString()); + scriptExecutionContext()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, makeString("WebSocket port ", String::number(url.port()), " blocked"), 0, scriptExecutionContext()->securityOrigin()->toString()); m_state = CLOSED; ec = SECURITY_ERR; return; diff --git a/WebCore/websockets/WebSocketChannel.cpp b/WebCore/websockets/WebSocketChannel.cpp index 5ce1cc3..45bb206 100644 --- a/WebCore/websockets/WebSocketChannel.cpp +++ b/WebCore/websockets/WebSocketChannel.cpp @@ -48,6 +48,7 @@ #include "WebSocketHandshake.h" #include <wtf/text/CString.h> +#include <wtf/text/StringConcatenate.h> #include <wtf/text/StringHash.h> #include <wtf/Deque.h> #include <wtf/FastMalloc.h> @@ -157,7 +158,7 @@ void WebSocketChannel::didOpen(SocketStreamHandle* handle) if (InspectorController* controller = m_context->inspectorController()) controller->willSendWebSocketHandshakeRequest(identifier(), m_handshake.clientHandshakeRequest()); #endif - const CString& handshakeMessage = m_handshake.clientHandshakeMessage(); + CString handshakeMessage = m_handshake.clientHandshakeMessage(); if (!handle->send(handshakeMessage.data(), handshakeMessage.length())) { m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Error sending handshake message.", 0, m_handshake.clientOrigin()); handle->close(); @@ -246,7 +247,7 @@ bool WebSocketChannel::appendToBuffer(const char* data, size_t len) m_bufferSize = newBufferSize; return true; } - m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, String::format("WebSocket frame (at %lu bytes) is too long.", static_cast<unsigned long>(newBufferSize)), 0, m_handshake.clientOrigin()); + m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, makeString("WebSocket frame (at ", String::number(static_cast<unsigned long>(newBufferSize)), " bytes) is too long."), 0, m_handshake.clientOrigin()); return false; } diff --git a/WebCore/websockets/WebSocketHandshake.cpp b/WebCore/websockets/WebSocketHandshake.cpp index effbb67..5049098 100644 --- a/WebCore/websockets/WebSocketHandshake.cpp +++ b/WebCore/websockets/WebSocketHandshake.cpp @@ -43,7 +43,6 @@ #include "Logging.h" #include "ScriptExecutionContext.h" #include "SecurityOrigin.h" -#include "StringBuilder.h" #include <wtf/MD5.h> #include <wtf/RandomNumber.h> @@ -52,6 +51,8 @@ #include <wtf/Vector.h> #include <wtf/text/AtomicString.h> #include <wtf/text/CString.h> +#include <wtf/text/StringBuilder.h> +#include <wtf/text/StringConcatenate.h> namespace WebCore { @@ -75,7 +76,7 @@ static String hostName(const KURL& url, bool secure) StringBuilder builder; builder.append(url.host().lower()); if (url.port() && ((!secure && url.port() != 80) || (secure && url.port() != 443))) { - builder.append(":"); + builder.append(':'); builder.append(String::number(url.port())); } return builder.toString(); @@ -318,7 +319,7 @@ int WebSocketHandshake::readServerHandshake(const char* header, size_t len) m_response.setStatusText(statusText); if (statusCode != 101) { m_mode = Failed; - m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, String::format("Unexpected response code: %d", statusCode), 0, clientOrigin()); + m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, makeString("Unexpected response code: ", String::number(statusCode)), 0, clientOrigin()); return len; } m_mode = Normal; |