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

Side by Side Diff: talk/app/webrtc/peerconnection.cc

Issue 1528843005: Add support for GCM cipher suites from RFC 7714. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Updates after feedback from Peter Created 5 years 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 * libjingle 2 * libjingle
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 1454 matching lines...) Expand 10 before | Expand all | Expand 10 after
1465 !remote_video_tracks_.empty(); 1465 !remote_video_tracks_.empty();
1466 } 1466 }
1467 session_options->bundle_enabled = 1467 session_options->bundle_enabled =
1468 session_options->bundle_enabled && 1468 session_options->bundle_enabled &&
1469 (session_options->has_audio() || session_options->has_video() || 1469 (session_options->has_audio() || session_options->has_video() ||
1470 session_options->has_data()); 1470 session_options->has_data());
1471 1471
1472 if (session_->data_channel_type() == cricket::DCT_SCTP && HasDataChannels()) { 1472 if (session_->data_channel_type() == cricket::DCT_SCTP && HasDataChannels()) {
1473 session_options->data_channel_type = cricket::DCT_SCTP; 1473 session_options->data_channel_type = cricket::DCT_SCTP;
1474 } 1474 }
1475 session_options->enable_gcm_crypto_suites =
1476 factory_->options().enable_gcm_crypto_suites;
1475 return true; 1477 return true;
1476 } 1478 }
1477 1479
1478 bool PeerConnection::GetOptionsForAnswer( 1480 bool PeerConnection::GetOptionsForAnswer(
1479 const MediaConstraintsInterface* constraints, 1481 const MediaConstraintsInterface* constraints,
1480 cricket::MediaSessionOptions* session_options) { 1482 cricket::MediaSessionOptions* session_options) {
1481 session_options->recv_audio = false; 1483 session_options->recv_audio = false;
1482 session_options->recv_video = false; 1484 session_options->recv_video = false;
1483 if (!ParseConstraintsForAnswer(constraints, session_options)) { 1485 if (!ParseConstraintsForAnswer(constraints, session_options)) {
1484 return false; 1486 return false;
1485 } 1487 }
1486 1488
1487 AddSendStreams(session_options, senders_, rtp_data_channels_); 1489 AddSendStreams(session_options, senders_, rtp_data_channels_);
1488 session_options->bundle_enabled = 1490 session_options->bundle_enabled =
1489 session_options->bundle_enabled && 1491 session_options->bundle_enabled &&
1490 (session_options->has_audio() || session_options->has_video() || 1492 (session_options->has_audio() || session_options->has_video() ||
1491 session_options->has_data()); 1493 session_options->has_data());
1492 1494
1493 // RTP data channel is handled in MediaSessionOptions::AddStream. SCTP streams 1495 // RTP data channel is handled in MediaSessionOptions::AddStream. SCTP streams
1494 // are not signaled in the SDP so does not go through that path and must be 1496 // are not signaled in the SDP so does not go through that path and must be
1495 // handled here. 1497 // handled here.
1496 if (session_->data_channel_type() == cricket::DCT_SCTP) { 1498 if (session_->data_channel_type() == cricket::DCT_SCTP) {
1497 session_options->data_channel_type = cricket::DCT_SCTP; 1499 session_options->data_channel_type = cricket::DCT_SCTP;
1498 } 1500 }
1501 session_options->enable_gcm_crypto_suites =
1502 factory_->options().enable_gcm_crypto_suites;
1499 return true; 1503 return true;
1500 } 1504 }
1501 1505
1502 void PeerConnection::RemoveTracks(cricket::MediaType media_type) { 1506 void PeerConnection::RemoveTracks(cricket::MediaType media_type) {
1503 UpdateLocalTracks(std::vector<cricket::StreamParams>(), media_type); 1507 UpdateLocalTracks(std::vector<cricket::StreamParams>(), media_type);
1504 UpdateRemoteStreamsList(std::vector<cricket::StreamParams>(), false, 1508 UpdateRemoteStreamsList(std::vector<cricket::StreamParams>(), false,
1505 media_type, nullptr); 1509 media_type, nullptr);
1506 } 1510 }
1507 1511
1508 void PeerConnection::UpdateRemoteStreamsList( 1512 void PeerConnection::UpdateRemoteStreamsList(
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
2020 DataChannel* PeerConnection::FindDataChannelBySid(int sid) const { 2024 DataChannel* PeerConnection::FindDataChannelBySid(int sid) const {
2021 for (const auto& channel : sctp_data_channels_) { 2025 for (const auto& channel : sctp_data_channels_) {
2022 if (channel->id() == sid) { 2026 if (channel->id() == sid) {
2023 return channel; 2027 return channel;
2024 } 2028 }
2025 } 2029 }
2026 return nullptr; 2030 return nullptr;
2027 } 2031 }
2028 2032
2029 } // namespace webrtc 2033 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | talk/app/webrtc/peerconnection_unittest.cc » ('j') | talk/session/media/mediasession.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698