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 REMOTING_JINGLE_GLUE_SSL_SOCKET_ADAPTER_H_ | 5 #ifndef REMOTING_JINGLE_GLUE_SSL_SOCKET_ADAPTER_H_ |
6 #define REMOTING_JINGLE_GLUE_SSL_SOCKET_ADAPTER_H_ | 6 #define REMOTING_JINGLE_GLUE_SSL_SOCKET_ADAPTER_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "net/base/completion_callback.h" | 9 #include "net/base/completion_callback.h" |
10 #include "net/base/io_buffer.h" | 10 #include "net/base/io_buffer.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 virtual int64 NumBytesRead() const OVERRIDE; | 55 virtual int64 NumBytesRead() const OVERRIDE; |
56 virtual base::TimeDelta GetConnectTimeMicros() const OVERRIDE; | 56 virtual base::TimeDelta GetConnectTimeMicros() const OVERRIDE; |
57 | 57 |
58 // net::Socket implementation. | 58 // net::Socket implementation. |
59 virtual int Read(net::IOBuffer* buf, int buf_len, | 59 virtual int Read(net::IOBuffer* buf, int buf_len, |
60 net::OldCompletionCallback* callback) OVERRIDE; | 60 net::OldCompletionCallback* callback) OVERRIDE; |
61 virtual int Read(net::IOBuffer* buf, int buf_len, | 61 virtual int Read(net::IOBuffer* buf, int buf_len, |
62 const net::CompletionCallback& callback) OVERRIDE; | 62 const net::CompletionCallback& callback) OVERRIDE; |
63 virtual int Write(net::IOBuffer* buf, int buf_len, | 63 virtual int Write(net::IOBuffer* buf, int buf_len, |
64 net::OldCompletionCallback* callback) OVERRIDE; | 64 net::OldCompletionCallback* callback) OVERRIDE; |
65 virtual int Write(net::IOBuffer* buf, int buf_len, | |
66 const net::CompletionCallback& callback) OVERRIDE; | |
67 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; | 65 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; |
68 virtual bool SetSendBufferSize(int32 size) OVERRIDE; | 66 virtual bool SetSendBufferSize(int32 size) OVERRIDE; |
69 | 67 |
70 private: | 68 private: |
71 friend class SSLSocketAdapter; | 69 friend class SSLSocketAdapter; |
72 | 70 |
73 void OnReadEvent(talk_base::AsyncSocket* socket); | 71 void OnReadEvent(talk_base::AsyncSocket* socket); |
74 void OnWriteEvent(talk_base::AsyncSocket* socket); | 72 void OnWriteEvent(talk_base::AsyncSocket* socket); |
75 | 73 |
76 net::OldCompletionCallback* old_read_callback_; | 74 net::OldCompletionCallback* old_read_callback_; |
77 net::CompletionCallback read_callback_; | 75 net::CompletionCallback read_callback_; |
78 net::OldCompletionCallback* old_write_callback_; | 76 net::OldCompletionCallback* write_callback_; |
79 net::CompletionCallback write_callback_; | |
80 | 77 |
81 scoped_refptr<net::IOBuffer> read_buffer_; | 78 scoped_refptr<net::IOBuffer> read_buffer_; |
82 int read_buffer_len_; | 79 int read_buffer_len_; |
83 scoped_refptr<net::IOBuffer> write_buffer_; | 80 scoped_refptr<net::IOBuffer> write_buffer_; |
84 int write_buffer_len_; | 81 int write_buffer_len_; |
85 | 82 |
86 net::BoundNetLog net_log_; | 83 net::BoundNetLog net_log_; |
87 | 84 |
88 talk_base::AsyncSocket *socket_; | 85 talk_base::AsyncSocket *socket_; |
89 talk_base::SocketAddress addr_; | 86 talk_base::SocketAddress addr_; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 IOState write_state_; | 151 IOState write_state_; |
155 scoped_refptr<net::IOBuffer> transport_buf_; | 152 scoped_refptr<net::IOBuffer> transport_buf_; |
156 int data_transferred_; | 153 int data_transferred_; |
157 | 154 |
158 DISALLOW_COPY_AND_ASSIGN(SSLSocketAdapter); | 155 DISALLOW_COPY_AND_ASSIGN(SSLSocketAdapter); |
159 }; | 156 }; |
160 | 157 |
161 } // namespace remoting | 158 } // namespace remoting |
162 | 159 |
163 #endif // REMOTING_JINGLE_GLUE_SSL_SOCKET_ADAPTER_H_ | 160 #endif // REMOTING_JINGLE_GLUE_SSL_SOCKET_ADAPTER_H_ |
OLD | NEW |