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

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

Issue 1318393002: Refactor "track options" to be a dictionary. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Used MediaTrackConstraintSet in union types Created 5 years, 2 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/UserMediaRequest.cpp
diff --git a/third_party/WebKit/Source/modules/mediastream/UserMediaRequest.cpp b/third_party/WebKit/Source/modules/mediastream/UserMediaRequest.cpp
index ba8e286b76ac60320740e2b7f3cfa30847e09f8e..5c730ee1b344de795e72c63fb51588a1c33e48e7 100644
--- a/third_party/WebKit/Source/modules/mediastream/UserMediaRequest.cpp
+++ b/third_party/WebKit/Source/modules/mediastream/UserMediaRequest.cpp
@@ -43,20 +43,24 @@
#include "modules/mediastream/MediaConstraintsImpl.h"
#include "modules/mediastream/MediaStream.h"
#include "modules/mediastream/MediaStreamConstraints.h"
+#include "modules/mediastream/MediaTrackConstraintSet.h"
#include "modules/mediastream/UserMediaController.h"
#include "platform/mediastream/MediaStreamCenter.h"
#include "platform/mediastream/MediaStreamDescriptor.h"
namespace blink {
-static WebMediaConstraints parseOptions(const BooleanOrDictionary& options, ExceptionState& exceptionState)
+static WebMediaConstraints parseOptions(const BooleanOrMediaTrackConstraintSet& options, ExceptionState& exceptionState)
{
WebMediaConstraints constraints;
Dictionary constraintsDictionary;
- if (options.isDictionary()) {
- constraints = MediaConstraintsImpl::create(options.getAsDictionary(), exceptionState);
+ if (options.isNull()) {
+ // Do nothing.
Guido Urdaneta 2015/10/05 12:34:12 Is this possible? Should there be a NOTREACHED her
hta - Chromium 2015/10/05 12:54:01 It is possible. When you call getUserMedia({video:
+ } else if (options.isMediaTrackConstraintSet()) {
+ constraints = MediaConstraintsImpl::create(options.getAsMediaTrackConstraintSet(), exceptionState);
} else {
+ ASSERT(options.isBoolean());
if (options.getAsBoolean()) {
constraints = MediaConstraintsImpl::create();
}

Powered by Google App Engine
This is Rietveld 408576698