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

Unified Diff: device/serial/serial_io_handler.h

Issue 1874313002: Convert device to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . 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 | « device/serial/serial_device_enumerator_win.cc ('k') | device/serial/serial_io_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/serial/serial_io_handler.h
diff --git a/device/serial/serial_io_handler.h b/device/serial/serial_io_handler.h
index d1a4827e30155b7d051a93026c936b822263b69b..00f5eba78ed04f7bc18dfdab290c5be860aebfba 100644
--- a/device/serial/serial_io_handler.h
+++ b/device/serial/serial_io_handler.h
@@ -7,6 +7,8 @@
#include <stdint.h>
+#include <memory>
+
#include "base/callback.h"
#include "base/files/file.h"
#include "base/macros.h"
@@ -69,12 +71,12 @@ class SerialIoHandler : public base::NonThreadSafe,
// Performs an async Read operation. Behavior is undefined if this is called
// while a Read is already pending. Otherwise, the Done or DoneWithError
// method on |buffer| will eventually be called with a result.
- void Read(scoped_ptr<WritableBuffer> buffer);
+ void Read(std::unique_ptr<WritableBuffer> buffer);
// Performs an async Write operation. Behavior is undefined if this is called
// while a Write is already pending. Otherwise, the Done or DoneWithError
// method on |buffer| will eventually be called with a result.
- void Write(scoped_ptr<ReadOnlyBuffer> buffer);
+ void Write(std::unique_ptr<ReadOnlyBuffer> buffer);
// Indicates whether or not a read is currently pending.
bool IsReadPending() const;
@@ -238,11 +240,11 @@ class SerialIoHandler : public base::NonThreadSafe,
// Currently applied connection options.
serial::ConnectionOptions options_;
- scoped_ptr<WritableBuffer> pending_read_buffer_;
+ std::unique_ptr<WritableBuffer> pending_read_buffer_;
serial::ReceiveError read_cancel_reason_;
bool read_canceled_;
- scoped_ptr<ReadOnlyBuffer> pending_write_buffer_;
+ std::unique_ptr<ReadOnlyBuffer> pending_write_buffer_;
serial::SendError write_cancel_reason_;
bool write_canceled_;
« no previous file with comments | « device/serial/serial_device_enumerator_win.cc ('k') | device/serial/serial_io_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698