OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 28 matching lines...) Expand all Loading... |
39 #include "platform/RuntimeEnabledFeatures.h" | 39 #include "platform/RuntimeEnabledFeatures.h" |
40 #include "public/platform/WebArrayBuffer.h" | 40 #include "public/platform/WebArrayBuffer.h" |
41 #include "public/platform/WebString.h" | 41 #include "public/platform/WebString.h" |
42 #include "public/platform/WebURL.h" | 42 #include "public/platform/WebURL.h" |
43 #include "public/web/WebDocument.h" | 43 #include "public/web/WebDocument.h" |
44 #include "web/WebSocketChannelClientProxy.h" | 44 #include "web/WebSocketChannelClientProxy.h" |
45 #include "wtf/ArrayBuffer.h" | 45 #include "wtf/ArrayBuffer.h" |
46 #include "wtf/text/CString.h" | 46 #include "wtf/text/CString.h" |
47 #include "wtf/text/WTFString.h" | 47 #include "wtf/text/WTFString.h" |
48 | 48 |
49 using namespace blink; | |
50 | |
51 namespace blink { | 49 namespace blink { |
52 | 50 |
53 WebSocketImpl::WebSocketImpl(const WebDocument& document, WebSocketClient* clien
t) | 51 WebSocketImpl::WebSocketImpl(const WebDocument& document, WebSocketClient* clien
t) |
54 : m_client(client) | 52 : m_client(client) |
55 , m_channelProxy(WebSocketChannelClientProxy::create(this)) | 53 , m_channelProxy(WebSocketChannelClientProxy::create(this)) |
56 , m_binaryType(BinaryTypeBlob) | 54 , m_binaryType(BinaryTypeBlob) |
57 , m_isClosingOrClosed(false) | 55 , m_isClosingOrClosed(false) |
58 , m_bufferedAmount(0) | 56 , m_bufferedAmount(0) |
59 , m_bufferedAmountAfterClose(0) | 57 , m_bufferedAmountAfterClose(0) |
60 { | 58 { |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 void WebSocketImpl::didClose(WebSocketChannelClient::ClosingHandshakeCompletionS
tatus status, unsigned short code, const String& reason) | 202 void WebSocketImpl::didClose(WebSocketChannelClient::ClosingHandshakeCompletionS
tatus status, unsigned short code, const String& reason) |
205 { | 203 { |
206 m_isClosingOrClosed = true; | 204 m_isClosingOrClosed = true; |
207 m_client->didClose(static_cast<WebSocketClient::ClosingHandshakeCompletionSt
atus>(status), code, WebString(reason)); | 205 m_client->didClose(static_cast<WebSocketClient::ClosingHandshakeCompletionSt
atus>(status), code, WebString(reason)); |
208 | 206 |
209 // FIXME: Deprecate this call. | 207 // FIXME: Deprecate this call. |
210 m_client->didClose(m_bufferedAmount - m_bufferedAmountAfterClose, static_cas
t<WebSocketClient::ClosingHandshakeCompletionStatus>(status), code, WebString(re
ason)); | 208 m_client->didClose(m_bufferedAmount - m_bufferedAmountAfterClose, static_cas
t<WebSocketClient::ClosingHandshakeCompletionStatus>(status), code, WebString(re
ason)); |
211 } | 209 } |
212 | 210 |
213 } // namespace blink | 211 } // namespace blink |
OLD | NEW |