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

Unified Diff: content/renderer/media/media_stream_center.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/media_stream_center.cc
===================================================================
--- content/renderer/media/media_stream_center.cc (revision 148953)
+++ content/renderer/media/media_stream_center.cc (working copy)
@@ -7,6 +7,7 @@
#include <string>
#include "base/logging.h"
+#include "base/string_number_conversions.h"
wjia(left Chromium) 2012/07/30 18:19:10 file order.
Mallinath (Gone from Chromium) 2012/07/30 18:42:08 Done.
#include "base/memory/scoped_ptr.h"
#include "base/utf_string_conversions.h"
#include "content/renderer/media/media_stream_impl.h"
@@ -141,8 +142,14 @@
WebKit::WebString MediaStreamCenter::constructSDP(
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 WebKit::WebString();
+ }
scoped_ptr<webrtc::IceCandidateInterface> native_candidate(
webrtc::CreateIceCandidate(UTF16ToUTF8(candidate.label()),
+ m_line_index,
UTF16ToUTF8(candidate.candidateLine())));
std::string sdp;
if (!native_candidate->ToString(&sdp))
@@ -159,8 +166,15 @@
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(
webrtc::CreateIceCandidate(UTF16ToUTF8(candidate.label()),
+ m_line_index,
UTF16ToUTF8(candidate.candidateLine())));
native_desc->AddCandidate(native_candidate.get());
}

Powered by Google App Engine
This is Rietveld 408576698