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_source_sender.h" | 5 #include "device/serial/data_source_sender.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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // DataSourceSender. | 45 // DataSourceSender. |
46 class DataSourceSender::PendingSend::Buffer : public WritableBuffer { | 46 class DataSourceSender::PendingSend::Buffer : public WritableBuffer { |
47 public: | 47 public: |
48 Buffer(scoped_refptr<DataSourceSender> sender, | 48 Buffer(scoped_refptr<DataSourceSender> sender, |
49 PendingSend* send, | 49 PendingSend* send, |
50 char* buffer, | 50 char* buffer, |
51 uint32_t buffer_size); | 51 uint32_t buffer_size); |
52 virtual ~Buffer(); | 52 virtual ~Buffer(); |
53 | 53 |
54 // WritableBuffer overrides. | 54 // WritableBuffer overrides. |
55 virtual char* GetData() OVERRIDE; | 55 virtual char* GetData() override; |
56 virtual uint32_t GetSize() OVERRIDE; | 56 virtual uint32_t GetSize() override; |
57 virtual void Done(uint32_t bytes_written) OVERRIDE; | 57 virtual void Done(uint32_t bytes_written) override; |
58 virtual void DoneWithError(uint32_t bytes_written, int32_t error) OVERRIDE; | 58 virtual void DoneWithError(uint32_t bytes_written, int32_t error) override; |
59 | 59 |
60 private: | 60 private: |
61 // The DataSourceSender whose data pipe we are providing a view. | 61 // The DataSourceSender whose data pipe we are providing a view. |
62 scoped_refptr<DataSourceSender> sender_; | 62 scoped_refptr<DataSourceSender> sender_; |
63 | 63 |
64 // The PendingSend to which this buffer has been created in response. | 64 // The PendingSend to which this buffer has been created in response. |
65 PendingSend* pending_send_; | 65 PendingSend* pending_send_; |
66 | 66 |
67 char* buffer_; | 67 char* buffer_; |
68 uint32_t buffer_size_; | 68 uint32_t buffer_size_; |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 int32_t error) { | 239 int32_t error) { |
240 DCHECK(sender_.get()); | 240 DCHECK(sender_.get()); |
241 pending_send_->DoneWithError(bytes_written, error); | 241 pending_send_->DoneWithError(bytes_written, error); |
242 sender_ = NULL; | 242 sender_ = NULL; |
243 pending_send_ = NULL; | 243 pending_send_ = NULL; |
244 buffer_ = NULL; | 244 buffer_ = NULL; |
245 buffer_size_ = 0; | 245 buffer_size_ = 0; |
246 } | 246 } |
247 | 247 |
248 } // namespace device | 248 } // namespace device |
OLD | NEW |