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_DATA_SINK_RECEIVER_H_ | 5 #ifndef DEVICE_SERIAL_DATA_SINK_RECEIVER_H_ |
6 #define DEVICE_SERIAL_DATA_SINK_RECEIVER_H_ | 6 #define DEVICE_SERIAL_DATA_SINK_RECEIVER_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 void ShutDown(); | 42 void ShutDown(); |
43 | 43 |
44 private: | 44 private: |
45 class Buffer; | 45 class Buffer; |
46 class PendingFlush; | 46 class PendingFlush; |
47 friend class base::RefCounted<DataSinkReceiver>; | 47 friend class base::RefCounted<DataSinkReceiver>; |
48 | 48 |
49 virtual ~DataSinkReceiver(); | 49 virtual ~DataSinkReceiver(); |
50 | 50 |
51 // mojo::InterfaceImpl<serial::DataSink> overrides. | 51 // mojo::InterfaceImpl<serial::DataSink> overrides. |
52 virtual void Init(mojo::ScopedDataPipeConsumerHandle handle) OVERRIDE; | 52 virtual void Init(mojo::ScopedDataPipeConsumerHandle handle) override; |
53 virtual void Cancel(int32_t error) OVERRIDE; | 53 virtual void Cancel(int32_t error) override; |
54 virtual void OnConnectionError() OVERRIDE; | 54 virtual void OnConnectionError() override; |
55 | 55 |
56 // Starts waiting for |handle_| to be ready for reads. | 56 // Starts waiting for |handle_| to be ready for reads. |
57 void StartWaiting(); | 57 void StartWaiting(); |
58 | 58 |
59 // Invoked when |handle_| is ready for reads. | 59 // Invoked when |handle_| is ready for reads. |
60 void OnDoneWaiting(MojoResult result); | 60 void OnDoneWaiting(MojoResult result); |
61 | 61 |
62 // Reports a successful read of |bytes_read|. | 62 // Reports a successful read of |bytes_read|. |
63 void Done(uint32_t bytes_read); | 63 void Done(uint32_t bytes_read); |
64 | 64 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 bool shut_down_; | 105 bool shut_down_; |
106 | 106 |
107 base::WeakPtrFactory<DataSinkReceiver> weak_factory_; | 107 base::WeakPtrFactory<DataSinkReceiver> weak_factory_; |
108 | 108 |
109 DISALLOW_COPY_AND_ASSIGN(DataSinkReceiver); | 109 DISALLOW_COPY_AND_ASSIGN(DataSinkReceiver); |
110 }; | 110 }; |
111 | 111 |
112 } // namespace device | 112 } // namespace device |
113 | 113 |
114 #endif // DEVICE_SERIAL_DATA_SINK_RECEIVER_H_ | 114 #endif // DEVICE_SERIAL_DATA_SINK_RECEIVER_H_ |
OLD | NEW |