Chromium Code Reviews| Index: Source/modules/websockets/WebSocket.h |
| diff --git a/Source/modules/websockets/WebSocket.h b/Source/modules/websockets/WebSocket.h |
| index f48c0b52c105b1372df80e3e0d47200ecb617a9b..2ef0cbbfbedabe28775e3da9461183f0c05986df 100644 |
| --- a/Source/modules/websockets/WebSocket.h |
| +++ b/Source/modules/websockets/WebSocket.h |
| @@ -51,10 +51,10 @@ namespace WebCore { |
| class Blob; |
| class ExceptionState; |
| -class WebSocket FINAL : public RefCountedWillBeRefCountedGarbageCollected<WebSocket>, public ScriptWrappable, public EventTargetWithInlineData, public ActiveDOMObject, public WebSocketChannelClient { |
| +class WebSocket : public RefCountedWillBeRefCountedGarbageCollected<WebSocket>, public ScriptWrappable, public EventTargetWithInlineData, public ActiveDOMObject, public WebSocketChannelClient { |
| DEFINE_EVENT_TARGET_REFCOUNTING(RefCountedWillBeRefCountedGarbageCollected<WebSocket>); |
| public: |
| - static const char* subProtocolSeperator(); |
| + static const char* subprotocolSeperator(); |
| // WebSocket instances must be used with a wrapper since this class's |
| // lifetime management is designed assuming the V8 holds a ref on it while |
| // hasPendingActivity() returns true. |
| @@ -125,6 +125,11 @@ public: |
| void trace(Visitor*); |
|
haraken
2014/05/27 04:35:08
You need to make this a virtual method.
yhirano
2014/05/27 05:03:02
Done.
haraken
2014/05/27 05:23:56
Ian: Would it be possible to detect missing 'virtu
zerny-chromium
2014/05/27 08:26:28
Actually, is should already have issued an error f
|
| + static bool isValidSubprotocolString(const String&); |
| + |
| +protected: |
| + explicit WebSocket(ExecutionContext*); |
| + |
| private: |
| // FIXME: This should inherit WebCore::EventQueue. |
| class EventQueue FINAL : public RefCountedWillBeGarbageCollectedFinalized<EventQueue> { |
| @@ -176,7 +181,12 @@ private: |
| WebSocketSendTypeMax, |
| }; |
| - explicit WebSocket(ExecutionContext*); |
| + // This function is virtual for unittests. |
| + // FIXME: Move WebSocketChannel::create here. |
| + virtual PassRefPtrWillBeRawPtr<WebSocketChannel> createChannel(ExecutionContext* context, WebSocketChannelClient* client) |
| + { |
| + return WebSocketChannel::create(context, client); |
| + } |
| // Adds a console message with JSMessageSource and ErrorMessageLevel. |
| void logError(const String& message); |