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

Side by Side Diff: webrtc/pc/peerconnection.cc

Issue 2731813002: Add the option to disable IPv6 ICE candidates on WiFi (Closed)
Patch Set: Fix the rtc_unittests Created 3 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 /* 1 /*
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 CandidateNetworkPolicy candidate_network_policy; 470 CandidateNetworkPolicy candidate_network_policy;
471 int audio_jitter_buffer_max_packets; 471 int audio_jitter_buffer_max_packets;
472 bool audio_jitter_buffer_fast_accelerate; 472 bool audio_jitter_buffer_fast_accelerate;
473 int ice_connection_receiving_timeout; 473 int ice_connection_receiving_timeout;
474 int ice_backup_candidate_pair_ping_interval; 474 int ice_backup_candidate_pair_ping_interval;
475 ContinualGatheringPolicy continual_gathering_policy; 475 ContinualGatheringPolicy continual_gathering_policy;
476 std::vector<rtc::scoped_refptr<rtc::RTCCertificate>> certificates; 476 std::vector<rtc::scoped_refptr<rtc::RTCCertificate>> certificates;
477 bool prioritize_most_likely_ice_candidate_pairs; 477 bool prioritize_most_likely_ice_candidate_pairs;
478 struct cricket::MediaConfig media_config; 478 struct cricket::MediaConfig media_config;
479 bool disable_ipv6; 479 bool disable_ipv6;
480 bool disable_ipv6_on_wifi;
480 bool enable_rtp_data_channel; 481 bool enable_rtp_data_channel;
481 bool enable_quic; 482 bool enable_quic;
482 rtc::Optional<int> screencast_min_bitrate; 483 rtc::Optional<int> screencast_min_bitrate;
483 rtc::Optional<bool> combined_audio_video_bwe; 484 rtc::Optional<bool> combined_audio_video_bwe;
484 rtc::Optional<bool> enable_dtls_srtp; 485 rtc::Optional<bool> enable_dtls_srtp;
485 int ice_candidate_pool_size; 486 int ice_candidate_pool_size;
486 bool prune_turn_ports; 487 bool prune_turn_ports;
487 bool presume_writable_when_fully_relayed; 488 bool presume_writable_when_fully_relayed;
488 bool enable_ice_renomination; 489 bool enable_ice_renomination;
489 bool redetermine_role_on_ice_restart; 490 bool redetermine_role_on_ice_restart;
(...skipping 12 matching lines...) Expand all
502 o.audio_jitter_buffer_fast_accelerate && 503 o.audio_jitter_buffer_fast_accelerate &&
503 ice_connection_receiving_timeout == 504 ice_connection_receiving_timeout ==
504 o.ice_connection_receiving_timeout && 505 o.ice_connection_receiving_timeout &&
505 ice_backup_candidate_pair_ping_interval == 506 ice_backup_candidate_pair_ping_interval ==
506 o.ice_backup_candidate_pair_ping_interval && 507 o.ice_backup_candidate_pair_ping_interval &&
507 continual_gathering_policy == o.continual_gathering_policy && 508 continual_gathering_policy == o.continual_gathering_policy &&
508 certificates == o.certificates && 509 certificates == o.certificates &&
509 prioritize_most_likely_ice_candidate_pairs == 510 prioritize_most_likely_ice_candidate_pairs ==
510 o.prioritize_most_likely_ice_candidate_pairs && 511 o.prioritize_most_likely_ice_candidate_pairs &&
511 media_config == o.media_config && disable_ipv6 == o.disable_ipv6 && 512 media_config == o.media_config && disable_ipv6 == o.disable_ipv6 &&
513 disable_ipv6_on_wifi == o.disable_ipv6_on_wifi &&
512 enable_rtp_data_channel == o.enable_rtp_data_channel && 514 enable_rtp_data_channel == o.enable_rtp_data_channel &&
513 enable_quic == o.enable_quic && 515 enable_quic == o.enable_quic &&
514 screencast_min_bitrate == o.screencast_min_bitrate && 516 screencast_min_bitrate == o.screencast_min_bitrate &&
515 combined_audio_video_bwe == o.combined_audio_video_bwe && 517 combined_audio_video_bwe == o.combined_audio_video_bwe &&
516 enable_dtls_srtp == o.enable_dtls_srtp && 518 enable_dtls_srtp == o.enable_dtls_srtp &&
517 ice_candidate_pool_size == o.ice_candidate_pool_size && 519 ice_candidate_pool_size == o.ice_candidate_pool_size &&
518 prune_turn_ports == o.prune_turn_ports && 520 prune_turn_ports == o.prune_turn_ports &&
519 presume_writable_when_fully_relayed == 521 presume_writable_when_fully_relayed ==
520 o.presume_writable_when_fully_relayed && 522 o.presume_writable_when_fully_relayed &&
521 enable_ice_renomination == o.enable_ice_renomination && 523 enable_ice_renomination == o.enable_ice_renomination &&
(...skipping 1976 matching lines...) Expand 10 before | Expand all | Expand 10 after
2498 RTCErrorType::NONE) { 2500 RTCErrorType::NONE) {
2499 return false; 2501 return false;
2500 } 2502 }
2501 2503
2502 port_allocator_->Initialize(); 2504 port_allocator_->Initialize();
2503 2505
2504 // To handle both internal and externally created port allocator, we will 2506 // To handle both internal and externally created port allocator, we will
2505 // enable BUNDLE here. 2507 // enable BUNDLE here.
2506 int portallocator_flags = port_allocator_->flags(); 2508 int portallocator_flags = port_allocator_->flags();
2507 portallocator_flags |= cricket::PORTALLOCATOR_ENABLE_SHARED_SOCKET | 2509 portallocator_flags |= cricket::PORTALLOCATOR_ENABLE_SHARED_SOCKET |
2508 cricket::PORTALLOCATOR_ENABLE_IPV6; 2510 cricket::PORTALLOCATOR_ENABLE_IPV6 |
2511 cricket::PORTALLOCATOR_ENABLE_IPV6_ON_WIFI;
2509 // If the disable-IPv6 flag was specified, we'll not override it 2512 // If the disable-IPv6 flag was specified, we'll not override it
2510 // by experiment. 2513 // by experiment.
2511 if (configuration.disable_ipv6) { 2514 if (configuration.disable_ipv6) {
2512 portallocator_flags &= ~(cricket::PORTALLOCATOR_ENABLE_IPV6); 2515 portallocator_flags &= ~(cricket::PORTALLOCATOR_ENABLE_IPV6);
2513 } else if (webrtc::field_trial::FindFullName("WebRTC-IPv6Default") 2516 } else if (webrtc::field_trial::FindFullName("WebRTC-IPv6Default")
2514 .find("Disabled") == 0) { 2517 .find("Disabled") == 0) {
2515 portallocator_flags &= ~(cricket::PORTALLOCATOR_ENABLE_IPV6); 2518 portallocator_flags &= ~(cricket::PORTALLOCATOR_ENABLE_IPV6);
2516 } 2519 }
2517 2520
2521 if (configuration.disable_ipv6_on_wifi) {
2522 portallocator_flags &= ~(cricket::PORTALLOCATOR_ENABLE_IPV6_ON_WIFI);
2523 LOG(LS_INFO) << "IPv6 candidates on Wi-Fi are disabled.";
2524 }
2525
2518 if (configuration.tcp_candidate_policy == kTcpCandidatePolicyDisabled) { 2526 if (configuration.tcp_candidate_policy == kTcpCandidatePolicyDisabled) {
2519 portallocator_flags |= cricket::PORTALLOCATOR_DISABLE_TCP; 2527 portallocator_flags |= cricket::PORTALLOCATOR_DISABLE_TCP;
2520 LOG(LS_INFO) << "TCP candidates are disabled."; 2528 LOG(LS_INFO) << "TCP candidates are disabled.";
2521 } 2529 }
2522 2530
2523 if (configuration.candidate_network_policy == 2531 if (configuration.candidate_network_policy ==
2524 kCandidateNetworkPolicyLowCost) { 2532 kCandidateNetworkPolicyLowCost) {
2525 portallocator_flags |= cricket::PORTALLOCATOR_DISABLE_COSTLY_NETWORKS; 2533 portallocator_flags |= cricket::PORTALLOCATOR_DISABLE_COSTLY_NETWORKS;
2526 LOG(LS_INFO) << "Do not gather candidates on high-cost networks"; 2534 LOG(LS_INFO) << "Do not gather candidates on high-cost networks";
2527 } 2535 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
2561 } 2569 }
2562 return event_log_->StartLogging(file, max_size_bytes); 2570 return event_log_->StartLogging(file, max_size_bytes);
2563 } 2571 }
2564 2572
2565 void PeerConnection::StopRtcEventLog_w() { 2573 void PeerConnection::StopRtcEventLog_w() {
2566 if (event_log_) { 2574 if (event_log_) {
2567 event_log_->StopLogging(); 2575 event_log_->StopLogging();
2568 } 2576 }
2569 } 2577 }
2570 } // namespace webrtc 2578 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/p2p/client/basicportallocator_unittest.cc ('k') | webrtc/sdk/android/api/org/webrtc/PeerConnection.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698