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 #ifndef GOOGLE_APIS_GCM_ENGINE_CONNECTION_HANDLER_IMPL_H_ | 5 #ifndef GOOGLE_APIS_GCM_ENGINE_CONNECTION_HANDLER_IMPL_H_ |
6 #define GOOGLE_APIS_GCM_ENGINE_CONNECTION_HANDLER_IMPL_H_ | 6 #define GOOGLE_APIS_GCM_ENGINE_CONNECTION_HANDLER_IMPL_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // Closes the current connection. | 86 // Closes the current connection. |
87 void CloseConnection(); | 87 void CloseConnection(); |
88 | 88 |
89 // Timeout policy: the timeout is only enforced while waiting on the | 89 // Timeout policy: the timeout is only enforced while waiting on the |
90 // handshake (version and/or LoginResponse) or once at least a tag packet has | 90 // handshake (version and/or LoginResponse) or once at least a tag packet has |
91 // been received. It is reset every time new data is received, and is | 91 // been received. It is reset every time new data is received, and is |
92 // only stopped when a full message is processed. | 92 // only stopped when a full message is processed. |
93 // TODO(zea): consider enforcing a separate timeout when waiting for | 93 // TODO(zea): consider enforcing a separate timeout when waiting for |
94 // a message to send. | 94 // a message to send. |
95 const base::TimeDelta read_timeout_; | 95 const base::TimeDelta read_timeout_; |
96 base::OneShotTimer<ConnectionHandlerImpl> read_timeout_timer_; | 96 base::OneShotTimer read_timeout_timer_; |
97 | 97 |
98 // This connection's socket and the input/output streams attached to it. | 98 // This connection's socket and the input/output streams attached to it. |
99 net::StreamSocket* socket_; | 99 net::StreamSocket* socket_; |
100 scoped_ptr<SocketInputStream> input_stream_; | 100 scoped_ptr<SocketInputStream> input_stream_; |
101 scoped_ptr<SocketOutputStream> output_stream_; | 101 scoped_ptr<SocketOutputStream> output_stream_; |
102 | 102 |
103 // Whether the MCS login handshake has successfully completed. See Init(..) | 103 // Whether the MCS login handshake has successfully completed. See Init(..) |
104 // description for more info on what the handshake involves. | 104 // description for more info on what the handshake involves. |
105 bool handshake_complete_; | 105 bool handshake_complete_; |
106 | 106 |
(...skipping 15 matching lines...) Expand all Loading... |
122 std::vector<uint8> payload_input_buffer_; | 122 std::vector<uint8> payload_input_buffer_; |
123 | 123 |
124 base::WeakPtrFactory<ConnectionHandlerImpl> weak_ptr_factory_; | 124 base::WeakPtrFactory<ConnectionHandlerImpl> weak_ptr_factory_; |
125 | 125 |
126 DISALLOW_COPY_AND_ASSIGN(ConnectionHandlerImpl); | 126 DISALLOW_COPY_AND_ASSIGN(ConnectionHandlerImpl); |
127 }; | 127 }; |
128 | 128 |
129 } // namespace gcm | 129 } // namespace gcm |
130 | 130 |
131 #endif // GOOGLE_APIS_GCM_ENGINE_CONNECTION_HANDLER_IMPL_H_ | 131 #endif // GOOGLE_APIS_GCM_ENGINE_CONNECTION_HANDLER_IMPL_H_ |
OLD | NEW |