Chromium Code Reviews| Index: Source/modules/websockets/NewWebSocketChannelImpl.cpp |
| diff --git a/Source/modules/websockets/NewWebSocketChannelImpl.cpp b/Source/modules/websockets/NewWebSocketChannelImpl.cpp |
| index c7f9e9baefebb695f4a25310e8cc5aeb7c57cccf..0a7fd8e477dd0eb9ded77dfd6bb2f75c5a069d32 100644 |
| --- a/Source/modules/websockets/NewWebSocketChannelImpl.cpp |
| +++ b/Source/modules/websockets/NewWebSocketChannelImpl.cpp |
| @@ -45,6 +45,7 @@ |
| #include "modules/websockets/WebSocketChannel.h" |
| #include "modules/websockets/WebSocketChannelClient.h" |
| #include "platform/Logging.h" |
| +#include "platform/NotImplemented.h" |
| #include "public/platform/Platform.h" |
| #include "public/platform/WebSocketHandle.h" |
| #include "public/platform/WebString.h" |
| @@ -256,8 +257,6 @@ void NewWebSocketChannelImpl::disconnect() |
| if (m_identifier) |
| InspectorInstrumentation::didCloseWebSocket(document(), m_identifier); |
| abortAsyncOperations(); |
| - if (m_handle) |
| - m_handle->close(CloseEventCodeAbnormalClosure, ""); |
| m_handle.clear(); |
| m_client = 0; |
| m_identifier = 0; |
| @@ -388,6 +387,15 @@ void NewWebSocketChannelImpl::didConnect(WebSocketHandle* handle, bool fail, con |
| m_client->didConnect(); |
| } |
| +void NewWebSocketChannelImpl::didFail(WebSocketHandle* handle, const WebKit::WebString& message) |
| +{ |
| + LOG(Network, "NewWebSocketChannelImpl %p didFail(%p, %s)", this, handle, message.utf8().data()); |
| + // FIXME: Hande the failure correctly. |
| + const unsigned short abnormalClosure = 1006; |
|
abarth-chromium
2013/10/31 17:54:49
Where does this number come from? If it's in the
yhirano
2013/11/01 03:51:47
Done.
|
| + didClose(handle, false, abnormalClosure, ""); |
| + // |this| may be deleted. |
| +} |
| + |
| void NewWebSocketChannelImpl::didReceiveData(WebSocketHandle* handle, bool fin, WebSocketHandle::MessageType type, const char* data, size_t size) |
| { |
| LOG(Network, "NewWebSocketChannelImpl %p didReceiveData(%p, %d, %d, (%p, %zu))", this, handle, fin, type, data, size); |
| @@ -439,9 +447,10 @@ void NewWebSocketChannelImpl::didReceiveData(WebSocketHandle* handle, bool fin, |
| } |
| } |
| -void NewWebSocketChannelImpl::didClose(WebSocketHandle* handle, unsigned short code, const WebKit::WebString& reason) |
| +void NewWebSocketChannelImpl::didClose(WebSocketHandle* handle, bool wasClean, unsigned short code, const WebKit::WebString& reason) |
| { |
| - LOG(Network, "NewWebSocketChannelImpl %p didClose(%p, %u, %s)", this, handle, code, String(reason).utf8().data()); |
| + // FIXME: Use |wasClean| appropriately. |
| + LOG(Network, "NewWebSocketChannelImpl %p didClose(%p, %d, %u, %s)", this, handle, wasClean, code, String(reason).utf8().data()); |
| ASSERT(m_handle); |
| m_handle.clear(); |
| if (m_identifier) { |