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

Unified Diff: tools/battor_agent/battor_agent.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/battor_agent/battor_agent.h ('k') | tools/battor_agent/battor_agent_bin.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/battor_agent/battor_agent.cc
diff --git a/tools/battor_agent/battor_agent.cc b/tools/battor_agent/battor_agent.cc
index 0195b816cba63c6c9c03a2ed055a884b82b753fe..323da5175e4fdb6776df4231aec4436aa0e8b43d 100644
--- a/tools/battor_agent/battor_agent.cc
+++ b/tools/battor_agent/battor_agent.cc
@@ -55,15 +55,15 @@ bool IsAckOfControlCommand(BattOrMessageType message_type,
// Attempts to decode the specified vector of bytes decodes to a valid EEPROM.
// Returns the new EEPROM, or nullptr if unsuccessful.
-scoped_ptr<BattOrEEPROM> ParseEEPROM(BattOrMessageType message_type,
- const vector<char>& msg) {
+std::unique_ptr<BattOrEEPROM> ParseEEPROM(BattOrMessageType message_type,
+ const vector<char>& msg) {
if (message_type != BATTOR_MESSAGE_TYPE_CONTROL_ACK)
return nullptr;
if (msg.size() != sizeof(BattOrEEPROM))
return nullptr;
- scoped_ptr<BattOrEEPROM> eeprom(new BattOrEEPROM());
+ std::unique_ptr<BattOrEEPROM> eeprom(new BattOrEEPROM());
memcpy(eeprom.get(), msg.data(), sizeof(BattOrEEPROM));
return eeprom;
}
@@ -244,7 +244,7 @@ void BattOrAgent::OnBytesSent(bool success) {
void BattOrAgent::OnMessageRead(bool success,
BattOrMessageType type,
- scoped_ptr<vector<char>> bytes) {
+ std::unique_ptr<vector<char>> bytes) {
// Return immediately if whatever action we were trying to perform already
// timed out.
if (timeout_callback_.IsCancelled())
« no previous file with comments | « tools/battor_agent/battor_agent.h ('k') | tools/battor_agent/battor_agent_bin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698