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

Side by Side Diff: remoting/client/jni/chromoting_jni_instance.cc

Issue 1806963002: Reduce APK size by disabling WebRTC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change macro name, use separate config Created 4 years, 9 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/client/jni/chromoting_jni_instance.h" 5 #include "remoting/client/jni/chromoting_jni_instance.h"
6 6
7 #include <android/log.h> 7 #include <android/log.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <utility> 10 #include <utility>
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 scoped_refptr<protocol::TransportContext> transport_context = 401 scoped_refptr<protocol::TransportContext> transport_context =
402 new protocol::TransportContext( 402 new protocol::TransportContext(
403 signaling_.get(), 403 signaling_.get(),
404 make_scoped_ptr(new protocol::ChromiumPortAllocatorFactory()), 404 make_scoped_ptr(new protocol::ChromiumPortAllocatorFactory()),
405 make_scoped_ptr( 405 make_scoped_ptr(
406 new ChromiumUrlRequestFactory(jni_runtime_->url_requester())), 406 new ChromiumUrlRequestFactory(jni_runtime_->url_requester())),
407 protocol::NetworkSettings( 407 protocol::NetworkSettings(
408 protocol::NetworkSettings::NAT_TRAVERSAL_FULL), 408 protocol::NetworkSettings::NAT_TRAVERSAL_FULL),
409 protocol::TransportRole::CLIENT); 409 protocol::TransportRole::CLIENT);
410 410
411 #if defined(ENABLE_WEBRTC_REMOTING_CLIENT)
411 if (flags_.find("useWebrtc") != std::string::npos) { 412 if (flags_.find("useWebrtc") != std::string::npos) {
412 VLOG(0) << "Attempting to connect using WebRTC."; 413 VLOG(0) << "Attempting to connect using WebRTC.";
413 scoped_ptr<protocol::CandidateSessionConfig> protocol_config = 414 scoped_ptr<protocol::CandidateSessionConfig> protocol_config =
414 protocol::CandidateSessionConfig::CreateEmpty(); 415 protocol::CandidateSessionConfig::CreateEmpty();
415 protocol_config->set_webrtc_supported(true); 416 protocol_config->set_webrtc_supported(true);
416 protocol_config->set_ice_supported(false); 417 protocol_config->set_ice_supported(false);
417 client_->set_protocol_config(std::move(protocol_config)); 418 client_->set_protocol_config(std::move(protocol_config));
418 } 419 }
419 420 #endif // if defined(ENABLE_WEBRTC_REMOTING_CLIENT)
420 client_->Start(signaling_.get(), client_auth_config_, transport_context, 421 client_->Start(signaling_.get(), client_auth_config_, transport_context,
421 host_jid_, capabilities_); 422 host_jid_, capabilities_);
422 } 423 }
423 424
424 void ChromotingJniInstance::FetchSecret( 425 void ChromotingJniInstance::FetchSecret(
425 bool pairable, 426 bool pairable,
426 const protocol::SecretFetchedCallback& callback) { 427 const protocol::SecretFetchedCallback& callback) {
427 if (!jni_runtime_->ui_task_runner()->BelongsToCurrentThread()) { 428 if (!jni_runtime_->ui_task_runner()->BelongsToCurrentThread()) {
428 jni_runtime_->ui_task_runner()->PostTask( 429 jni_runtime_->ui_task_runner()->PostTask(
429 FROM_HERE, base::Bind(&ChromotingJniInstance::FetchSecret, 430 FROM_HERE, base::Bind(&ChromotingJniInstance::FetchSecret,
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 perf_tracker_->round_trip_ms()); 492 perf_tracker_->round_trip_ms());
492 493
493 client_status_logger_->LogStatistics(perf_tracker_.get()); 494 client_status_logger_->LogStatistics(perf_tracker_.get());
494 495
495 jni_runtime_->network_task_runner()->PostDelayedTask( 496 jni_runtime_->network_task_runner()->PostDelayedTask(
496 FROM_HERE, base::Bind(&ChromotingJniInstance::LogPerfStats, this), 497 FROM_HERE, base::Bind(&ChromotingJniInstance::LogPerfStats, this),
497 base::TimeDelta::FromMilliseconds(kPerfStatsIntervalMs)); 498 base::TimeDelta::FromMilliseconds(kPerfStatsIntervalMs));
498 } 499 }
499 500
500 } // namespace remoting 501 } // namespace remoting
OLDNEW
« remoting/client/chromoting_client.cc ('K') | « remoting/client/chromoting_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698