| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 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_SPDY_ARRAY_OUTPUT_BUFFER_H_ | 5 #ifndef NET_SPDY_ARRAY_OUTPUT_BUFFER_H_ |
| 6 #define NET_SPDY_ARRAY_OUTPUT_BUFFER_H_ | 6 #define NET_SPDY_ARRAY_OUTPUT_BUFFER_H_ |
| 7 | 7 |
| 8 #include <string.h> | 8 #include <cstddef> |
| 9 #include "net/spdy/zero_copy_output_buffer.h" | 9 #include "net/spdy/zero_copy_output_buffer.h" |
| 10 | 10 |
| 11 namespace net { | 11 namespace net { |
| 12 | 12 |
| 13 class ArrayOutputBuffer : public ZeroCopyOutputBuffer { | 13 class ArrayOutputBuffer : public ZeroCopyOutputBuffer { |
| 14 public: | 14 public: |
| 15 // |buffer| is pointed to the output to write to, and |size| is the capacity | 15 // |buffer| is pointed to the output to write to, and |size| is the capacity |
| 16 // of the output. | 16 // of the output. |
| 17 ArrayOutputBuffer(char* buffer, int64_t size) | 17 ArrayOutputBuffer(char* buffer, int64_t size) |
| 18 : current_(buffer), begin_(buffer), capacity_(size) {} | 18 : current_(buffer), begin_(buffer), capacity_(size) {} |
| (...skipping 12 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 private: | 32 private: |
| 33 char* current_ = nullptr; | 33 char* current_ = nullptr; |
| 34 char* begin_ = nullptr; | 34 char* begin_ = nullptr; |
| 35 int64_t capacity_ = 0; | 35 int64_t capacity_ = 0; |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 } // namespace net | 38 } // namespace net |
| 39 | 39 |
| 40 #endif // NET_SPDY_ARRAY_OUTPUT_BUFFER_H_ | 40 #endif // NET_SPDY_ARRAY_OUTPUT_BUFFER_H_ |
| OLD | NEW |