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

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

Issue 1817943003: Constraints: Make advanced list be a list. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
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 f079e99e80fa40637b26732cf436e06f9a32ac6d..bef1d7e58c4d30604d0f6a1c1db9b4284cbc3825 100644
--- a/third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp
+++ b/third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp
@@ -393,9 +393,14 @@ 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);
- WebVector<WebMediaTrackConstraintSet> advancedVector(&advanced, 1);
- // Use the 4-argument initializer until Chrome has been converted.
+ 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(optional, mandatory, 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