Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: tools/battor_agent/battor_connection_impl.h

Issue 1991403002: [battor agent] Fix the init sequence so it retries inits instead of resets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Initial draft Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 scoped_refptr<base::SingleThreadTaskRunner> ui_thread_task_runner_; 99 scoped_refptr<base::SingleThreadTaskRunner> ui_thread_task_runner_;
99 100
100 std::fstream serial_log_; 101 std::fstream serial_log_;
101 102
102 DISALLOW_COPY_AND_ASSIGN(BattOrConnectionImpl); 103 DISALLOW_COPY_AND_ASSIGN(BattOrConnectionImpl);
103 }; 104 };
104 105
105 } // namespace battor 106 } // namespace battor
106 107
107 #endif // TOOLS_BATTOR_AGENT_BATTOR_CONNECTION_IMPL_H_ 108 #endif // TOOLS_BATTOR_AGENT_BATTOR_CONNECTION_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698