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 22 matching lines...) Expand all Loading... |
33 NETWORK_DVLOG(1) << this << " deleted"; | 33 NETWORK_DVLOG(1) << this << " deleted"; |
34 | 34 |
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::MakeRequest(&m_websocket)); |
44 | 44 |
45 m_websocket.set_connection_error_with_reason_handler( | 45 m_websocket.set_connection_error_with_reason_handler( |
46 convertToBaseCallback(WTF::bind(&WebSocketHandleImpl::onConnectionError, | 46 convertToBaseCallback(WTF::bind(&WebSocketHandleImpl::onConnectionError, |
47 WTF::unretained(this)))); | 47 WTF::unretained(this)))); |
48 } | 48 } |
49 | 49 |
50 void WebSocketHandleImpl::connect(const KURL& url, | 50 void WebSocketHandleImpl::connect(const KURL& url, |
51 const Vector<String>& protocols, | 51 const Vector<String>& protocols, |
52 SecurityOrigin* origin, | 52 SecurityOrigin* origin, |
53 const KURL& firstPartyForCookies, | 53 const KURL& firstPartyForCookies, |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 void WebSocketHandleImpl::OnClosingHandshake() { | 262 void WebSocketHandleImpl::OnClosingHandshake() { |
263 NETWORK_DVLOG(1) << this << " OnClosingHandshake()"; | 263 NETWORK_DVLOG(1) << this << " OnClosingHandshake()"; |
264 if (!m_client) | 264 if (!m_client) |
265 return; | 265 return; |
266 | 266 |
267 m_client->didStartClosingHandshake(this); | 267 m_client->didStartClosingHandshake(this); |
268 // |this| can be deleted here. | 268 // |this| can be deleted here. |
269 } | 269 } |
270 | 270 |
271 } // namespace blink | 271 } // namespace blink |
OLD | NEW |