| OLD | NEW |
| (Empty) |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef NET_SPDY_ZERO_COPY_OUTPUT_BUFFER_H_ | |
| 6 #define NET_SPDY_ZERO_COPY_OUTPUT_BUFFER_H_ | |
| 7 | |
| 8 #include <cstdint> | |
| 9 | |
| 10 namespace net { | |
| 11 | |
| 12 class ZeroCopyOutputBuffer { | |
| 13 public: | |
| 14 virtual ~ZeroCopyOutputBuffer() {} | |
| 15 | |
| 16 // Returns the next available segment of memory to write. Will always return | |
| 17 // the same segment until AdvanceWritePtr is called. | |
| 18 virtual void Next(char** data, int* size) = 0; | |
| 19 | |
| 20 // After writing to a buffer returned from Next(), the caller should call | |
| 21 // this method to indicate how many bytes were written. | |
| 22 virtual void AdvanceWritePtr(int64_t count) = 0; | |
| 23 | |
| 24 // Returns the available capacity of the buffer. | |
| 25 virtual uint64_t BytesFree() const = 0; | |
| 26 }; | |
| 27 | |
| 28 } // namespace net | |
| 29 | |
| 30 #endif // NET_SPDY_ZERO_COPY_OUTPUT_BUFFER_H_ | |
| OLD | NEW |