Chromium Code Reviews| Index: Source/modules/websockets/MainThreadWebSocketChannel.h |
| diff --git a/Source/modules/websockets/MainThreadWebSocketChannel.h b/Source/modules/websockets/MainThreadWebSocketChannel.h |
| index 4f5a49917142e54611ae8f2af3aec7e043770e05..485701d6ef014bf279a136b46c604ea9523c8312 100644 |
| --- a/Source/modules/websockets/MainThreadWebSocketChannel.h |
| +++ b/Source/modules/websockets/MainThreadWebSocketChannel.h |
| @@ -33,6 +33,7 @@ |
| #include "core/fileapi/FileReaderLoaderClient.h" |
| #include "core/inspector/ScriptCallFrame.h" |
| +#include "core/page/ConsoleTypes.h" |
| #include "core/platform/Timer.h" |
| #include "core/platform/network/SocketStreamHandleClient.h" |
| #include "modules/websockets/WebSocketChannel.h" |
| @@ -41,6 +42,7 @@ |
| #include "modules/websockets/WebSocketHandshake.h" |
| #include "wtf/Deque.h" |
| #include "wtf/Forward.h" |
| +#include "wtf/PassOwnPtr.h" |
| #include "wtf/RefCounted.h" |
| #include "wtf/Vector.h" |
| #include "wtf/text/CString.h" |
| @@ -59,6 +61,7 @@ class MainThreadWebSocketChannel : public RefCounted<MainThreadWebSocketChannel> |
| WTF_MAKE_FAST_ALLOCATED; |
| public: |
| static PassRefPtr<MainThreadWebSocketChannel> create(Document* document, WebSocketChannelClient* client) { return adoptRef(new MainThreadWebSocketChannel(document, client)); } |
| + static PassRefPtr<MainThreadWebSocketChannel> create(Document* document, WebSocketChannelClient* client, const ScriptCallFrame& frame) { return adoptRef(new MainThreadWebSocketChannel(document, client, frame)); } |
| virtual ~MainThreadWebSocketChannel(); |
| bool send(const char* data, int length); |
| @@ -74,7 +77,9 @@ public: |
| // Start closing handshake. Use the CloseEventCodeNotSpecified for the code |
| // argument to omit payload. |
| virtual void close(int code, const String& reason) OVERRIDE; |
| - virtual void fail(const String& reason) OVERRIDE; |
| + void fail(const String& reason) { fail(reason, ErrorMessageLevel); } |
|
tyoshino (SeeGerritForStatus)
2013/05/01 08:03:23
how about renaming this to failAsError and make th
yhirano
2013/05/01 09:31:44
Done.
|
| + virtual void fail(const String& reason, MessageLevel) OVERRIDE; |
| + virtual void fail(const String& reason, MessageLevel, PassOwnPtr<CallStackWrapper>) OVERRIDE; |
|
tyoshino (SeeGerritForStatus)
2013/05/01 08:03:23
Comment what this method is for.
yhirano
2013/05/01 09:31:44
Wrote the method description in WebSocketChannel.h
|
| virtual void disconnect() OVERRIDE; |
| virtual void suspend() OVERRIDE; |
| @@ -104,6 +109,7 @@ protected: |
| private: |
| MainThreadWebSocketChannel(Document*, WebSocketChannelClient*); |
| + MainThreadWebSocketChannel(Document*, WebSocketChannelClient*, const ScriptCallFrame&); |
| bool appendToBuffer(const char* data, size_t len); |
| void skipBuffer(size_t len); |
| @@ -111,6 +117,7 @@ private: |
| void resumeTimerFired(Timer<MainThreadWebSocketChannel>*); |
| void startClosingHandshake(int code, const String& reason); |
| void closingTimerFired(Timer<MainThreadWebSocketChannel>*); |
| + void failInternal(); |
| bool processFrame(); |