Index: Source/modules/websockets/WebSocketChannel.h |
diff --git a/Source/modules/websockets/WebSocketChannel.h b/Source/modules/websockets/WebSocketChannel.h |
index 49f14bfadf204d1c93fdb62b7f01f7169f054777..df4242a715df7b5a85e57bd3232591cc5984dbf3 100644 |
--- a/Source/modules/websockets/WebSocketChannel.h |
+++ b/Source/modules/websockets/WebSocketChannel.h |
@@ -31,9 +31,14 @@ |
#ifndef WebSocketChannel_h |
#define WebSocketChannel_h |
+#include "core/inspector/ScriptCallFrame.h" |
+#include "core/inspector/ScriptCallStack.h" |
+#include "core/page/ConsoleTypes.h" |
#include "wtf/Forward.h" |
#include "wtf/Noncopyable.h" |
+#include "wtf/PassOwnPtr.h" |
#include "wtf/PassRefPtr.h" |
+#include "wtf/Vector.h" |
namespace WebCore { |
@@ -73,6 +78,15 @@ public: |
CloseEventCodeMaximumUserDefined = 4999 |
}; |
tyoshino (SeeGerritForStatus)
2013/05/01 11:41:52
// A holder class for Vector<ScriptCallFrame> for
yhirano
2013/05/02 02:04:58
Done.
|
+ class CallStackWrapper { |
+ public: |
+ CallStackWrapper(const Vector<ScriptCallFrame>& frames): m_frames(frames) { } |
+ PassRefPtr<ScriptCallStack> callStack() { return ScriptCallStack::create(m_frames); } |
+ |
+ private: |
+ Vector<ScriptCallFrame> m_frames; |
+ }; |
+ |
virtual void connect(const KURL&, const String& protocol) = 0; |
virtual String subprotocol() = 0; // Will be available after didConnect() callback is invoked. |
virtual String extensions() = 0; // Will be available after didConnect() callback is invoked. |
@@ -81,8 +95,18 @@ public: |
virtual SendResult send(const Blob&) = 0; |
virtual unsigned long bufferedAmount() const = 0; |
virtual void close(int code, const String& reason) = 0; |
+ |
// Log the reason text and close the connection. Will call didClose(). |
- virtual void fail(const String& reason) = 0; |
+ // The MessageLevel parameter will be used for the level of the message shown at the devtool console. |
+ // The CallStackWrapper parameter is callstack information. it may be shown with the reason text at the devtool console. |
+ // If the parameter is null, the instance may fill the callstack information and show it with the reason text if possible. |
+ virtual void fail(const String& reason, MessageLevel, PassOwnPtr<CallStackWrapper>) = 0; |
+ |
+ // Log the reason text and close the connection. Will call didClose(). |
+ // The MessageLevel parameter will be used for the level of the message shown at the devtool console. |
+ // The instance may fill the callstack information and show it with the reason text if possible. |
+ virtual void fail(const String& reason, MessageLevel) = 0; |
+ |
virtual void disconnect() = 0; // Will suppress didClose(). |
virtual void suspend() = 0; |