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

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: 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
Index: Source/modules/websockets/WebSocket.cpp
diff --git a/Source/modules/websockets/WebSocket.cpp b/Source/modules/websockets/WebSocket.cpp
index 5f4617538711a4378cb11722f8d29c61d8cc9e38..cf5f3175125842cebbb484694db8f843d817c800 100644
--- a/Source/modules/websockets/WebSocket.cpp
+++ b/Source/modules/websockets/WebSocket.cpp
@@ -62,8 +62,6 @@
#include "wtf/text/StringBuilder.h"
#include "wtf/text/WTFString.h"
-using namespace std;
-
namespace WebCore {
WebSocket::EventQueue::EventQueue(EventTarget* target)
@@ -173,7 +171,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;
@@ -211,8 +209,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;
}
@@ -319,7 +317,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])) {

Powered by Google App Engine
This is Rietveld 408576698