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

Side by Side Diff: remoting/protocol/libjingle_transport_factory.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/jingle_session_unittest.cc ('k') | remoting/protocol/message_decoder.h » ('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 #include "remoting/protocol/libjingle_transport_factory.h" 5 #include "remoting/protocol/libjingle_transport_factory.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 108
109 base::WeakPtrFactory<LibjingleTransport> weak_factory_; 109 base::WeakPtrFactory<LibjingleTransport> weak_factory_;
110 110
111 DISALLOW_COPY_AND_ASSIGN(LibjingleTransport); 111 DISALLOW_COPY_AND_ASSIGN(LibjingleTransport);
112 }; 112 };
113 113
114 LibjingleTransport::LibjingleTransport(cricket::PortAllocator* port_allocator, 114 LibjingleTransport::LibjingleTransport(cricket::PortAllocator* port_allocator,
115 const NetworkSettings& network_settings) 115 const NetworkSettings& network_settings)
116 : port_allocator_(port_allocator), 116 : port_allocator_(port_allocator),
117 network_settings_(network_settings), 117 network_settings_(network_settings),
118 event_handler_(NULL), 118 event_handler_(nullptr),
119 ice_username_fragment_( 119 ice_username_fragment_(
120 rtc::CreateRandomString(cricket::ICE_UFRAG_LENGTH)), 120 rtc::CreateRandomString(cricket::ICE_UFRAG_LENGTH)),
121 ice_password_(rtc::CreateRandomString(cricket::ICE_PWD_LENGTH)), 121 ice_password_(rtc::CreateRandomString(cricket::ICE_PWD_LENGTH)),
122 can_start_(false), 122 can_start_(false),
123 channel_was_writable_(false), 123 channel_was_writable_(false),
124 connect_attempts_left_(kMaxReconnectAttempts), 124 connect_attempts_left_(kMaxReconnectAttempts),
125 weak_factory_(this) { 125 weak_factory_(this) {
126 DCHECK(!ice_username_fragment_.empty()); 126 DCHECK(!ice_username_fragment_.empty());
127 DCHECK(!ice_password_.empty()); 127 DCHECK(!ice_password_.empty());
128 } 128 }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 if (can_start_) 171 if (can_start_)
172 DoStart(); 172 DoStart();
173 } 173 }
174 174
175 void LibjingleTransport::DoStart() { 175 void LibjingleTransport::DoStart() {
176 DCHECK(!channel_.get()); 176 DCHECK(!channel_.get());
177 177
178 // Create P2PTransportChannel, attach signal handlers and connect it. 178 // Create P2PTransportChannel, attach signal handlers and connect it.
179 // TODO(sergeyu): Specify correct component ID for the channel. 179 // TODO(sergeyu): Specify correct component ID for the channel.
180 channel_.reset(new cricket::P2PTransportChannel( 180 channel_.reset(new cricket::P2PTransportChannel(
181 std::string(), 0, NULL, port_allocator_)); 181 std::string(), 0, nullptr, port_allocator_));
182 channel_->SetIceProtocolType(cricket::ICEPROTO_GOOGLE); 182 channel_->SetIceProtocolType(cricket::ICEPROTO_GOOGLE);
183 channel_->SetIceCredentials(ice_username_fragment_, ice_password_); 183 channel_->SetIceCredentials(ice_username_fragment_, ice_password_);
184 channel_->SignalRequestSignaling.connect( 184 channel_->SignalRequestSignaling.connect(
185 this, &LibjingleTransport::OnRequestSignaling); 185 this, &LibjingleTransport::OnRequestSignaling);
186 channel_->SignalCandidateReady.connect( 186 channel_->SignalCandidateReady.connect(
187 this, &LibjingleTransport::OnCandidateReady); 187 this, &LibjingleTransport::OnCandidateReady);
188 channel_->SignalRouteChange.connect( 188 channel_->SignalRouteChange.connect(
189 this, &LibjingleTransport::OnRouteChange); 189 this, &LibjingleTransport::OnRouteChange);
190 channel_->SignalWritableState.connect( 190 channel_->SignalWritableState.connect(
191 this, &LibjingleTransport::OnWritableState); 191 this, &LibjingleTransport::OnWritableState);
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 last_jingle_info_update_time_ = base::TimeTicks::Now(); 410 last_jingle_info_update_time_ = base::TimeTicks::Now();
411 411
412 while (!on_jingle_info_callbacks_.empty()) { 412 while (!on_jingle_info_callbacks_.empty()) {
413 on_jingle_info_callbacks_.begin()->Run(); 413 on_jingle_info_callbacks_.begin()->Run();
414 on_jingle_info_callbacks_.pop_front(); 414 on_jingle_info_callbacks_.pop_front();
415 } 415 }
416 } 416 }
417 417
418 } // namespace protocol 418 } // namespace protocol
419 } // namespace remoting 419 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/jingle_session_unittest.cc ('k') | remoting/protocol/message_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698