| 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 CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TCP_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TCP_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TCP_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TCP_H_ |
| 7 | 7 |
| 8 #include <queue> | 8 #include <queue> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 void DoWrite(); | 74 void DoWrite(); |
| 75 void HandleWriteResult(int result); | 75 void HandleWriteResult(int result); |
| 76 | 76 |
| 77 // Callbacks for Connect(), Read() and Write(). | 77 // Callbacks for Connect(), Read() and Write(). |
| 78 void OnConnected(int result); | 78 void OnConnected(int result); |
| 79 void OnRead(int result); | 79 void OnRead(int result); |
| 80 void OnWritten(int result); | 80 void OnWritten(int result); |
| 81 | 81 |
| 82 // Helper method to send socket create message and start read. | 82 // Helper method to send socket create message and start read. |
| 83 void OnOpen(); | 83 void OnOpen(); |
| 84 void DoSendSocketCreateMsg(); | 84 bool DoSendSocketCreateMsg(); |
| 85 | 85 |
| 86 P2PHostAndIPEndPoint remote_address_; | 86 P2PHostAndIPEndPoint remote_address_; |
| 87 | 87 |
| 88 scoped_ptr<net::StreamSocket> socket_; | 88 scoped_ptr<net::StreamSocket> socket_; |
| 89 scoped_refptr<net::GrowableIOBuffer> read_buffer_; | 89 scoped_refptr<net::GrowableIOBuffer> read_buffer_; |
| 90 std::queue<scoped_refptr<net::DrainableIOBuffer> > write_queue_; | 90 std::queue<scoped_refptr<net::DrainableIOBuffer> > write_queue_; |
| 91 scoped_refptr<net::DrainableIOBuffer> write_buffer_; | 91 scoped_refptr<net::DrainableIOBuffer> write_buffer_; |
| 92 | 92 |
| 93 bool write_pending_; | 93 bool write_pending_; |
| 94 | 94 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 private: | 139 private: |
| 140 int GetExpectedPacketSize(const char* data, int len, int* pad_bytes); | 140 int GetExpectedPacketSize(const char* data, int len, int* pad_bytes); |
| 141 | 141 |
| 142 DISALLOW_COPY_AND_ASSIGN(P2PSocketHostStunTcp); | 142 DISALLOW_COPY_AND_ASSIGN(P2PSocketHostStunTcp); |
| 143 }; | 143 }; |
| 144 | 144 |
| 145 | 145 |
| 146 } // namespace content | 146 } // namespace content |
| 147 | 147 |
| 148 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TCP_H_ | 148 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TCP_H_ |
| OLD | NEW |