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

Side by Side Diff: third_party/WebKit/public/platform/WebAudioLatencyHint.h

Issue 2501863003: Support for AudioContextOptions latencyHint. (Closed)
Patch Set: Check all LatencyHints WebAudioDeviceImpl test. Created 4 years 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
(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 {
Raymond Toy 2016/12/08 17:14:38 I assume this class will also be used to hold the
Andrew MacPherson 2016/12/09 12:34:14 No problem, I've just added a new Category, double
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698