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

Unified Diff: Source/modules/websockets/WebSocket.cpp

Issue 298893008: Add WebSocket unittests. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/websockets/WebSocket.h ('k') | Source/modules/websockets/WebSocketHandshake.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/websockets/WebSocket.cpp
diff --git a/Source/modules/websockets/WebSocket.cpp b/Source/modules/websockets/WebSocket.cpp
index 658ae9a4792561fe39ce064a013a57e14753186c..ef518173008f623555f57fd6d2299825aa4a1251 100644
--- a/Source/modules/websockets/WebSocket.cpp
+++ b/Source/modules/websockets/WebSocket.cpp
@@ -61,8 +61,6 @@
#include "wtf/text/StringBuilder.h"
#include "wtf/text/WTFString.h"
-using namespace std;
-
namespace WebCore {
WebSocket::EventQueue::EventQueue(EventTarget* target)
@@ -172,7 +170,7 @@ static inline bool isValidSubprotocolCharacter(UChar character)
return character >= minimumProtocolCharacter && character <= maximumProtocolCharacter && isNotSeparator;
}
-static bool isValidSubprotocolString(const String& protocol)
+bool WebSocket::isValidSubprotocolString(const String& protocol)
{
if (protocol.isEmpty())
return false;
@@ -210,8 +208,8 @@ static String joinStrings(const Vector<String>& strings, const char* separator)
static unsigned long saturateAdd(unsigned long a, unsigned long b)
{
- if (numeric_limits<unsigned long>::max() - a < b)
- return numeric_limits<unsigned long>::max();
+ if (std::numeric_limits<unsigned long>::max() - a < b)
+ return std::numeric_limits<unsigned long>::max();
return a + b;
}
@@ -220,7 +218,7 @@ static void setInvalidStateErrorForSendMethod(ExceptionState& exceptionState)
exceptionState.throwDOMException(InvalidStateError, "Still in CONNECTING state.");
}
-const char* WebSocket::subProtocolSeperator()
+const char* WebSocket::subprotocolSeperator()
{
return ", ";
}
@@ -318,7 +316,7 @@ void WebSocket::connect(const String& url, const Vector<String>& protocols, Exce
return;
}
- m_channel = WebSocketChannel::create(executionContext(), this);
+ m_channel = createChannel(executionContext(), this);
for (size_t i = 0; i < protocols.size(); ++i) {
if (!isValidSubprotocolString(protocols[i])) {
@@ -340,7 +338,7 @@ void WebSocket::connect(const String& url, const Vector<String>& protocols, Exce
String protocolString;
if (!protocols.isEmpty())
- protocolString = joinStrings(protocols, subProtocolSeperator());
+ protocolString = joinStrings(protocols, subprotocolSeperator());
if (!m_channel->connect(m_url, protocolString)) {
m_state = CLOSED;
« no previous file with comments | « Source/modules/websockets/WebSocket.h ('k') | Source/modules/websockets/WebSocketHandshake.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698