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

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

Issue 1641653002: Adding counters for the types of Media Constraints. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 11 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/MediaConstraintsImpl.cpp
diff --git a/third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp b/third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp
index ee8148fb7b52fc73a0bb5768f49e01e67328534b..74b5f0a9dd26c2a6dbe3a03cde467b16c20ea5bb 100644
--- a/third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp
+++ b/third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp
@@ -34,6 +34,7 @@
#include "bindings/core/v8/Dictionary.h"
#include "bindings/core/v8/ExceptionState.h"
#include "core/dom/ExceptionCode.h"
+#include "core/frame/UseCounter.h"
#include "modules/mediastream/MediaTrackConstraintSet.h"
#include "platform/Logging.h"
#include "platform/RuntimeEnabledFeatures.h"
@@ -385,7 +386,7 @@ static WebMediaConstraints createFromNamedConstraints(WebVector<WebMediaConstrai
}
// Deprecated.
-WebMediaConstraints create(const Dictionary& constraintsDictionary, MediaErrorState& errorState)
+WebMediaConstraints create(const ExecutionContext* context, const Dictionary& constraintsDictionary, MediaErrorState& errorState)
{
WebVector<WebMediaConstraint> optional;
WebVector<WebMediaConstraint> mandatory;
@@ -393,6 +394,7 @@ WebMediaConstraints create(const Dictionary& constraintsDictionary, MediaErrorSt
errorState.throwTypeError("Malformed constraints object.");
return WebMediaConstraints();
}
+ UseCounter::count(context, UseCounter::MediaStreamConstraintsFromDictionary);
return createFromNamedConstraints(mandatory, optional, errorState);
}
@@ -491,7 +493,7 @@ void copyConstraints(const MediaTrackConstraintSet& constraintsIn, WebMediaTrack
}
}
-WebMediaConstraints create(const MediaTrackConstraintSet& constraintsIn, MediaErrorState& errorState)
+WebMediaConstraints create(const ExecutionContext* context, const MediaTrackConstraintSet& constraintsIn, MediaErrorState& errorState)
{
WebMediaConstraints constraints;
WebMediaTrackConstraintSet constraintBuffer;
@@ -510,8 +512,10 @@ WebMediaConstraints create(const MediaTrackConstraintSet& constraintsIn, MediaEr
errorState.throwTypeError("Malformed constraints object.");
return WebMediaConstraints();
}
+ UseCounter::count(context, UseCounter::MediaStreamConstraintsNameValue);
return createFromNamedConstraints(mandatory, optional, errorState);
}
+ UseCounter::count(context, UseCounter::MediaStreamConstraintsConformant);
constraints.initialize(constraintBuffer, advancedBuffer);
return constraints;
}

Powered by Google App Engine
This is Rietveld 408576698