| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 DEVICE_SERIAL_BUFFER_H_ | 5 #ifndef DEVICE_SERIAL_BUFFER_H_ |
| 6 #define DEVICE_SERIAL_BUFFER_H_ | 6 #define DEVICE_SERIAL_BUFFER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include <stdint.h> |
| 9 |
| 9 #include "base/callback.h" | 10 #include "base/callback.h" |
| 10 #include "device/serial/serial.mojom.h" | 11 #include "device/serial/serial.mojom.h" |
| 11 #include "net/base/io_buffer.h" | 12 #include "net/base/io_buffer.h" |
| 12 | 13 |
| 13 namespace device { | 14 namespace device { |
| 14 | 15 |
| 15 // A fixed-size read-only buffer. The data-reader should call Done() when it is | 16 // A fixed-size read-only buffer. The data-reader should call Done() when it is |
| 16 // finished reading bytes from the buffer. Alternatively, the reader can report | 17 // finished reading bytes from the buffer. Alternatively, the reader can report |
| 17 // an error by calling DoneWithError() with the number of bytes read and the | 18 // an error by calling DoneWithError() with the number of bytes read and the |
| 18 // error it wishes to report. | 19 // error it wishes to report. |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 75 |
| 75 private: | 76 private: |
| 76 scoped_refptr<net::IOBuffer> buffer_; | 77 scoped_refptr<net::IOBuffer> buffer_; |
| 77 const uint32_t size_; | 78 const uint32_t size_; |
| 78 const base::Callback<void(int, device::serial::ReceiveError)> callback_; | 79 const base::Callback<void(int, device::serial::ReceiveError)> callback_; |
| 79 }; | 80 }; |
| 80 | 81 |
| 81 } // namespace device | 82 } // namespace device |
| 82 | 83 |
| 83 #endif // DEVICE_SERIAL_BUFFER_H_ | 84 #endif // DEVICE_SERIAL_BUFFER_H_ |
| OLD | NEW |