Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 25 matching lines...) Expand all Loading... | |
| 36 #include "WebPrivatePtr.h" | 36 #include "WebPrivatePtr.h" |
| 37 #include "WebString.h" | 37 #include "WebString.h" |
| 38 #include "WebVector.h" | 38 #include "WebVector.h" |
| 39 | 39 |
| 40 #include <vector> | 40 #include <vector> |
| 41 | 41 |
| 42 namespace blink { | 42 namespace blink { |
| 43 | 43 |
| 44 class WebMediaConstraintsPrivate; | 44 class WebMediaConstraintsPrivate; |
| 45 | 45 |
| 46 class BLINK_PLATFORM_EXPORT BaseConstraint { | 46 class BLINK_PLATFORM_EXPORT BaseConstraint { |
|
Peter Beverloo
2016/04/21 14:11:46
Not for this patch, but the naming rules of the Bl
hta - Chromium
2016/04/24 09:58:26
Acknowledged. crbug.com/605684 filed so that I do
| |
| 47 public: | 47 public: |
| 48 explicit BaseConstraint(const char* name); | 48 explicit BaseConstraint(const char* name); |
| 49 virtual ~BaseConstraint(); | 49 virtual ~BaseConstraint(); |
| 50 virtual bool isEmpty() const = 0; | 50 virtual bool isEmpty() const = 0; |
| 51 virtual bool hasMandatory() const = 0; | 51 virtual bool hasMandatory() const = 0; |
| 52 const char* name() const | 52 const char* name() const |
| 53 { | 53 { |
| 54 return m_name; | 54 return m_name; |
| 55 } | 55 } |
| 56 virtual WebString toString() const = 0; | 56 virtual WebString toString() const = 0; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 90 bool matches(long value) const; | 90 bool matches(long value) const; |
| 91 bool isEmpty() const override; | 91 bool isEmpty() const override; |
| 92 bool hasMandatory() const override; | 92 bool hasMandatory() const override; |
| 93 WebString toString() const override; | 93 WebString toString() const override; |
| 94 bool hasMin() const { return m_hasMin; } | 94 bool hasMin() const { return m_hasMin; } |
| 95 long min() const { return m_min; } | 95 long min() const { return m_min; } |
| 96 bool hasMax() const { return m_hasMax; } | 96 bool hasMax() const { return m_hasMax; } |
| 97 long max() const { return m_max; } | 97 long max() const { return m_max; } |
| 98 bool hasExact() const { return m_hasExact; } | 98 bool hasExact() const { return m_hasExact; } |
| 99 long exact() const { return m_exact; } | 99 long exact() const { return m_exact; } |
| 100 bool hasIdeal() const { return m_hasIdeal; } | |
| 101 long ideal() const { return m_ideal; } | |
| 100 | 102 |
| 101 private: | 103 private: |
| 102 long m_min; | 104 long m_min; |
| 103 long m_max; | 105 long m_max; |
| 104 long m_exact; | 106 long m_exact; |
| 105 long m_ideal; | 107 long m_ideal; |
| 106 unsigned m_hasMin : 1; | 108 unsigned m_hasMin : 1; |
| 107 unsigned m_hasMax : 1; | 109 unsigned m_hasMax : 1; |
| 108 unsigned m_hasExact : 1; | 110 unsigned m_hasExact : 1; |
| 109 unsigned m_hasIdeal : 1; | 111 unsigned m_hasIdeal : 1; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 145 bool matches(double value) const; | 147 bool matches(double value) const; |
| 146 bool isEmpty() const override; | 148 bool isEmpty() const override; |
| 147 bool hasMandatory() const override; | 149 bool hasMandatory() const override; |
| 148 WebString toString() const override; | 150 WebString toString() const override; |
| 149 bool hasMin() const { return m_hasMin; } | 151 bool hasMin() const { return m_hasMin; } |
| 150 double min() const { return m_min; } | 152 double min() const { return m_min; } |
| 151 bool hasMax() const { return m_hasMax; } | 153 bool hasMax() const { return m_hasMax; } |
| 152 double max() const { return m_max; } | 154 double max() const { return m_max; } |
| 153 bool hasExact() const { return m_hasExact; } | 155 bool hasExact() const { return m_hasExact; } |
| 154 double exact() const { return m_exact; } | 156 double exact() const { return m_exact; } |
| 157 bool hasIdeal() const { return m_hasIdeal; } | |
| 158 double ideal() const { return m_ideal; } | |
| 155 | 159 |
| 156 private: | 160 private: |
| 157 double m_min; | 161 double m_min; |
| 158 double m_max; | 162 double m_max; |
| 159 double m_exact; | 163 double m_exact; |
| 160 double m_ideal; | 164 double m_ideal; |
| 161 unsigned m_hasMin : 1; | 165 unsigned m_hasMin : 1; |
| 162 unsigned m_hasMax : 1; | 166 unsigned m_hasMax : 1; |
| 163 unsigned m_hasExact : 1; | 167 unsigned m_hasExact : 1; |
| 164 unsigned m_hasIdeal : 1; | 168 unsigned m_hasIdeal : 1; |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 184 { | 188 { |
| 185 m_ideal.assign(ideal); | 189 m_ideal.assign(ideal); |
| 186 } | 190 } |
| 187 | 191 |
| 188 | 192 |
| 189 bool matches(WebString value) const; | 193 bool matches(WebString value) const; |
| 190 bool isEmpty() const override; | 194 bool isEmpty() const override; |
| 191 bool hasMandatory() const override; | 195 bool hasMandatory() const override; |
| 192 WebString toString() const override; | 196 WebString toString() const override; |
| 193 bool hasExact() const { return !m_exact.isEmpty(); } | 197 bool hasExact() const { return !m_exact.isEmpty(); } |
| 198 bool hasIdeal() const { return !m_ideal.isEmpty(); } | |
| 194 const WebVector<WebString>& exact() const; | 199 const WebVector<WebString>& exact() const; |
| 195 const WebVector<WebString>& ideal() const; | 200 const WebVector<WebString>& ideal() const; |
| 196 | 201 |
| 197 private: | 202 private: |
| 198 WebVector<WebString> m_exact; | 203 WebVector<WebString> m_exact; |
| 199 WebVector<WebString> m_ideal; | 204 WebVector<WebString> m_ideal; |
| 200 }; | 205 }; |
| 201 | 206 |
| 202 class BLINK_PLATFORM_EXPORT BooleanConstraint : public BaseConstraint { | 207 class BLINK_PLATFORM_EXPORT BooleanConstraint : public BaseConstraint { |
| 203 public: | 208 public: |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 215 { | 220 { |
| 216 m_exact = value; | 221 m_exact = value; |
| 217 m_hasExact = true; | 222 m_hasExact = true; |
| 218 } | 223 } |
| 219 | 224 |
| 220 bool matches(bool value) const; | 225 bool matches(bool value) const; |
| 221 bool isEmpty() const override; | 226 bool isEmpty() const override; |
| 222 bool hasMandatory() const override; | 227 bool hasMandatory() const override; |
| 223 WebString toString() const override; | 228 WebString toString() const override; |
| 224 bool hasExact() const { return m_hasExact; } | 229 bool hasExact() const { return m_hasExact; } |
| 230 bool hasIdeal() const { return m_hasIdeal; } | |
| 225 | 231 |
| 226 private: | 232 private: |
| 227 unsigned m_ideal : 1; | 233 unsigned m_ideal : 1; |
| 228 unsigned m_exact : 1; | 234 unsigned m_exact : 1; |
| 229 unsigned m_hasIdeal : 1; | 235 unsigned m_hasIdeal : 1; |
| 230 unsigned m_hasExact : 1; | 236 unsigned m_hasExact : 1; |
| 231 }; | 237 }; |
| 232 | 238 |
| 233 struct WebMediaTrackConstraintSet { | 239 struct WebMediaTrackConstraintSet { |
| 234 public: | 240 public: |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 326 | 332 |
| 327 BLINK_PLATFORM_EXPORT const WebString toString() const; | 333 BLINK_PLATFORM_EXPORT const WebString toString() const; |
| 328 | 334 |
| 329 private: | 335 private: |
| 330 WebPrivatePtr<WebMediaConstraintsPrivate> m_private; | 336 WebPrivatePtr<WebMediaConstraintsPrivate> m_private; |
| 331 }; | 337 }; |
| 332 | 338 |
| 333 } // namespace blink | 339 } // namespace blink |
| 334 | 340 |
| 335 #endif // WebMediaConstraints_h | 341 #endif // WebMediaConstraints_h |
| OLD | NEW |