| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_SOCKET_BIO_ADAPTER_H_ | 5 #ifndef NET_SOCKET_SOCKET_BIO_ADAPTER_H_ |
| 6 #define NET_SOCKET_SOCKET_BIO_ADAPTER_H_ | 6 #define NET_SOCKET_SOCKET_BIO_ADAPTER_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "net/base/completion_callback.h" | 10 #include "net/base/completion_callback.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 int write_buffer_capacity, | 71 int write_buffer_capacity, |
| 72 Delegate* delegate); | 72 Delegate* delegate); |
| 73 ~SocketBIOAdapter(); | 73 ~SocketBIOAdapter(); |
| 74 | 74 |
| 75 BIO* bio() { return bio_.get(); } | 75 BIO* bio() { return bio_.get(); } |
| 76 | 76 |
| 77 // Returns true if any data has been read from the underlying StreamSocket, | 77 // Returns true if any data has been read from the underlying StreamSocket, |
| 78 // but not yet consumed by the BIO. | 78 // but not yet consumed by the BIO. |
| 79 bool HasPendingReadData(); | 79 bool HasPendingReadData(); |
| 80 | 80 |
| 81 size_t GetEffectiveSize() const; |
| 81 private: | 82 private: |
| 82 int BIORead(char* out, int len); | 83 int BIORead(char* out, int len); |
| 83 void HandleSocketReadResult(int result); | 84 void HandleSocketReadResult(int result); |
| 84 void OnSocketReadComplete(int result); | 85 void OnSocketReadComplete(int result); |
| 85 | 86 |
| 86 int BIOWrite(const char* in, int len); | 87 int BIOWrite(const char* in, int len); |
| 87 void SocketWrite(); | 88 void SocketWrite(); |
| 88 void HandleSocketWriteResult(int result); | 89 void HandleSocketWriteResult(int result); |
| 89 void OnSocketWriteComplete(int result); | 90 void OnSocketWriteComplete(int result); |
| 90 void CallOnReadReady(); | 91 void CallOnReadReady(); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 Delegate* delegate_; | 134 Delegate* delegate_; |
| 134 | 135 |
| 135 base::WeakPtrFactory<SocketBIOAdapter> weak_factory_; | 136 base::WeakPtrFactory<SocketBIOAdapter> weak_factory_; |
| 136 | 137 |
| 137 DISALLOW_COPY_AND_ASSIGN(SocketBIOAdapter); | 138 DISALLOW_COPY_AND_ASSIGN(SocketBIOAdapter); |
| 138 }; | 139 }; |
| 139 | 140 |
| 140 } // namespace net | 141 } // namespace net |
| 141 | 142 |
| 142 #endif // NET_SOCKET_SOCKET_BIO_ADAPTER_H_ | 143 #endif // NET_SOCKET_SOCKET_BIO_ADAPTER_H_ |
| OLD | NEW |