Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROME_COMMON_PARTIAL_CIRCULAR_BUFFER_H_ | 5 #ifndef CHROME_COMMON_PARTIAL_CIRCULAR_BUFFER_H_ |
| 6 #define CHROME_COMMON_PARTIAL_CIRCULAR_BUFFER_H_ | 6 #define CHROME_COMMON_PARTIAL_CIRCULAR_BUFFER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
| 10 | 10 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 45 #pragma pack(push) | 45 #pragma pack(push) |
| 46 #pragma pack(4) | 46 #pragma pack(4) |
| 47 struct BufferData { | 47 struct BufferData { |
| 48 uint32 total_written; | 48 uint32 total_written; |
| 49 uint32 wrap_position; | 49 uint32 wrap_position; |
| 50 uint32 end_position; | 50 uint32 end_position; |
| 51 uint8 data[1]; | 51 uint8 data[1]; |
| 52 }; | 52 }; |
| 53 #pragma pack(pop) | 53 #pragma pack(pop) |
| 54 | 54 |
| 55 void DoWrite(void* dest, const void* src, uint32 num); | 55 uint32 DoWrite(const uint8* input, uint32 input_size); |
|
Nico
2015/04/08 23:13:05
Document what this returns, mention that it can re
gzobqq
2015/04/09 08:36:40
I changed DoWrite() to handle the complete input i
| |
| 56 | 56 |
| 57 // Used for reading and writing. | 57 // Used for reading and writing. |
| 58 BufferData* buffer_data_; | 58 BufferData* buffer_data_; |
| 59 uint32 memory_buffer_size_; | 59 uint32 memory_buffer_size_; |
| 60 uint32 data_size_; | 60 uint32 data_size_; |
| 61 uint32 position_; | 61 uint32 position_; |
| 62 | 62 |
| 63 // Used for reading. | 63 // Used for reading. |
| 64 uint32 total_read_; | 64 uint32 total_read_; |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 #endif // CHROME_COMMON_PARTIAL_CIRCULAR_BUFFER_H_ | 67 #endif // CHROME_COMMON_PARTIAL_CIRCULAR_BUFFER_H_ |
| OLD | NEW |