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_PROTOCOL_BUFFERED_SOCKET_WRITER_H_ | 5 #ifndef REMOTING_PROTOCOL_BUFFERED_SOCKET_WRITER_H_ |
6 #define REMOTING_PROTOCOL_BUFFERED_SOCKET_WRITER_H_ | 6 #define REMOTING_PROTOCOL_BUFFERED_SOCKET_WRITER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 | 92 |
93 // Must be locked when accessing |socket_|, |queue_| and |buffer_size_|; | 93 // Must be locked when accessing |socket_|, |queue_| and |buffer_size_|; |
94 base::Lock lock_; | 94 base::Lock lock_; |
95 | 95 |
96 net::Socket* socket_; | 96 net::Socket* socket_; |
97 scoped_refptr<base::MessageLoopProxy> message_loop_; | 97 scoped_refptr<base::MessageLoopProxy> message_loop_; |
98 WriteFailedCallback write_failed_callback_; | 98 WriteFailedCallback write_failed_callback_; |
99 | 99 |
100 bool write_pending_; | 100 bool write_pending_; |
101 | 101 |
102 net::OldCompletionCallbackImpl<BufferedSocketWriterBase> written_callback_; | |
103 | |
104 bool closed_; | 102 bool closed_; |
105 }; | 103 }; |
106 | 104 |
107 class BufferedSocketWriter : public BufferedSocketWriterBase { | 105 class BufferedSocketWriter : public BufferedSocketWriterBase { |
108 public: | 106 public: |
109 explicit BufferedSocketWriter(base::MessageLoopProxy* message_loop); | 107 explicit BufferedSocketWriter(base::MessageLoopProxy* message_loop); |
110 virtual ~BufferedSocketWriter(); | 108 virtual ~BufferedSocketWriter(); |
111 | 109 |
112 protected: | 110 protected: |
113 virtual void GetNextPacket_Locked(net::IOBuffer** buffer, int* size) OVERRIDE; | 111 virtual void GetNextPacket_Locked(net::IOBuffer** buffer, int* size) OVERRIDE; |
(...skipping 12 matching lines...) Expand all Loading... |
126 protected: | 124 protected: |
127 virtual void GetNextPacket_Locked(net::IOBuffer** buffer, int* size) OVERRIDE; | 125 virtual void GetNextPacket_Locked(net::IOBuffer** buffer, int* size) OVERRIDE; |
128 virtual void AdvanceBufferPosition_Locked(int written) OVERRIDE; | 126 virtual void AdvanceBufferPosition_Locked(int written) OVERRIDE; |
129 virtual void OnError_Locked(int result) OVERRIDE; | 127 virtual void OnError_Locked(int result) OVERRIDE; |
130 }; | 128 }; |
131 | 129 |
132 } // namespace protocol | 130 } // namespace protocol |
133 } // namespace remoting | 131 } // namespace remoting |
134 | 132 |
135 #endif // REMOTING_PROTOCOL_BUFFERED_SOCKET_WRITER_H_ | 133 #endif // REMOTING_PROTOCOL_BUFFERED_SOCKET_WRITER_H_ |
OLD | NEW |