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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 virtual int GetPeerAddress(net::AddressList* address) const OVERRIDE; | 48 virtual int GetPeerAddress(net::AddressList* address) const OVERRIDE; |
49 virtual int GetLocalAddress(net::IPEndPoint* address) const OVERRIDE; | 49 virtual int GetLocalAddress(net::IPEndPoint* address) const OVERRIDE; |
50 virtual const net::BoundNetLog& NetLog() const OVERRIDE; | 50 virtual const net::BoundNetLog& NetLog() const OVERRIDE; |
51 virtual void SetSubresourceSpeculation() OVERRIDE; | 51 virtual void SetSubresourceSpeculation() OVERRIDE; |
52 virtual void SetOmniboxSpeculation() OVERRIDE; | 52 virtual void SetOmniboxSpeculation() OVERRIDE; |
53 virtual bool WasEverUsed() const OVERRIDE; | 53 virtual bool WasEverUsed() const OVERRIDE; |
54 virtual bool UsingTCPFastOpen() const OVERRIDE; | 54 virtual bool UsingTCPFastOpen() const OVERRIDE; |
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 | |
60 virtual int Read(net::IOBuffer* buf, int buf_len, | 59 virtual int Read(net::IOBuffer* buf, int buf_len, |
61 net::OldCompletionCallback* callback) OVERRIDE; | 60 net::OldCompletionCallback* callback) OVERRIDE; |
| 61 virtual int Read(net::IOBuffer* buf, int buf_len, |
| 62 const net::CompletionCallback& callback) OVERRIDE; |
62 virtual int Write(net::IOBuffer* buf, int buf_len, | 63 virtual int Write(net::IOBuffer* buf, int buf_len, |
63 net::OldCompletionCallback* callback) OVERRIDE; | 64 net::OldCompletionCallback* callback) OVERRIDE; |
64 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; | 65 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; |
65 virtual bool SetSendBufferSize(int32 size) OVERRIDE; | 66 virtual bool SetSendBufferSize(int32 size) OVERRIDE; |
66 | 67 |
67 private: | 68 private: |
68 friend class SSLSocketAdapter; | 69 friend class SSLSocketAdapter; |
69 | 70 |
70 void OnReadEvent(talk_base::AsyncSocket* socket); | 71 void OnReadEvent(talk_base::AsyncSocket* socket); |
71 void OnWriteEvent(talk_base::AsyncSocket* socket); | 72 void OnWriteEvent(talk_base::AsyncSocket* socket); |
72 | 73 |
73 net::OldCompletionCallback* read_callback_; | 74 net::OldCompletionCallback* old_read_callback_; |
| 75 net::CompletionCallback read_callback_; |
74 net::OldCompletionCallback* write_callback_; | 76 net::OldCompletionCallback* write_callback_; |
75 | 77 |
76 scoped_refptr<net::IOBuffer> read_buffer_; | 78 scoped_refptr<net::IOBuffer> read_buffer_; |
77 int read_buffer_len_; | 79 int read_buffer_len_; |
78 scoped_refptr<net::IOBuffer> write_buffer_; | 80 scoped_refptr<net::IOBuffer> write_buffer_; |
79 int write_buffer_len_; | 81 int write_buffer_len_; |
80 | 82 |
81 net::BoundNetLog net_log_; | 83 net::BoundNetLog net_log_; |
82 | 84 |
83 talk_base::AsyncSocket *socket_; | 85 talk_base::AsyncSocket *socket_; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 IOState write_state_; | 151 IOState write_state_; |
150 scoped_refptr<net::IOBuffer> transport_buf_; | 152 scoped_refptr<net::IOBuffer> transport_buf_; |
151 int data_transferred_; | 153 int data_transferred_; |
152 | 154 |
153 DISALLOW_COPY_AND_ASSIGN(SSLSocketAdapter); | 155 DISALLOW_COPY_AND_ASSIGN(SSLSocketAdapter); |
154 }; | 156 }; |
155 | 157 |
156 } // namespace remoting | 158 } // namespace remoting |
157 | 159 |
158 #endif // REMOTING_JINGLE_GLUE_SSL_SOCKET_ADAPTER_H_ | 160 #endif // REMOTING_JINGLE_GLUE_SSL_SOCKET_ADAPTER_H_ |
OLD | NEW |