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

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: More review comments addressed 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 1f61be3c467c7252471e7686f7109754d9a88406..e16caccf6f075a6a185d322083ceedba2b4b3afa 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.
+ } 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