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_SOURCE_SENDER_H_ | 5 #ifndef DEVICE_SERIAL_DATA_SOURCE_SENDER_H_ |
6 #define DEVICE_SERIAL_DATA_SOURCE_SENDER_H_ | 6 #define DEVICE_SERIAL_DATA_SOURCE_SENDER_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "device/serial/buffer.h" | 10 #include "device/serial/buffer.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 // |error_callback| will never be called. | 34 // |error_callback| will never be called. |
35 void ShutDown(); | 35 void ShutDown(); |
36 | 36 |
37 private: | 37 private: |
38 friend class base::RefCounted<DataSourceSender>; | 38 friend class base::RefCounted<DataSourceSender>; |
39 class PendingSend; | 39 class PendingSend; |
40 | 40 |
41 virtual ~DataSourceSender(); | 41 virtual ~DataSourceSender(); |
42 | 42 |
43 // mojo::InterfaceImpl<serial::DataSourceSender> overrides. | 43 // mojo::InterfaceImpl<serial::DataSourceSender> overrides. |
44 virtual void Init(mojo::ScopedDataPipeProducerHandle handle) OVERRIDE; | 44 virtual void Init(mojo::ScopedDataPipeProducerHandle handle) override; |
45 virtual void Resume() OVERRIDE; | 45 virtual void Resume() override; |
46 // Invoked in the event of a connection error. Calls DispatchFatalError(). | 46 // Invoked in the event of a connection error. Calls DispatchFatalError(). |
47 virtual void OnConnectionError() OVERRIDE; | 47 virtual void OnConnectionError() override; |
48 | 48 |
49 // Starts waiting for |handle_| to be ready for writes. | 49 // Starts waiting for |handle_| to be ready for writes. |
50 void StartWaiting(); | 50 void StartWaiting(); |
51 | 51 |
52 // Invoked when |handle_| is ready for writes. | 52 // Invoked when |handle_| is ready for writes. |
53 void OnDoneWaiting(MojoResult result); | 53 void OnDoneWaiting(MojoResult result); |
54 | 54 |
55 // Reports a successful write of |bytes_written|. | 55 // Reports a successful write of |bytes_written|. |
56 void Done(uint32_t bytes_written); | 56 void Done(uint32_t bytes_written); |
57 | 57 |
(...skipping 27 matching lines...) Expand all Loading... |
85 | 85 |
86 // Whether we have encountered a fatal error and shut down. | 86 // Whether we have encountered a fatal error and shut down. |
87 bool shut_down_; | 87 bool shut_down_; |
88 | 88 |
89 DISALLOW_COPY_AND_ASSIGN(DataSourceSender); | 89 DISALLOW_COPY_AND_ASSIGN(DataSourceSender); |
90 }; | 90 }; |
91 | 91 |
92 } // namespace device | 92 } // namespace device |
93 | 93 |
94 #endif // DEVICE_SERIAL_DATA_SOURCE_SENDER_H_ | 94 #endif // DEVICE_SERIAL_DATA_SOURCE_SENDER_H_ |
OLD | NEW |