Bug 61115
Summary: | WebSocket: Refactor WebSocket error reports | ||
---|---|---|---|
Product: | WebKit | Reporter: | Yuta Kitamura <yutak> |
Component: | WebCore Misc. | Assignee: | Yuta Kitamura <yutak> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | ap, tkent, ukai |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | All | ||
OS: | All | ||
Bug Depends on: | 61277, 61353, 61841 | ||
Bug Blocks: |
Yuta Kitamura
Currently, the codes that report WebSocket errors to JavaScript console are scaterred among various places in WebCore. This sounds ad-hoc, and could be improved.
We could add a function to WebSocketChannel (and ThreadableWebSocketChannel, WorkerThreadableWebSocketChannel) that corresponds to "fail the WebSocket connection" algorithm in the WebSocket protocol specification (*1), like:
class WebSocketChannel
{
...
void fail(const String& errorMessage); // Log the error to JavaScript console, and do close().
...
};
... and use it in places where we need to "fail the WebSocket connection". I think this change will make the code more readable and easier to track.
(*1) In the WebSocket protocol specification, an algorithm called "fail the WebSocket connection" is defined:
http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-00#section-6.1
Certain algorithms require the user agent to *fail the WebSocket
connection*. To do so, the user agent must close the WebSocket
connection, and may report the problem to the user (which would be
especially useful for developers).
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Yuta Kitamura
This is done!