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

Unified Diff: third_party/WebKit/Source/modules/mediastream/RTCIceCandidate.cpp

Issue 2007923003: Use Init dictionaries in RTCPeerConnection legacy methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 7 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: third_party/WebKit/Source/modules/mediastream/RTCIceCandidate.cpp
diff --git a/third_party/WebKit/Source/modules/mediastream/RTCIceCandidate.cpp b/third_party/WebKit/Source/modules/mediastream/RTCIceCandidate.cpp
index 98ba8c5601516846c0284e9844fc75f52c54cc57..dde7c1c7c28868f2ddc1cea54ac05b001c6d1117 100644
--- a/third_party/WebKit/Source/modules/mediastream/RTCIceCandidate.cpp
+++ b/third_party/WebKit/Source/modules/mediastream/RTCIceCandidate.cpp
@@ -35,11 +35,13 @@
#include "bindings/core/v8/ScriptValue.h"
#include "bindings/core/v8/V8ObjectBuilder.h"
#include "core/dom/ExceptionCode.h"
+#include "core/dom/ExecutionContext.h"
+#include "core/frame/UseCounter.h"
#include "modules/mediastream/RTCIceCandidateInit.h"
namespace blink {
-RTCIceCandidate* RTCIceCandidate::create(const RTCIceCandidateInit& candidateInit, ExceptionState& exceptionState)
+RTCIceCandidate* RTCIceCandidate::create(ExecutionContext* context, const RTCIceCandidateInit& candidateInit, ExceptionState& exceptionState)
{
if (!candidateInit.hasCandidate() || !candidateInit.candidate().length()) {
exceptionState.throwDOMException(TypeMismatchError, ExceptionMessages::incorrectPropertyType("candidate", "is not a string, or is empty."));
@@ -50,9 +52,12 @@ RTCIceCandidate* RTCIceCandidate::create(const RTCIceCandidateInit& candidateIni
if (candidateInit.hasSdpMid())
sdpMid = candidateInit.sdpMid();
+ // TODO(guidou): Change default value to -1. crbug.com/614958.
unsigned short sdpMLineIndex = 0;
if (candidateInit.hasSdpMLineIndex())
sdpMLineIndex = candidateInit.sdpMLineIndex();
+ else
+ UseCounter::count(context, UseCounter::RTCIceCandidateDefaultSdpMLineIndex);
return new RTCIceCandidate(WebRTCICECandidate(candidateInit.candidate(), sdpMid, sdpMLineIndex));
}

Powered by Google App Engine
This is Rietveld 408576698