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

Side by Side Diff: Source/modules/mediastream/MediaConstraintsImpl.cpp

Issue 715583008: Remove Dictionary::getOwnPropertyNames() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 namespace blink { 43 namespace blink {
44 44
45 namespace MediaConstraintsImpl { 45 namespace MediaConstraintsImpl {
46 46
47 static bool parse(const Dictionary& constraintsDictionary, WebVector<WebMediaCon straint>& optional, WebVector<WebMediaConstraint>& mandatory) 47 static bool parse(const Dictionary& constraintsDictionary, WebVector<WebMediaCon straint>& optional, WebVector<WebMediaConstraint>& mandatory)
48 { 48 {
49 if (constraintsDictionary.isUndefinedOrNull()) 49 if (constraintsDictionary.isUndefinedOrNull())
50 return true; 50 return true;
51 51
52 Vector<String> names; 52 Vector<String> names;
53 constraintsDictionary.getOwnPropertyNames(names); 53 constraintsDictionary.getPropertyNames(names);
54 54
55 String mandatoryName("mandatory"); 55 String mandatoryName("mandatory");
56 String optionalName("optional"); 56 String optionalName("optional");
57 57
58 for (Vector<String>::iterator it = names.begin(); it != names.end(); ++it) { 58 for (Vector<String>::iterator it = names.begin(); it != names.end(); ++it) {
59 if (*it != mandatoryName && *it != optionalName) 59 if (*it != mandatoryName && *it != optionalName)
60 return false; 60 return false;
61 } 61 }
62 62
63 Vector<WebMediaConstraint> mandatoryConstraintsVector; 63 Vector<WebMediaConstraint> mandatoryConstraintsVector;
(...skipping 24 matching lines...) Expand all
88 ok = optionalConstraints.length(numberOfConstraints); 88 ok = optionalConstraints.length(numberOfConstraints);
89 if (!ok) 89 if (!ok)
90 return false; 90 return false;
91 91
92 for (size_t i = 0; i < numberOfConstraints; ++i) { 92 for (size_t i = 0; i < numberOfConstraints; ++i) {
93 Dictionary constraint; 93 Dictionary constraint;
94 ok = optionalConstraints.get(i, constraint); 94 ok = optionalConstraints.get(i, constraint);
95 if (!ok || constraint.isUndefinedOrNull()) 95 if (!ok || constraint.isUndefinedOrNull())
96 return false; 96 return false;
97 Vector<String> localNames; 97 Vector<String> localNames;
98 constraint.getOwnPropertyNames(localNames); 98 constraint.getPropertyNames(localNames);
99 if (localNames.size() != 1) 99 if (localNames.size() != 1)
100 return false; 100 return false;
101 String key = localNames[0]; 101 String key = localNames[0];
102 String value; 102 String value;
103 ok = DictionaryHelper::get(constraint, key, value); 103 ok = DictionaryHelper::get(constraint, key, value);
104 if (!ok) 104 if (!ok)
105 return false; 105 return false;
106 optionalConstraintsVector.append(WebMediaConstraint(key, value)); 106 optionalConstraintsVector.append(WebMediaConstraint(key, value));
107 } 107 }
108 } 108 }
(...skipping 20 matching lines...) Expand all
129 129
130 WebMediaConstraints create() 130 WebMediaConstraints create()
131 { 131 {
132 WebMediaConstraints constraints; 132 WebMediaConstraints constraints;
133 constraints.initialize(); 133 constraints.initialize();
134 return constraints; 134 return constraints;
135 } 135 }
136 136
137 } // namespace MediaConstraintsImpl 137 } // namespace MediaConstraintsImpl
138 } // namespace blink 138 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/Dictionary.cpp ('k') | Source/modules/mediastream/RTCPeerConnection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698