OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "modules/websockets/WebSocketHandleImpl.h" | 5 #include "modules/websockets/WebSocketHandleImpl.h" |
6 | 6 |
7 #include "modules/websockets/WebSocketHandleClient.h" | 7 #include "modules/websockets/WebSocketHandleClient.h" |
8 #include "platform/WebTaskRunner.h" | 8 #include "platform/WebTaskRunner.h" |
9 #include "platform/network/NetworkLog.h" | 9 #include "platform/network/NetworkLog.h" |
10 #include "platform/network/WebSocketHandshakeRequest.h" | 10 #include "platform/network/WebSocketHandshakeRequest.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 if (m_websocket) | 35 if (m_websocket) |
36 m_websocket->StartClosingHandshake(kAbnormalShutdownOpCode, emptyString()); | 36 m_websocket->StartClosingHandshake(kAbnormalShutdownOpCode, emptyString()); |
37 } | 37 } |
38 | 38 |
39 void WebSocketHandleImpl::initialize(InterfaceProvider* interfaceProvider) { | 39 void WebSocketHandleImpl::initialize(InterfaceProvider* interfaceProvider) { |
40 NETWORK_DVLOG(1) << this << " initialize(...)"; | 40 NETWORK_DVLOG(1) << this << " initialize(...)"; |
41 | 41 |
42 DCHECK(!m_websocket); | 42 DCHECK(!m_websocket); |
43 interfaceProvider->getInterface(mojo::GetProxy(&m_websocket)); | 43 interfaceProvider->getInterface(mojo::GetProxy(&m_websocket)); |
44 | 44 |
45 m_websocket.set_connection_error_with_reason_handler(convertToBaseCallback( | 45 m_websocket.set_connection_error_with_reason_handler( |
46 WTF::bind(&WebSocketHandleImpl::onConnectionError, unretained(this)))); | 46 convertToBaseCallback(WTF::bind(&WebSocketHandleImpl::onConnectionError, |
| 47 WTF::unretained(this)))); |
47 } | 48 } |
48 | 49 |
49 void WebSocketHandleImpl::connect(const KURL& url, | 50 void WebSocketHandleImpl::connect(const KURL& url, |
50 const Vector<String>& protocols, | 51 const Vector<String>& protocols, |
51 SecurityOrigin* origin, | 52 SecurityOrigin* origin, |
52 const KURL& firstPartyForCookies, | 53 const KURL& firstPartyForCookies, |
53 const String& userAgentOverride, | 54 const String& userAgentOverride, |
54 WebSocketHandleClient* client) { | 55 WebSocketHandleClient* client) { |
55 DCHECK(m_websocket); | 56 DCHECK(m_websocket); |
56 | 57 |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 void WebSocketHandleImpl::OnClosingHandshake() { | 262 void WebSocketHandleImpl::OnClosingHandshake() { |
262 NETWORK_DVLOG(1) << this << " OnClosingHandshake()"; | 263 NETWORK_DVLOG(1) << this << " OnClosingHandshake()"; |
263 if (!m_client) | 264 if (!m_client) |
264 return; | 265 return; |
265 | 266 |
266 m_client->didStartClosingHandshake(this); | 267 m_client->didStartClosingHandshake(this); |
267 // |this| can be deleted here. | 268 // |this| can be deleted here. |
268 } | 269 } |
269 | 270 |
270 } // namespace blink | 271 } // namespace blink |
OLD | NEW |