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

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

Issue 1869503004: Convert //tools to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, change iwyu fixes for converted directories to include <memory> Created 4 years, 8 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
« no previous file with comments | « tools/battor_agent/battor_connection.h ('k') | tools/battor_agent/battor_connection_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <vector> 8 #include <vector>
9 9
10 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 // Reads the specified number of additional bytes and adds them to the pending 58 // Reads the specified number of additional bytes and adds them to the pending
59 // read buffer. 59 // read buffer.
60 void BeginReadBytes(size_t bytes_to_read); 60 void BeginReadBytes(size_t bytes_to_read);
61 61
62 // Internal callback for when bytes are read. This method may trigger 62 // Internal callback for when bytes are read. This method may trigger
63 // additional reads if any newly read bytes are escape bytes. 63 // additional reads if any newly read bytes are escape bytes.
64 void OnBytesRead(int bytes_read, device::serial::ReceiveError error); 64 void OnBytesRead(int bytes_read, device::serial::ReceiveError error);
65 65
66 void EndReadBytes(bool success, 66 void EndReadBytes(bool success,
67 BattOrMessageType type, 67 BattOrMessageType type,
68 scoped_ptr<std::vector<char>> data); 68 std::unique_ptr<std::vector<char>> data);
69 69
70 // Pulls off the next complete message from already_read_buffer_, returning 70 // Pulls off the next complete message from already_read_buffer_, returning
71 // its type and contents (via out parameters) and whether a complete message 71 // its type and contents (via out parameters) and whether a complete message
72 // was able to be read (via the return value). 72 // was able to be read (via the return value).
73 bool ParseMessage(BattOrMessageType* type, std::vector<char>* data); 73 bool ParseMessage(BattOrMessageType* type, std::vector<char>* data);
74 74
75 // Internal callback for when bytes are sent. 75 // Internal callback for when bytes are sent.
76 void OnBytesSent(int bytes_sent, device::serial::SendError error); 76 void OnBytesSent(int bytes_sent, device::serial::SendError error);
77 77
78 // The path of the BattOr. 78 // The path of the BattOr.
(...skipping 13 matching lines...) Expand all
92 // Threads needed for serial communication. 92 // Threads needed for serial communication.
93 scoped_refptr<base::SingleThreadTaskRunner> file_thread_task_runner_; 93 scoped_refptr<base::SingleThreadTaskRunner> file_thread_task_runner_;
94 scoped_refptr<base::SingleThreadTaskRunner> ui_thread_task_runner_; 94 scoped_refptr<base::SingleThreadTaskRunner> ui_thread_task_runner_;
95 95
96 DISALLOW_COPY_AND_ASSIGN(BattOrConnectionImpl); 96 DISALLOW_COPY_AND_ASSIGN(BattOrConnectionImpl);
97 }; 97 };
98 98
99 } // namespace battor 99 } // namespace battor
100 100
101 #endif // TOOLS_BATTOR_AGENT_BATTOR_CONNECTION_IMPL_H_ 101 #endif // TOOLS_BATTOR_AGENT_BATTOR_CONNECTION_IMPL_H_
OLDNEW
« no previous file with comments | « tools/battor_agent/battor_connection.h ('k') | tools/battor_agent/battor_connection_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698