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 24 matching lines...) Expand all Loading... |
35 #include "core/dom/Document.h" | 35 #include "core/dom/Document.h" |
36 #include "core/frame/ConsoleTypes.h" | 36 #include "core/frame/ConsoleTypes.h" |
37 #include "modules/websockets/MainThreadWebSocketChannel.h" | 37 #include "modules/websockets/MainThreadWebSocketChannel.h" |
38 #include "modules/websockets/NewWebSocketChannelImpl.h" | 38 #include "modules/websockets/NewWebSocketChannelImpl.h" |
39 #include "modules/websockets/WebSocketChannel.h" | 39 #include "modules/websockets/WebSocketChannel.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 "wtf/ArrayBuffer.h" | 44 #include "wtf/ArrayBuffer.h" |
| 45 #include "wtf/text/WTFString.h" |
45 | 46 |
46 using namespace WebCore; | 47 using namespace WebCore; |
47 | 48 |
48 namespace blink { | 49 namespace blink { |
49 | 50 |
50 WebSocketImpl::WebSocketImpl(const WebDocument& document, WebSocketClient* clien
t) | 51 WebSocketImpl::WebSocketImpl(const WebDocument& document, WebSocketClient* clien
t) |
51 : m_client(client) | 52 : m_client(client) |
52 , m_binaryType(BinaryTypeBlob) | 53 , m_binaryType(BinaryTypeBlob) |
53 { | 54 { |
54 RefPtrWillBeRawPtr<Document> coreDocument = PassRefPtrWillBeRawPtr<Document>
(document); | 55 RefPtrWillBeRawPtr<Document> coreDocument = PassRefPtrWillBeRawPtr<Document>
(document); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 return m_private->bufferedAmount(); | 108 return m_private->bufferedAmount(); |
108 } | 109 } |
109 | 110 |
110 void WebSocketImpl::close(int code, const WebString& reason) | 111 void WebSocketImpl::close(int code, const WebString& reason) |
111 { | 112 { |
112 m_private->close(code, reason); | 113 m_private->close(code, reason); |
113 } | 114 } |
114 | 115 |
115 void WebSocketImpl::fail(const WebString& reason) | 116 void WebSocketImpl::fail(const WebString& reason) |
116 { | 117 { |
117 m_private->fail(reason, ErrorMessageLevel); | 118 m_private->fail(reason, ErrorMessageLevel, String(), 0); |
118 } | 119 } |
119 | 120 |
120 void WebSocketImpl::disconnect() | 121 void WebSocketImpl::disconnect() |
121 { | 122 { |
122 m_private->disconnect(); | 123 m_private->disconnect(); |
123 m_client = 0; | 124 m_client = 0; |
124 } | 125 } |
125 | 126 |
126 void WebSocketImpl::didConnect() | 127 void WebSocketImpl::didConnect() |
127 { | 128 { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 { | 160 { |
160 m_client->didStartClosingHandshake(); | 161 m_client->didStartClosingHandshake(); |
161 } | 162 } |
162 | 163 |
163 void WebSocketImpl::didClose(unsigned long bufferedAmount, ClosingHandshakeCompl
etionStatus status, unsigned short code, const String& reason) | 164 void WebSocketImpl::didClose(unsigned long bufferedAmount, ClosingHandshakeCompl
etionStatus status, unsigned short code, const String& reason) |
164 { | 165 { |
165 m_client->didClose(bufferedAmount, static_cast<WebSocketClient::ClosingHands
hakeCompletionStatus>(status), code, WebString(reason)); | 166 m_client->didClose(bufferedAmount, static_cast<WebSocketClient::ClosingHands
hakeCompletionStatus>(status), code, WebString(reason)); |
166 } | 167 } |
167 | 168 |
168 } // namespace blink | 169 } // namespace blink |
OLD | NEW |