OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_STREAM_SOCKET_H_ | 5 #ifndef NET_SOCKET_STREAM_SOCKET_H_ |
6 #define NET_SOCKET_STREAM_SOCKET_H_ | 6 #define NET_SOCKET_STREAM_SOCKET_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "net/base/net_log.h" | 10 #include "net/base/net_log.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 // | 27 // |
28 // The socket's Read and Write methods may not be called until Connect | 28 // The socket's Read and Write methods may not be called until Connect |
29 // succeeds. | 29 // succeeds. |
30 // | 30 // |
31 // It is valid to call Connect on an already connected socket, in which case | 31 // It is valid to call Connect on an already connected socket, in which case |
32 // OK is simply returned. | 32 // OK is simply returned. |
33 // | 33 // |
34 // Connect may also be called again after a call to the Disconnect method. | 34 // Connect may also be called again after a call to the Disconnect method. |
35 // | 35 // |
36 virtual int Connect(OldCompletionCallback* callback) = 0; | 36 virtual int Connect(OldCompletionCallback* callback) = 0; |
| 37 virtual int Connect(const CompletionCallback& callback) = 0; |
37 | 38 |
38 // Called to disconnect a socket. Does nothing if the socket is already | 39 // Called to disconnect a socket. Does nothing if the socket is already |
39 // disconnected. After calling Disconnect it is possible to call Connect | 40 // disconnected. After calling Disconnect it is possible to call Connect |
40 // again to establish a new connection. | 41 // again to establish a new connection. |
41 // | 42 // |
42 // If IO (Connect, Read, or Write) is pending when the socket is | 43 // If IO (Connect, Read, or Write) is pending when the socket is |
43 // disconnected, the pending IO is cancelled, and the completion callback | 44 // disconnected, the pending IO is cancelled, and the completion callback |
44 // will not be called. | 45 // will not be called. |
45 virtual void Disconnect() = 0; | 46 virtual void Disconnect() = 0; |
46 | 47 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 // identify the motivation. | 126 // identify the motivation. |
126 bool omnibox_speculation_; | 127 bool omnibox_speculation_; |
127 bool subresource_speculation_; | 128 bool subresource_speculation_; |
128 DISALLOW_COPY_AND_ASSIGN(UseHistory); | 129 DISALLOW_COPY_AND_ASSIGN(UseHistory); |
129 }; | 130 }; |
130 }; | 131 }; |
131 | 132 |
132 } // namespace net | 133 } // namespace net |
133 | 134 |
134 #endif // NET_SOCKET_STREAM_SOCKET_H_ | 135 #endif // NET_SOCKET_STREAM_SOCKET_H_ |
OLD | NEW |