| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 TOOLS_BATTOR_AGENT_BATTOR_CONNECTION_IMPL_H_ | 5 #ifndef TOOLS_BATTOR_AGENT_BATTOR_CONNECTION_IMPL_H_ |
| 6 #define TOOLS_BATTOR_AGENT_BATTOR_CONNECTION_IMPL_H_ | 6 #define TOOLS_BATTOR_AGENT_BATTOR_CONNECTION_IMPL_H_ |
| 7 | 7 |
| 8 #include <fstream> | 8 #include <fstream> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 scoped_refptr<base::SingleThreadTaskRunner> file_thread_task_runner, | 37 scoped_refptr<base::SingleThreadTaskRunner> file_thread_task_runner, |
| 38 scoped_refptr<base::SingleThreadTaskRunner> ui_thread_task_runner); | 38 scoped_refptr<base::SingleThreadTaskRunner> ui_thread_task_runner); |
| 39 ~BattOrConnectionImpl() override; | 39 ~BattOrConnectionImpl() override; |
| 40 | 40 |
| 41 void Open() override; | 41 void Open() override; |
| 42 void Close() override; | 42 void Close() override; |
| 43 void SendBytes(BattOrMessageType type, | 43 void SendBytes(BattOrMessageType type, |
| 44 const void* buffer, | 44 const void* buffer, |
| 45 size_t bytes_to_send) override; | 45 size_t bytes_to_send) override; |
| 46 void ReadMessage(BattOrMessageType type) override; | 46 void ReadMessage(BattOrMessageType type) override; |
| 47 void CancelReadMessage() override; |
| 47 void Flush() override; | 48 void Flush() override; |
| 48 | 49 |
| 49 protected: | 50 protected: |
| 50 // Overridden by the test to use a fake serial connection. | 51 // Overridden by the test to use a fake serial connection. |
| 51 virtual scoped_refptr<device::SerialIoHandler> CreateIoHandler(); | 52 virtual scoped_refptr<device::SerialIoHandler> CreateIoHandler(); |
| 52 | 53 |
| 53 // IO handler capable of reading and writing from the serial connection. | 54 // IO handler capable of reading and writing from the serial connection. |
| 54 scoped_refptr<device::SerialIoHandler> io_handler_; | 55 scoped_refptr<device::SerialIoHandler> io_handler_; |
| 55 | 56 |
| 56 private: | 57 private: |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 scoped_refptr<base::SingleThreadTaskRunner> ui_thread_task_runner_; | 108 scoped_refptr<base::SingleThreadTaskRunner> ui_thread_task_runner_; |
| 108 | 109 |
| 109 std::fstream serial_log_; | 110 std::fstream serial_log_; |
| 110 | 111 |
| 111 DISALLOW_COPY_AND_ASSIGN(BattOrConnectionImpl); | 112 DISALLOW_COPY_AND_ASSIGN(BattOrConnectionImpl); |
| 112 }; | 113 }; |
| 113 | 114 |
| 114 } // namespace battor | 115 } // namespace battor |
| 115 | 116 |
| 116 #endif // TOOLS_BATTOR_AGENT_BATTOR_CONNECTION_IMPL_H_ | 117 #endif // TOOLS_BATTOR_AGENT_BATTOR_CONNECTION_IMPL_H_ |
| OLD | NEW |