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

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

Issue 1808173002: Constraints: Make advanced list be a list. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 24dcb6c445790f1526dedc10ca006eb63b491a97..1369ede6bf703245f5abbe2ff7f8edb68795ec2a 100644
--- a/third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp
+++ b/third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp
@@ -434,14 +434,15 @@ static WebMediaConstraints createFromNamedConstraints(ExecutionContext* context,
return constraints;
// We ignore unknow names and syntax errors in optional constraints.
MediaErrorState ignoredErrorState;
- parseOldStyleNames(context, optional, false, advanced, ignoredErrorState);
- if (advanced.isEmpty()) {
- WebVector<WebMediaTrackConstraintSet> emptyVector;
- constraints.initialize(basic, emptyVector);
- } else {
- WebVector<WebMediaTrackConstraintSet> advancedVector(&advanced, 1);
- constraints.initialize(basic, advancedVector);
- }
+ Vector<WebMediaTrackConstraintSet> advancedVector;
+ for (const auto& optionalConstraint : optional) {
+ WebMediaTrackConstraintSet advancedElement;
+ WebVector<WebMediaConstraint> elementAsList(&optionalConstraint, 1);
+ parseOldStyleNames(context, elementAsList, false, advancedElement, ignoredErrorState);
+ if (!advancedElement.isEmpty())
+ advancedVector.append(advancedElement);
+ }
+ constraints.initialize(basic, advancedVector);
return constraints;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698