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 #include "device/serial/data_receiver.h" | 5 #include "device/serial/data_receiver.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 // a DataReceiver. | 59 // a DataReceiver. |
60 class DataReceiver::PendingReceive::Buffer : public ReadOnlyBuffer { | 60 class DataReceiver::PendingReceive::Buffer : public ReadOnlyBuffer { |
61 public: | 61 public: |
62 Buffer(scoped_refptr<DataReceiver> pipe, | 62 Buffer(scoped_refptr<DataReceiver> pipe, |
63 PendingReceive* receive, | 63 PendingReceive* receive, |
64 const char* buffer, | 64 const char* buffer, |
65 uint32_t buffer_size); | 65 uint32_t buffer_size); |
66 virtual ~Buffer(); | 66 virtual ~Buffer(); |
67 | 67 |
68 // ReadOnlyBuffer overrides. | 68 // ReadOnlyBuffer overrides. |
69 virtual const char* GetData() OVERRIDE; | 69 virtual const char* GetData() override; |
70 virtual uint32_t GetSize() OVERRIDE; | 70 virtual uint32_t GetSize() override; |
71 virtual void Done(uint32_t bytes_consumed) OVERRIDE; | 71 virtual void Done(uint32_t bytes_consumed) override; |
72 virtual void DoneWithError(uint32_t bytes_consumed, int32_t error) OVERRIDE; | 72 virtual void DoneWithError(uint32_t bytes_consumed, int32_t error) override; |
73 | 73 |
74 private: | 74 private: |
75 // The DataReceiver whose data pipe we are providing a view. | 75 // The DataReceiver whose data pipe we are providing a view. |
76 scoped_refptr<DataReceiver> receiver_; | 76 scoped_refptr<DataReceiver> receiver_; |
77 | 77 |
78 // The PendingReceive to which this buffer has been created in response. | 78 // The PendingReceive to which this buffer has been created in response. |
79 PendingReceive* pending_receive_; | 79 PendingReceive* pending_receive_; |
80 | 80 |
81 const char* buffer_; | 81 const char* buffer_; |
82 uint32_t buffer_size_; | 82 uint32_t buffer_size_; |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 buffer_size_ = 0; | 331 buffer_size_ = 0; |
332 } | 332 } |
333 | 333 |
334 void DataReceiver::PendingReceive::Buffer::DoneWithError( | 334 void DataReceiver::PendingReceive::Buffer::DoneWithError( |
335 uint32_t bytes_consumed, | 335 uint32_t bytes_consumed, |
336 int32_t error) { | 336 int32_t error) { |
337 Done(bytes_consumed); | 337 Done(bytes_consumed); |
338 } | 338 } |
339 | 339 |
340 } // namespace device | 340 } // namespace device |
OLD | NEW |