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

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

Issue 22572005: Remove all uses of the ASCIILiteral class. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rm it from wtf Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 } 56 }
57 57
58 bool MediaConstraintsImpl::initialize(const Dictionary& constraints) 58 bool MediaConstraintsImpl::initialize(const Dictionary& constraints)
59 { 59 {
60 if (constraints.isUndefinedOrNull()) 60 if (constraints.isUndefinedOrNull())
61 return true; 61 return true;
62 62
63 Vector<String> names; 63 Vector<String> names;
64 constraints.getOwnPropertyNames(names); 64 constraints.getOwnPropertyNames(names);
65 65
66 String mandatory = ASCIILiteral("mandatory"); 66 String mandatory("mandatory");
67 String optional = ASCIILiteral("optional"); 67 String optional("optional");
68 68
69 for (Vector<String>::iterator it = names.begin(); it != names.end(); ++it) { 69 for (Vector<String>::iterator it = names.begin(); it != names.end(); ++it) {
70 if (*it != mandatory && *it != optional) 70 if (*it != mandatory && *it != optional)
71 return false; 71 return false;
72 } 72 }
73 73
74 if (names.contains(mandatory)) { 74 if (names.contains(mandatory)) {
75 Dictionary mandatoryConstraints; 75 Dictionary mandatoryConstraints;
76 bool ok = constraints.get(mandatory, mandatoryConstraints); 76 bool ok = constraints.get(mandatory, mandatoryConstraints);
77 if (!ok || mandatoryConstraints.isUndefinedOrNull()) 77 if (!ok || mandatoryConstraints.isUndefinedOrNull())
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 if (i->m_name == name) { 149 if (i->m_name == name) {
150 value = i->m_value; 150 value = i->m_value;
151 return true; 151 return true;
152 } 152 }
153 } 153 }
154 154
155 return false; 155 return false;
156 } 156 }
157 157
158 } // namespace WebCore 158 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/geolocation/GeolocationController.cpp ('k') | Source/modules/mediastream/MediaStreamTrack.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698