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

Unified Diff: third_party/WebKit/Source/platform/exported/WebMediaConstraints.cpp

Issue 1494543002: Add counters for nonstandard uses of RTCPeerConnection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update histograms.xml 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/exported/WebMediaConstraints.cpp
diff --git a/third_party/WebKit/Source/platform/exported/WebMediaConstraints.cpp b/third_party/WebKit/Source/platform/exported/WebMediaConstraints.cpp
index 6e617b5cacea4c5faefae77ee227a3466dc349c1..96f5e381cd242f5a31153b9858c53cb992e41626 100644
--- a/third_party/WebKit/Source/platform/exported/WebMediaConstraints.cpp
+++ b/third_party/WebKit/Source/platform/exported/WebMediaConstraints.cpp
@@ -42,6 +42,7 @@ public:
static PassRefPtr<WebMediaConstraintsPrivate> create();
static PassRefPtr<WebMediaConstraintsPrivate> create(const WebVector<WebMediaConstraint>& optional, const WebVector<WebMediaConstraint>& mandatory);
+ bool isEmpty() const;
void getOptionalConstraints(WebVector<WebMediaConstraint>&);
void getMandatoryConstraints(WebVector<WebMediaConstraint>&);
bool getMandatoryConstraintValue(const WebString& name, WebString& value);
@@ -72,6 +73,11 @@ WebMediaConstraintsPrivate::WebMediaConstraintsPrivate(const WebVector<WebMediaC
{
}
+bool WebMediaConstraintsPrivate::isEmpty() const
+{
+ return m_optional.isEmpty() && m_mandatory.isEmpty();
+}
+
void WebMediaConstraintsPrivate::getOptionalConstraints(WebVector<WebMediaConstraint>& constraints)
{
constraints = m_optional;
@@ -116,6 +122,11 @@ void WebMediaConstraints::reset()
m_private.reset();
}
+bool WebMediaConstraints::isEmpty() const
+{
+ return m_private.isNull() || m_private->isEmpty();
+}
+
void WebMediaConstraints::getMandatoryConstraints(WebVector<WebMediaConstraint>& constraints) const
{
ASSERT(!isNull());

Powered by Google App Engine
This is Rietveld 408576698