| OLD | NEW |
| 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 1401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1412 // The simplest (and most future-compatible) way to tell if the config was | 1412 // The simplest (and most future-compatible) way to tell if the config was |
| 1413 // modified in an invalid way is to copy each property we do support | 1413 // modified in an invalid way is to copy each property we do support |
| 1414 // modifying, then use operator==. There are far more properties we don't | 1414 // modifying, then use operator==. There are far more properties we don't |
| 1415 // support modifying than those we do, and more could be added. | 1415 // support modifying than those we do, and more could be added. |
| 1416 RTCConfiguration modified_config = configuration_; | 1416 RTCConfiguration modified_config = configuration_; |
| 1417 modified_config.servers = configuration.servers; | 1417 modified_config.servers = configuration.servers; |
| 1418 modified_config.type = configuration.type; | 1418 modified_config.type = configuration.type; |
| 1419 modified_config.ice_candidate_pool_size = | 1419 modified_config.ice_candidate_pool_size = |
| 1420 configuration.ice_candidate_pool_size; | 1420 configuration.ice_candidate_pool_size; |
| 1421 modified_config.prune_turn_ports = configuration.prune_turn_ports; | 1421 modified_config.prune_turn_ports = configuration.prune_turn_ports; |
| 1422 modified_config.ice_check_min_interval = configuration.ice_check_min_interval; |
| 1422 if (configuration != modified_config) { | 1423 if (configuration != modified_config) { |
| 1423 LOG(LS_ERROR) << "Modifying the configuration in an unsupported way."; | 1424 LOG(LS_ERROR) << "Modifying the configuration in an unsupported way."; |
| 1424 return SafeSetError(RTCErrorType::INVALID_MODIFICATION, error); | 1425 return SafeSetError(RTCErrorType::INVALID_MODIFICATION, error); |
| 1425 } | 1426 } |
| 1426 | 1427 |
| 1427 // Note that this isn't possible through chromium, since it's an unsigned | 1428 // Note that this isn't possible through chromium, since it's an unsigned |
| 1428 // short in WebIDL. | 1429 // short in WebIDL. |
| 1429 if (configuration.ice_candidate_pool_size < 0 || | 1430 if (configuration.ice_candidate_pool_size < 0 || |
| 1430 configuration.ice_candidate_pool_size > UINT16_MAX) { | 1431 configuration.ice_candidate_pool_size > UINT16_MAX) { |
| 1431 return SafeSetError(RTCErrorType::INVALID_RANGE, error); | 1432 return SafeSetError(RTCErrorType::INVALID_RANGE, error); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1452 } | 1453 } |
| 1453 | 1454 |
| 1454 // As described in JSEP, calling setConfiguration with new ICE servers or | 1455 // As described in JSEP, calling setConfiguration with new ICE servers or |
| 1455 // candidate policy must set a "needs-ice-restart" bit so that the next offer | 1456 // candidate policy must set a "needs-ice-restart" bit so that the next offer |
| 1456 // triggers an ICE restart which will pick up the changes. | 1457 // triggers an ICE restart which will pick up the changes. |
| 1457 if (modified_config.servers != configuration_.servers || | 1458 if (modified_config.servers != configuration_.servers || |
| 1458 modified_config.type != configuration_.type || | 1459 modified_config.type != configuration_.type || |
| 1459 modified_config.prune_turn_ports != configuration_.prune_turn_ports) { | 1460 modified_config.prune_turn_ports != configuration_.prune_turn_ports) { |
| 1460 session_->SetNeedsIceRestartFlag(); | 1461 session_->SetNeedsIceRestartFlag(); |
| 1461 } | 1462 } |
| 1463 |
| 1464 if (modified_config.ice_check_min_interval != |
| 1465 configuration_.ice_check_min_interval) { |
| 1466 session_->SetIceConfig(session_->ParseIceConfig(modified_config)); |
| 1467 } |
| 1468 |
| 1462 configuration_ = modified_config; | 1469 configuration_ = modified_config; |
| 1463 return SafeSetError(RTCErrorType::NONE, error); | 1470 return SafeSetError(RTCErrorType::NONE, error); |
| 1464 } | 1471 } |
| 1465 | 1472 |
| 1466 bool PeerConnection::AddIceCandidate( | 1473 bool PeerConnection::AddIceCandidate( |
| 1467 const IceCandidateInterface* ice_candidate) { | 1474 const IceCandidateInterface* ice_candidate) { |
| 1468 TRACE_EVENT0("webrtc", "PeerConnection::AddIceCandidate"); | 1475 TRACE_EVENT0("webrtc", "PeerConnection::AddIceCandidate"); |
| 1469 if (IsClosed()) { | 1476 if (IsClosed()) { |
| 1470 return false; | 1477 return false; |
| 1471 } | 1478 } |
| (...skipping 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2563 | 2570 |
| 2564 bool PeerConnection::StartRtcEventLog_w(rtc::PlatformFile file, | 2571 bool PeerConnection::StartRtcEventLog_w(rtc::PlatformFile file, |
| 2565 int64_t max_size_bytes) { | 2572 int64_t max_size_bytes) { |
| 2566 return event_log_->StartLogging(file, max_size_bytes); | 2573 return event_log_->StartLogging(file, max_size_bytes); |
| 2567 } | 2574 } |
| 2568 | 2575 |
| 2569 void PeerConnection::StopRtcEventLog_w() { | 2576 void PeerConnection::StopRtcEventLog_w() { |
| 2570 event_log_->StopLogging(); | 2577 event_log_->StopLogging(); |
| 2571 } | 2578 } |
| 2572 } // namespace webrtc | 2579 } // namespace webrtc |
| OLD | NEW |