Bug 878875 - Import PannerNode tests from Blink. r=ehsan
[gecko.git] / content / media / webaudio / EnableWebAudioCheck.cpp
bloba3edcfd4dfb819fb235fffc122ca23e84cda0543
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:set ts=2 sw=2 sts=2 et cindent: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "EnableWebAudioCheck.h"
8 #include "mozilla/Preferences.h"
10 namespace {
12 bool gPrefInitialized = false;
13 bool gWebAudioEnabled = false;
17 namespace mozilla {
18 namespace dom {
20 /* static */ bool
21 EnableWebAudioCheck::PrefEnabled()
23 if (!gPrefInitialized) {
24 Preferences::AddBoolVarCache(&gWebAudioEnabled, "media.webaudio.enabled");
25 gPrefInitialized = true;
27 return gWebAudioEnabled;