OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 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 11 matching lines...) Expand all Loading... |
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
| 32 #include "SocketStreamError.h" |
32 #include "SocketStreamHandle.h" | 33 #include "SocketStreamHandle.h" |
33 #include "SocketStreamHandleInternal.h" | 34 #include "SocketStreamHandleInternal.h" |
34 | 35 |
35 #include "Logging.h" | 36 #include "Logging.h" |
36 #include "NotImplemented.h" | 37 #include "NotImplemented.h" |
37 #include "SocketStreamHandleClient.h" | 38 #include "SocketStreamHandleClient.h" |
38 #include <public/Platform.h> | 39 #include <public/Platform.h> |
39 #include <public/WebData.h> | 40 #include <public/WebData.h> |
| 41 #include <public/WebSocketStreamError.h> |
40 #include <public/WebSocketStreamHandle.h> | 42 #include <public/WebSocketStreamHandle.h> |
41 #include <wtf/PassOwnPtr.h> | 43 #include <wtf/PassOwnPtr.h> |
42 | 44 |
43 namespace WebCore { | 45 namespace WebCore { |
44 | 46 |
45 SocketStreamHandleInternal::SocketStreamHandleInternal(SocketStreamHandle* handl
e) | 47 SocketStreamHandleInternal::SocketStreamHandleInternal(SocketStreamHandle* handl
e) |
46 : m_handle(handle) | 48 : m_handle(handle) |
47 , m_maxPendingSendAllowed(0) | 49 , m_maxPendingSendAllowed(0) |
48 , m_pendingAmountSent(0) | 50 , m_pendingAmountSent(0) |
49 { | 51 { |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 if (h->m_client) | 148 if (h->m_client) |
147 h->m_client->didCloseSocketStream(h); | 149 h->m_client->didCloseSocketStream(h); |
148 } | 150 } |
149 } | 151 } |
150 | 152 |
151 void SocketStreamHandleInternal::didFail(WebKit::WebSocketStreamHandle* socketHa
ndle, const WebKit::WebSocketStreamError& err) | 153 void SocketStreamHandleInternal::didFail(WebKit::WebSocketStreamHandle* socketHa
ndle, const WebKit::WebSocketStreamError& err) |
152 { | 154 { |
153 LOG(Network, "SocketStreamHandleInternal %p didFail()", this); | 155 LOG(Network, "SocketStreamHandleInternal %p didFail()", this); |
154 if (m_handle && m_socket) { | 156 if (m_handle && m_socket) { |
155 ASSERT(socketHandle == m_socket.get()); | 157 ASSERT(socketHandle == m_socket.get()); |
156 m_socket.clear(); | 158 if (m_handle->m_client) |
157 SocketStreamHandle* h = m_handle; | 159 m_handle->m_client->didFailSocketStream(m_handle, *(PassRefPtr<Socke
tStreamError>(err))); |
158 m_handle = 0; | |
159 if (h->m_client) | |
160 h->m_client->didCloseSocketStream(h); // didFail(h, err); | |
161 } | 160 } |
162 } | 161 } |
163 | 162 |
164 // FIXME: auth | 163 // FIXME: auth |
165 | 164 |
166 // SocketStreamHandle ---------------------------------------------------------- | 165 // SocketStreamHandle ---------------------------------------------------------- |
167 | 166 |
168 SocketStreamHandle::SocketStreamHandle(const KURL& url, SocketStreamHandleClient
* client) | 167 SocketStreamHandle::SocketStreamHandle(const KURL& url, SocketStreamHandleClient
* client) |
169 : SocketStreamHandleBase(url, client) | 168 : SocketStreamHandleBase(url, client) |
170 { | 169 { |
(...skipping 30 matching lines...) Expand all Loading... |
201 { | 200 { |
202 notImplemented(); | 201 notImplemented(); |
203 } | 202 } |
204 | 203 |
205 void SocketStreamHandle::receivedRequestToContinueWithoutCredential(const Authen
ticationChallenge& challenge) | 204 void SocketStreamHandle::receivedRequestToContinueWithoutCredential(const Authen
ticationChallenge& challenge) |
206 { | 205 { |
207 notImplemented(); | 206 notImplemented(); |
208 } | 207 } |
209 | 208 |
210 } // namespace WebCore | 209 } // namespace WebCore |
OLD | NEW |