Commit 6333a9c9 authored by Adam Rice's avatar Adam Rice Committed by Commit Bot

Remove DOMWebSocket::SubprotocolSeperator method

It is a static method which returns a constant ", " string, and which is
only used inside the implementation of DOMWebSocket. Replace it with a
compile-time constant.

Change-Id: I1bb9ab48421394e6b3f759536d53a56888a3af8f
Reviewed-on: https://chromium-review.googlesource.com/1151170Reviewed-by: default avatarYutaka Hirano <yhirano@chromium.org>
Commit-Queue: Adam Rice <ricea@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578519}
parent 45b9e0af
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
static const size_t kMaxByteSizeForHistogram = 100 * 1000 * 1000; static const size_t kMaxByteSizeForHistogram = 100 * 1000 * 1000;
static const int32_t kBucketCountForMessageSizeHistogram = 50; static const int32_t kBucketCountForMessageSizeHistogram = 50;
static const char kWebSocketSubprotocolSeparator[] = ", ";
namespace blink { namespace blink {
...@@ -215,10 +216,6 @@ static void SetInvalidStateErrorForSendMethod(ExceptionState& exception_state) { ...@@ -215,10 +216,6 @@ static void SetInvalidStateErrorForSendMethod(ExceptionState& exception_state) {
"Still in CONNECTING state."); "Still in CONNECTING state.");
} }
const char* DOMWebSocket::SubprotocolSeperator() {
return ", ";
}
DOMWebSocket::DOMWebSocket(ExecutionContext* context) DOMWebSocket::DOMWebSocket(ExecutionContext* context)
: PausableObject(context), : PausableObject(context),
state_(kConnecting), state_(kConnecting),
...@@ -375,7 +372,7 @@ void DOMWebSocket::Connect(const String& url, ...@@ -375,7 +372,7 @@ void DOMWebSocket::Connect(const String& url,
String protocol_string; String protocol_string;
if (!protocols.IsEmpty()) if (!protocols.IsEmpty())
protocol_string = JoinStrings(protocols, SubprotocolSeperator()); protocol_string = JoinStrings(protocols, kWebSocketSubprotocolSeparator);
origin_string_ = SecurityOrigin::Create(url_)->ToString(); origin_string_ = SecurityOrigin::Create(url_)->ToString();
channel_ = CreateChannel(GetExecutionContext(), this); channel_ = CreateChannel(GetExecutionContext(), this);
......
...@@ -69,7 +69,6 @@ class MODULES_EXPORT DOMWebSocket : public EventTargetWithInlineData, ...@@ -69,7 +69,6 @@ class MODULES_EXPORT DOMWebSocket : public EventTargetWithInlineData,
USING_GARBAGE_COLLECTED_MIXIN(DOMWebSocket); USING_GARBAGE_COLLECTED_MIXIN(DOMWebSocket);
public: public:
static const char* SubprotocolSeperator();
// DOMWebSocket instances must be used with a wrapper since this class's // DOMWebSocket instances must be used with a wrapper since this class's
// lifetime management is designed assuming the V8 holds a ref on it while // lifetime management is designed assuming the V8 holds a ref on it while
// hasPendingActivity() returns true. // hasPendingActivity() returns true.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment