Chromium Code Reviews| Index: tools/battor_agent/battor_agent.cc |
| diff --git a/tools/battor_agent/battor_agent.cc b/tools/battor_agent/battor_agent.cc |
| index 65289a63ad50b7ef76981d78c265180b9936e170..7dfbfce9d7835a7a0c70023e6b2db26340b5c11a 100644 |
| --- a/tools/battor_agent/battor_agent.cc |
| +++ b/tools/battor_agent/battor_agent.cc |
| @@ -114,9 +114,9 @@ void BattOrAgent::OnBytesSent(bool success) { |
| } |
| } |
| -void BattOrAgent::OnBytesRead(bool success, |
| - BattOrMessageType type, |
| - scoped_ptr<vector<char>> bytes) { |
| +void BattOrAgent::OnMessageRead(bool success, |
| + BattOrMessageType type, |
| + scoped_ptr<vector<char>> bytes) { |
| if (!success) { |
| CompleteCommand(BATTOR_ERROR_RECEIVE_ERROR); |
| return; |
| @@ -182,7 +182,7 @@ void BattOrAgent::PerformAction(Action action) { |
| SendControlMessage(BATTOR_CONTROL_MESSAGE_TYPE_INIT, 0, 0); |
| break; |
| case Action::READ_INIT_ACK: |
| - connection_->ReadBytes(sizeof(BattOrControlMessageAck)); |
| + connection_->ReadMessage(sizeof(BattOrControlMessageAck)); |
|
nednguyen
2016/01/06 22:03:13
Can yo abstract this to ReadMessage(message_type),
charliea (OOO until 10-5)
2016/01/07 16:00:12
I like this idea a lot. Done.
|
| break; |
| case Action::SEND_SET_GAIN: |
| // Set the BattOr's gain. Setting the gain tells the BattOr the range of |
| @@ -191,13 +191,13 @@ void BattOrAgent::PerformAction(Action action) { |
| 0); |
| break; |
| case Action::READ_SET_GAIN_ACK: |
| - connection_->ReadBytes(sizeof(BattOrControlMessageAck)); |
| + connection_->ReadMessage(sizeof(BattOrControlMessageAck)); |
| break; |
| case Action::SEND_START_TRACING: |
| SendControlMessage(BATTOR_CONTROL_MESSAGE_TYPE_START_SAMPLING_SD, 0, 0); |
| break; |
| case Action::READ_START_TRACING_ACK: |
| - connection_->ReadBytes(sizeof(BattOrControlMessageAck)); |
| + connection_->ReadMessage(sizeof(BattOrControlMessageAck)); |
| break; |
| case Action::INVALID: |
| NOTREACHED(); |