OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/test/chromedriver/net/websocket.h" | 5 #include "chrome/test/chromedriver/net/websocket.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
11 #include "base/rand_util.h" | 11 #include "base/rand_util.h" |
12 #include "base/sha1.h" | 12 #include "base/sha1.h" |
13 #include "base/stringprintf.h" | |
14 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
| 14 #include "base/strings/stringprintf.h" |
15 #include "net/base/address_list.h" | 15 #include "net/base/address_list.h" |
16 #include "net/base/io_buffer.h" | 16 #include "net/base/io_buffer.h" |
17 #include "net/base/ip_endpoint.h" | 17 #include "net/base/ip_endpoint.h" |
18 #include "net/base/net_errors.h" | 18 #include "net/base/net_errors.h" |
19 #include "net/base/net_util.h" | 19 #include "net/base/net_util.h" |
20 #include "net/http/http_response_headers.h" | 20 #include "net/http/http_response_headers.h" |
21 #include "net/http/http_util.h" | 21 #include "net/http/http_util.h" |
22 #include "net/websockets/websocket_frame.h" | 22 #include "net/websockets/websocket_frame.h" |
23 | 23 |
24 WebSocket::WebSocket(const GURL& url, WebSocketListener* listener) | 24 WebSocket::WebSocket(const GURL& url, WebSocketListener* listener) |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 socket_->Disconnect(); | 216 socket_->Disconnect(); |
217 if (!connect_callback_.is_null()) | 217 if (!connect_callback_.is_null()) |
218 InvokeConnectCallback(code); | 218 InvokeConnectCallback(code); |
219 if (state_ == OPEN) | 219 if (state_ == OPEN) |
220 listener_->OnClose(); | 220 listener_->OnClose(); |
221 | 221 |
222 state_ = CLOSED; | 222 state_ = CLOSED; |
223 } | 223 } |
224 | 224 |
225 | 225 |
OLD | NEW |