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

Side by Side Diff: third_party/WebKit/Source/platform/exported/WebMediaConstraints.cpp

Issue 1581103002: Use new-style constraints for device selection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@constraints-errors
Patch Set: Review comments Created 4 years, 11 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
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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 } 196 }
197 } 197 }
198 return false; 198 return false;
199 } 199 }
200 200
201 bool StringConstraint::isEmpty() const 201 bool StringConstraint::isEmpty() const
202 { 202 {
203 return m_exact.isEmpty() && m_ideal.isEmpty(); 203 return m_exact.isEmpty() && m_ideal.isEmpty();
204 } 204 }
205 205
206 const WebVector<WebString>& StringConstraint::exact() const
207 {
208 return m_exact;
209 }
210
211 const WebVector<WebString>& StringConstraint::ideal() const
212 {
213 return m_ideal;
214 }
215
206 bool BooleanConstraint::matches(bool value) const 216 bool BooleanConstraint::matches(bool value) const
207 { 217 {
208 if (m_hasExact && static_cast<bool>(m_exact) != value) { 218 if (m_hasExact && static_cast<bool>(m_exact) != value) {
209 return false; 219 return false;
210 } 220 }
211 return true; 221 return true;
212 } 222 }
213 223
214 bool BooleanConstraint::isEmpty() const 224 bool BooleanConstraint::isEmpty() const
215 { 225 {
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 return m_private->basic(); 311 return m_private->basic();
302 } 312 }
303 313
304 const WebVector<WebMediaTrackConstraintSet>& WebMediaConstraints::advanced() con st 314 const WebVector<WebMediaTrackConstraintSet>& WebMediaConstraints::advanced() con st
305 { 315 {
306 ASSERT(!isNull()); 316 ASSERT(!isNull());
307 return m_private->advanced(); 317 return m_private->advanced();
308 } 318 }
309 319
310 } // namespace blink 320 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698