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

Unified Diff: content/renderer/media/peer_connection_handler_jsep.cc

Issue 10833061: Rolling libjingle revison r163. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/peer_connection_handler_jsep.cc
===================================================================
--- content/renderer/media/peer_connection_handler_jsep.cc (revision 148953)
+++ content/renderer/media/peer_connection_handler_jsep.cc (working copy)
@@ -10,6 +10,7 @@
#include "base/bind.h"
#include "base/logging.h"
#include "base/string_number_conversions.h"
+#include "base/stringprintf.h"
#include "base/utf_string_conversions.h"
#include "content/renderer/media/media_stream_dependency_factory.h"
#include "content/renderer/media/media_stream_impl.h"
@@ -153,9 +154,17 @@
bool PeerConnectionHandlerJsep::processIceMessage(
const WebKit::WebICECandidateDescriptor& candidate) {
+ int m_line_index = -1;
+ if (!base::StringToInt(UTF16ToUTF8(candidate.label()), &m_line_index)) {
+ LOG(ERROR) << "Invalid candidate label: "
+ << UTF16ToUTF8(candidate.label());
+ return false;
+ }
+
Ronghua Wu (Left Chromium) 2012/07/30 18:09:10 // TODO: Set sdp_mid when mid is available in WebI
Mallinath (Gone from Chromium) 2012/07/30 18:42:08 Done.
scoped_ptr<webrtc::IceCandidateInterface> native_candidate(
dependency_factory_->CreateIceCandidate(
- UTF16ToUTF8(candidate.label()),
+ "",
Ronghua Wu (Left Chromium) 2012/07/30 18:09:10 use sdp_mid
Mallinath (Gone from Chromium) 2012/07/30 18:42:08 Done.
+ m_line_index,
UTF16ToUTF8(candidate.candidateLine())));
if (!native_candidate.get()) {
LOG(ERROR) << "Could not create native ICE candidate";
@@ -279,7 +288,7 @@
const webrtc::IceCandidateInterface* candidate) {
WebKit::WebICECandidateDescriptor web_candidate;
- std::string label = candidate->label();
+ std::string label = StringPrintf("%d", candidate->sdp_mline_index());
std::string sdp;
if (!candidate->ToString(&sdp)) {
LOG(ERROR) << "Could not get SDP string";
@@ -313,9 +322,16 @@
for (size_t i = 0; i < description.numberOfAddedCandidates(); ++i) {
WebKit::WebICECandidateDescriptor candidate = description.candidate(i);
+ int m_line_index = -1;
+ if (!base::StringToInt(UTF16ToUTF8(candidate.label()), &m_line_index)) {
+ LOG(ERROR) << "Invalid candidate label: "
+ << UTF16ToUTF8(candidate.label());
+ continue;
+ }
scoped_ptr<webrtc::IceCandidateInterface> native_candidate(
dependency_factory_->CreateIceCandidate(
- UTF16ToUTF8(candidate.label()),
+ "",
Ronghua Wu (Left Chromium) 2012/07/30 18:09:10 dito
Mallinath (Gone from Chromium) 2012/07/30 18:42:08 Done.
+ m_line_index,
UTF16ToUTF8(candidate.candidateLine())));
if (!native_desc->AddCandidate(native_candidate.get()))
LOG(ERROR) << "Failed to add candidate to native session description";

Powered by Google App Engine
This is Rietveld 408576698