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

Side by Side Diff: remoting/test/protocol_perftest.cc

Issue 2104363004: Remove remaining calls to deprecated MessageLoop methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CR gab Created 4 years, 5 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
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 <utility> 5 #include <utility>
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 if (!done.is_null()) 203 if (!done.is_null())
204 done.Run(); 204 done.Run();
205 } 205 }
206 206
207 protocol::FrameConsumer::PixelFormat GetPixelFormat() override { 207 protocol::FrameConsumer::PixelFormat GetPixelFormat() override {
208 return FORMAT_BGRA; 208 return FORMAT_BGRA;
209 } 209 }
210 210
211 // HostStatusObserver interface. 211 // HostStatusObserver interface.
212 void OnClientConnected(const std::string& jid) override { 212 void OnClientConnected(const std::string& jid) override {
213 message_loop_.PostTask( 213 message_loop_.task_runner()->PostTask(
214 FROM_HERE, 214 FROM_HERE, base::Bind(&ProtocolPerfTest::OnHostConnectedMainThread,
215 base::Bind(&ProtocolPerfTest::OnHostConnectedMainThread, 215 base::Unretained(this)));
216 base::Unretained(this)));
217 } 216 }
218 217
219 protected: 218 protected:
220 void WaitConnected() { 219 void WaitConnected() {
221 client_connected_ = false; 220 client_connected_ = false;
222 host_connected_ = false; 221 host_connected_ = false;
223 222
224 connecting_loop_.reset(new base::RunLoop()); 223 connecting_loop_.reset(new base::RunLoop());
225 connecting_loop_->Run(); 224 connecting_loop_->Run();
226 225
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 std::string host_pin_hash = 359 std::string host_pin_hash =
361 protocol::GetSharedSecretHash(kHostId, kHostPin); 360 protocol::GetSharedSecretHash(kHostId, kHostPin);
362 std::unique_ptr<protocol::AuthenticatorFactory> auth_factory = 361 std::unique_ptr<protocol::AuthenticatorFactory> auth_factory =
363 protocol::Me2MeHostAuthenticatorFactory::CreateWithPin( 362 protocol::Me2MeHostAuthenticatorFactory::CreateWithPin(
364 true, kHostOwner, host_cert, key_pair, "", host_pin_hash, nullptr); 363 true, kHostOwner, host_cert, key_pair, "", host_pin_hash, nullptr);
365 host_->SetAuthenticatorFactory(std::move(auth_factory)); 364 host_->SetAuthenticatorFactory(std::move(auth_factory));
366 365
367 host_->AddStatusObserver(this); 366 host_->AddStatusObserver(this);
368 host_->Start(kHostOwner); 367 host_->Start(kHostOwner);
369 368
370 message_loop_.PostTask(FROM_HERE, 369 message_loop_.task_runner()->PostTask(
371 base::Bind(&ProtocolPerfTest::StartClientAfterHost, 370 FROM_HERE, base::Bind(&ProtocolPerfTest::StartClientAfterHost,
372 base::Unretained(this))); 371 base::Unretained(this)));
373 } 372 }
374 373
375 void StartClientAfterHost() { 374 void StartClientAfterHost() {
376 client_signaling_->ConnectTo(host_signaling_.get()); 375 client_signaling_->ConnectTo(host_signaling_.get());
377 376
378 protocol::NetworkSettings network_settings( 377 protocol::NetworkSettings network_settings(
379 protocol::NetworkSettings::NAT_TRAVERSAL_OUTGOING); 378 protocol::NetworkSettings::NAT_TRAVERSAL_OUTGOING);
380 379
381 // Initialize client. 380 // Initialize client.
382 client_context_.reset( 381 client_context_.reset(
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 636
638 TEST_P(ProtocolPerfTest, TotalLatencyIce) { 637 TEST_P(ProtocolPerfTest, TotalLatencyIce) {
639 MeasureTotalLatency(false); 638 MeasureTotalLatency(false);
640 } 639 }
641 640
642 TEST_P(ProtocolPerfTest, TotalLatencyWebrtc) { 641 TEST_P(ProtocolPerfTest, TotalLatencyWebrtc) {
643 MeasureTotalLatency(true); 642 MeasureTotalLatency(true);
644 } 643 }
645 644
646 } // namespace remoting 645 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/negotiating_authenticator_unittest.cc ('k') | services/shell/tests/shell/shell_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698