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

Side by Side Diff: remoting/protocol/pseudotcp_adapter.h

Issue 1864213002: Convert //remoting to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac IWYU 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 | « remoting/protocol/protocol_mock_objects.cc ('k') | remoting/protocol/pseudotcp_adapter.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 REMOTING_PROTOCOL_PSEUDOTCP_ADAPTER_H_ 5 #ifndef REMOTING_PROTOCOL_PSEUDOTCP_ADAPTER_H_
6 #define REMOTING_PROTOCOL_PSEUDOTCP_ADAPTER_H_ 6 #define REMOTING_PROTOCOL_PSEUDOTCP_ADAPTER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory>
11
10 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
11 #include "base/macros.h" 13 #include "base/macros.h"
12 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "base/threading/non_thread_safe.h" 15 #include "base/threading/non_thread_safe.h"
15 #include "net/log/net_log.h" 16 #include "net/log/net_log.h"
16 #include "remoting/protocol/p2p_stream_socket.h" 17 #include "remoting/protocol/p2p_stream_socket.h"
17 #include "third_party/webrtc/p2p/base/pseudotcp.h" 18 #include "third_party/webrtc/p2p/base/pseudotcp.h"
18 19
19 namespace remoting { 20 namespace remoting {
20 namespace protocol { 21 namespace protocol {
21 22
22 class P2PDatagramSocket; 23 class P2PDatagramSocket;
23 24
24 // PseudoTcpAdapter adapts a P2PDatagramSocket to P2PStreamSocket using 25 // PseudoTcpAdapter adapts a P2PDatagramSocket to P2PStreamSocket using
25 // PseudoTcp. Because P2PStreamSockets can be deleted during callbacks, 26 // PseudoTcp. Because P2PStreamSockets can be deleted during callbacks,
26 // while PseudoTcp cannot, the core of the PseudoTcpAdapter is reference 27 // while PseudoTcp cannot, the core of the PseudoTcpAdapter is reference
27 // counted, with a reference held by the adapter, and an additional reference 28 // counted, with a reference held by the adapter, and an additional reference
28 // held on the stack during callbacks. 29 // held on the stack during callbacks.
29 class PseudoTcpAdapter : public P2PStreamSocket, base::NonThreadSafe { 30 class PseudoTcpAdapter : public P2PStreamSocket, base::NonThreadSafe {
30 public: 31 public:
31 explicit PseudoTcpAdapter(scoped_ptr<P2PDatagramSocket> socket); 32 explicit PseudoTcpAdapter(std::unique_ptr<P2PDatagramSocket> socket);
32 ~PseudoTcpAdapter() override; 33 ~PseudoTcpAdapter() override;
33 34
34 // P2PStreamSocket implementation. 35 // P2PStreamSocket implementation.
35 int Read(const scoped_refptr<net::IOBuffer>& buffer, int buffer_size, 36 int Read(const scoped_refptr<net::IOBuffer>& buffer, int buffer_size,
36 const net::CompletionCallback& callback) override; 37 const net::CompletionCallback& callback) override;
37 int Write(const scoped_refptr<net::IOBuffer>& buffer, int buffer_size, 38 int Write(const scoped_refptr<net::IOBuffer>& buffer, int buffer_size,
38 const net::CompletionCallback& callback) override; 39 const net::CompletionCallback& callback) override;
39 40
40 int Connect(const net::CompletionCallback& callback); 41 int Connect(const net::CompletionCallback& callback);
41 42
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 75
75 net::BoundNetLog net_log_; 76 net::BoundNetLog net_log_;
76 77
77 DISALLOW_COPY_AND_ASSIGN(PseudoTcpAdapter); 78 DISALLOW_COPY_AND_ASSIGN(PseudoTcpAdapter);
78 }; 79 };
79 80
80 } // namespace protocol 81 } // namespace protocol
81 } // namespace remoting 82 } // namespace remoting
82 83
83 #endif // REMOTING_PROTOCOL_PSEUDOTCP_ADAPTER_H_ 84 #endif // REMOTING_PROTOCOL_PSEUDOTCP_ADAPTER_H_
OLDNEW
« no previous file with comments | « remoting/protocol/protocol_mock_objects.cc ('k') | remoting/protocol/pseudotcp_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698