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

Side by Side Diff: remoting/base/buffered_socket_writer.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/base/breakpad_win_unittest.cc ('k') | remoting/base/buffered_socket_writer.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_BASE_BUFFERED_SOCKET_WRITER_H_ 5 #ifndef REMOTING_BASE_BUFFERED_SOCKET_WRITER_H_
6 #define REMOTING_BASE_BUFFERED_SOCKET_WRITER_H_ 6 #define REMOTING_BASE_BUFFERED_SOCKET_WRITER_H_
7 7
8 #include <list> 8 #include <list>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 11 matching lines...) Expand all
22 22
23 // BufferedSocketWriter implement write data queue for stream sockets. 23 // BufferedSocketWriter implement write data queue for stream sockets.
24 class BufferedSocketWriter { 24 class BufferedSocketWriter {
25 public: 25 public:
26 typedef base::Callback<int(const scoped_refptr<net::IOBuffer>& buf, 26 typedef base::Callback<int(const scoped_refptr<net::IOBuffer>& buf,
27 int buf_len, 27 int buf_len,
28 const net::CompletionCallback& callback)> 28 const net::CompletionCallback& callback)>
29 WriteCallback; 29 WriteCallback;
30 typedef base::Callback<void(int)> WriteFailedCallback; 30 typedef base::Callback<void(int)> WriteFailedCallback;
31 31
32 static scoped_ptr<BufferedSocketWriter> CreateForSocket( 32 static std::unique_ptr<BufferedSocketWriter> CreateForSocket(
33 net::Socket* socket, 33 net::Socket* socket,
34 const WriteFailedCallback& write_failed_callback); 34 const WriteFailedCallback& write_failed_callback);
35 35
36 BufferedSocketWriter(); 36 BufferedSocketWriter();
37 virtual ~BufferedSocketWriter(); 37 virtual ~BufferedSocketWriter();
38 38
39 // Starts the writer. |write_callback| is called to write data to the 39 // Starts the writer. |write_callback| is called to write data to the
40 // socket. |write_failed_callback| is called when write operation fails. 40 // socket. |write_failed_callback| is called when write operation fails.
41 // Writing stops after the first failed write. 41 // Writing stops after the first failed write.
42 void Start(const WriteCallback& write_callback, 42 void Start(const WriteCallback& write_callback,
(...skipping 25 matching lines...) Expand all
68 DataQueue queue_; 68 DataQueue queue_;
69 69
70 bool write_pending_ = false; 70 bool write_pending_ = false;
71 71
72 base::WeakPtrFactory<BufferedSocketWriter> weak_factory_; 72 base::WeakPtrFactory<BufferedSocketWriter> weak_factory_;
73 }; 73 };
74 74
75 } // namespace remoting 75 } // namespace remoting
76 76
77 #endif // REMOTING_BASE_BUFFERED_SOCKET_WRITER_H_ 77 #endif // REMOTING_BASE_BUFFERED_SOCKET_WRITER_H_
OLDNEW
« no previous file with comments | « remoting/base/breakpad_win_unittest.cc ('k') | remoting/base/buffered_socket_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698