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

Side by Side Diff: device/serial/serial_connection.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 unified diff | Download patch
« no previous file with comments | « device/serial/data_source_unittest.cc ('k') | device/serial/serial_connection.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 DEVICE_SERIAL_SERIAL_CONNECTION_H_ 5 #ifndef DEVICE_SERIAL_SERIAL_CONNECTION_H_
6 #define DEVICE_SERIAL_SERIAL_CONNECTION_H_ 6 #define DEVICE_SERIAL_SERIAL_CONNECTION_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory>
11
10 #include "base/macros.h" 12 #include "base/macros.h"
11 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "device/serial/serial.mojom.h" 14 #include "device/serial/serial.mojom.h"
14 #include "mojo/public/cpp/bindings/strong_binding.h" 15 #include "mojo/public/cpp/bindings/strong_binding.h"
15 16
16 namespace device { 17 namespace device {
17 18
18 class DataSinkReceiver; 19 class DataSinkReceiver;
19 class DataSourceSender; 20 class DataSourceSender;
20 class ReadOnlyBuffer; 21 class ReadOnlyBuffer;
21 class SerialIoHandler; 22 class SerialIoHandler;
22 class WritableBuffer; 23 class WritableBuffer;
(...skipping 13 matching lines...) Expand all
36 void SetOptions(serial::ConnectionOptionsPtr options, 37 void SetOptions(serial::ConnectionOptionsPtr options,
37 const mojo::Callback<void(bool)>& callback) override; 38 const mojo::Callback<void(bool)>& callback) override;
38 void SetControlSignals(serial::HostControlSignalsPtr signals, 39 void SetControlSignals(serial::HostControlSignalsPtr signals,
39 const mojo::Callback<void(bool)>& callback) override; 40 const mojo::Callback<void(bool)>& callback) override;
40 void GetControlSignals( 41 void GetControlSignals(
41 const mojo::Callback<void(serial::DeviceControlSignalsPtr)>& callback) 42 const mojo::Callback<void(serial::DeviceControlSignalsPtr)>& callback)
42 override; 43 override;
43 void Flush(const mojo::Callback<void(bool)>& callback) override; 44 void Flush(const mojo::Callback<void(bool)>& callback) override;
44 45
45 private: 46 private:
46 void OnSendPipeReady(scoped_ptr<ReadOnlyBuffer> buffer); 47 void OnSendPipeReady(std::unique_ptr<ReadOnlyBuffer> buffer);
47 void OnSendCancelled(int32_t error); 48 void OnSendCancelled(int32_t error);
48 void OnReceivePipeReady(scoped_ptr<WritableBuffer> buffer); 49 void OnReceivePipeReady(std::unique_ptr<WritableBuffer> buffer);
49 50
50 scoped_refptr<SerialIoHandler> io_handler_; 51 scoped_refptr<SerialIoHandler> io_handler_;
51 scoped_refptr<DataSinkReceiver> receiver_; 52 scoped_refptr<DataSinkReceiver> receiver_;
52 scoped_refptr<DataSourceSender> sender_; 53 scoped_refptr<DataSourceSender> sender_;
53 54
54 mojo::StrongBinding<serial::Connection> binding_; 55 mojo::StrongBinding<serial::Connection> binding_;
55 56
56 DISALLOW_COPY_AND_ASSIGN(SerialConnection); 57 DISALLOW_COPY_AND_ASSIGN(SerialConnection);
57 }; 58 };
58 59
59 } // namespace device 60 } // namespace device
60 61
61 #endif // DEVICE_SERIAL_SERIAL_CONNECTION_H_ 62 #endif // DEVICE_SERIAL_SERIAL_CONNECTION_H_
OLDNEW
« no previous file with comments | « device/serial/data_source_unittest.cc ('k') | device/serial/serial_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698