OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef WebAudioLatencyHint_h |
| 6 #define WebAudioLatencyHint_h |
| 7 |
| 8 #include "WebString.h" |
| 9 |
| 10 namespace blink { |
| 11 |
| 12 class WebAudioLatencyHint { |
| 13 public: |
| 14 enum Category { CategoryInteractive, CategoryBalanced, CategoryPlayback }; |
| 15 |
| 16 explicit WebAudioLatencyHint(WebString category) { |
| 17 if (category == "interactive") { |
| 18 m_category = CategoryInteractive; |
| 19 } else if (category == "balanced") { |
| 20 m_category = CategoryBalanced; |
| 21 } else if (category == "playback") { |
| 22 m_category = CategoryPlayback; |
| 23 } else { |
| 24 NOTREACHED(); |
| 25 m_category = CategoryInteractive; |
| 26 } |
| 27 } |
| 28 |
| 29 explicit WebAudioLatencyHint(Category category) : m_category(category) {} |
| 30 |
| 31 Category category() const { return m_category; } |
| 32 |
| 33 private: |
| 34 Category m_category; |
| 35 }; |
| 36 |
| 37 } // namespace blink |
| 38 |
| 39 #endif |
OLD | NEW |