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

Side by Side Diff: remoting/base/buffered_socket_writer.cc

Issue 2230193002: remoting: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 4 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 | « no previous file | remoting/client/jni/jni_display_handler.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 #include "remoting/base/buffered_socket_writer.h" 5 #include "remoting/base/buffered_socket_writer.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "net/base/io_buffer.h" 10 #include "net/base/io_buffer.h"
(...skipping 29 matching lines...) Expand all
40 net::Socket* socket, 40 net::Socket* socket,
41 const WriteFailedCallback& write_failed_callback) { 41 const WriteFailedCallback& write_failed_callback) {
42 std::unique_ptr<BufferedSocketWriter> result(new BufferedSocketWriter()); 42 std::unique_ptr<BufferedSocketWriter> result(new BufferedSocketWriter());
43 result->Start(base::Bind(&WriteNetSocket, socket), write_failed_callback); 43 result->Start(base::Bind(&WriteNetSocket, socket), write_failed_callback);
44 return result; 44 return result;
45 } 45 }
46 46
47 BufferedSocketWriter::BufferedSocketWriter() : weak_factory_(this) {} 47 BufferedSocketWriter::BufferedSocketWriter() : weak_factory_(this) {}
48 48
49 BufferedSocketWriter::~BufferedSocketWriter() { 49 BufferedSocketWriter::~BufferedSocketWriter() {
50 STLDeleteElements(&queue_); 50 base::STLDeleteElements(&queue_);
51 } 51 }
52 52
53 void BufferedSocketWriter::Start( 53 void BufferedSocketWriter::Start(
54 const WriteCallback& write_callback, 54 const WriteCallback& write_callback,
55 const WriteFailedCallback& write_failed_callback) { 55 const WriteFailedCallback& write_failed_callback) {
56 write_callback_ = write_callback; 56 write_callback_ = write_callback;
57 write_failed_callback_ = write_failed_callback; 57 write_failed_callback_ = write_failed_callback;
58 DoWrite(); 58 DoWrite();
59 } 59 }
60 60
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 DCHECK(write_pending_); 120 DCHECK(write_pending_);
121 write_pending_ = false; 121 write_pending_ = false;
122 122
123 base::WeakPtr<BufferedSocketWriter> self = weak_factory_.GetWeakPtr(); 123 base::WeakPtr<BufferedSocketWriter> self = weak_factory_.GetWeakPtr();
124 HandleWriteResult(result); 124 HandleWriteResult(result);
125 if (self) 125 if (self)
126 DoWrite(); 126 DoWrite();
127 } 127 }
128 128
129 } // namespace remoting 129 } // namespace remoting
OLDNEW
« no previous file with comments | « no previous file | remoting/client/jni/jni_display_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698