| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef NET_SOCKET_WEBSOCKET_TRANSPORT_CONNECT_SUB_JOB_H_ | 5 #ifndef NET_SOCKET_WEBSOCKET_TRANSPORT_CONNECT_SUB_JOB_H_ |
| 6 #define NET_SOCKET_WEBSOCKET_TRANSPORT_CONNECT_SUB_JOB_H_ | 6 #define NET_SOCKET_WEBSOCKET_TRANSPORT_CONNECT_SUB_JOB_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <utility> |
| 9 | 10 |
| 10 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 12 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 13 #include "net/base/address_list.h" | 14 #include "net/base/address_list.h" |
| 14 #include "net/base/load_states.h" | 15 #include "net/base/load_states.h" |
| 15 #include "net/socket/websocket_endpoint_lock_manager.h" | 16 #include "net/socket/websocket_endpoint_lock_manager.h" |
| 16 #include "net/socket/websocket_transport_client_socket_pool.h" | 17 #include "net/socket/websocket_transport_client_socket_pool.h" |
| 17 | 18 |
| 18 namespace net { | 19 namespace net { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 39 | 40 |
| 40 // Start connecting. | 41 // Start connecting. |
| 41 int Start(); | 42 int Start(); |
| 42 | 43 |
| 43 bool started() { return next_state_ != STATE_NONE; } | 44 bool started() { return next_state_ != STATE_NONE; } |
| 44 | 45 |
| 45 LoadState GetLoadState() const; | 46 LoadState GetLoadState() const; |
| 46 | 47 |
| 47 SubJobType type() const { return type_; } | 48 SubJobType type() const { return type_; } |
| 48 | 49 |
| 49 scoped_ptr<StreamSocket> PassSocket() { return transport_socket_.Pass(); } | 50 scoped_ptr<StreamSocket> PassSocket() { return std::move(transport_socket_); } |
| 50 | 51 |
| 51 // Implementation of WebSocketEndpointLockManager::EndpointWaiter. | 52 // Implementation of WebSocketEndpointLockManager::EndpointWaiter. |
| 52 void GotEndpointLock() override; | 53 void GotEndpointLock() override; |
| 53 | 54 |
| 54 private: | 55 private: |
| 55 enum State { | 56 enum State { |
| 56 STATE_NONE, | 57 STATE_NONE, |
| 57 STATE_OBTAIN_LOCK, | 58 STATE_OBTAIN_LOCK, |
| 58 STATE_OBTAIN_LOCK_COMPLETE, | 59 STATE_OBTAIN_LOCK_COMPLETE, |
| 59 STATE_TRANSPORT_CONNECT, | 60 STATE_TRANSPORT_CONNECT, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 83 const SubJobType type_; | 84 const SubJobType type_; |
| 84 | 85 |
| 85 scoped_ptr<StreamSocket> transport_socket_; | 86 scoped_ptr<StreamSocket> transport_socket_; |
| 86 | 87 |
| 87 DISALLOW_COPY_AND_ASSIGN(WebSocketTransportConnectSubJob); | 88 DISALLOW_COPY_AND_ASSIGN(WebSocketTransportConnectSubJob); |
| 88 }; | 89 }; |
| 89 | 90 |
| 90 } // namespace net | 91 } // namespace net |
| 91 | 92 |
| 92 #endif // NET_SOCKET_WEBSOCKET_TRANSPORT_CONNECT_SUB_JOB_H_ | 93 #endif // NET_SOCKET_WEBSOCKET_TRANSPORT_CONNECT_SUB_JOB_H_ |
| OLD | NEW |