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

Side by Side Diff: remoting/protocol/fake_stream_socket.cc

Issue 810133003: replace NULL->nullptr in src/remoting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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/fake_session.cc ('k') | remoting/protocol/host_control_dispatcher.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 #include "remoting/protocol/fake_stream_socket.h" 5 #include "remoting/protocol/fake_stream_socket.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/single_thread_task_runner.h" 8 #include "base/single_thread_task_runner.h"
9 #include "base/thread_task_runner_handle.h" 9 #include "base/thread_task_runner_handle.h"
10 #include "net/base/address_list.h" 10 #include "net/base/address_list.h"
(...skipping 25 matching lines...) Expand all
36 EXPECT_TRUE(task_runner_->BelongsToCurrentThread()); 36 EXPECT_TRUE(task_runner_->BelongsToCurrentThread());
37 input_data_.insert(input_data_.end(), data.begin(), data.end()); 37 input_data_.insert(input_data_.end(), data.begin(), data.end());
38 // Complete pending read if any. 38 // Complete pending read if any.
39 if (!read_callback_.is_null()) { 39 if (!read_callback_.is_null()) {
40 int result = std::min(read_buffer_size_, 40 int result = std::min(read_buffer_size_,
41 static_cast<int>(input_data_.size() - input_pos_)); 41 static_cast<int>(input_data_.size() - input_pos_));
42 EXPECT_GT(result, 0); 42 EXPECT_GT(result, 0);
43 memcpy(read_buffer_->data(), 43 memcpy(read_buffer_->data(),
44 &(*input_data_.begin()) + input_pos_, result); 44 &(*input_data_.begin()) + input_pos_, result);
45 input_pos_ += result; 45 input_pos_ += result;
46 read_buffer_ = NULL; 46 read_buffer_ = nullptr;
47 47
48 net::CompletionCallback callback = read_callback_; 48 net::CompletionCallback callback = read_callback_;
49 read_callback_.Reset(); 49 read_callback_.Reset();
50 callback.Run(result); 50 callback.Run(result);
51 } 51 }
52 } 52 }
53 53
54 void FakeStreamSocket::PairWith(FakeStreamSocket* peer_socket) { 54 void FakeStreamSocket::PairWith(FakeStreamSocket* peer_socket) {
55 EXPECT_TRUE(task_runner_->BelongsToCurrentThread()); 55 EXPECT_TRUE(task_runner_->BelongsToCurrentThread());
56 peer_socket_ = peer_socket->GetWeakPtr(); 56 peer_socket_ = peer_socket->GetWeakPtr();
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 if (channels_.find(name) != channels_.end()) 268 if (channels_.find(name) != channels_.end())
269 callback.Run(owned_channel.Pass()); 269 callback.Run(owned_channel.Pass());
270 } 270 }
271 271
272 void FakeStreamChannelFactory::CancelChannelCreation(const std::string& name) { 272 void FakeStreamChannelFactory::CancelChannelCreation(const std::string& name) {
273 channels_.erase(name); 273 channels_.erase(name);
274 } 274 }
275 275
276 } // namespace protocol 276 } // namespace protocol
277 } // namespace remoting 277 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/fake_session.cc ('k') | remoting/protocol/host_control_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698