Use #include guards in the web audio code, no bug
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 30 Oct 2012 17:39:38 -0400
changeset 111959 db5b058b11d1066a86c12c358830bd7a4d95c939
parent 111958 e7d9b7fadd242e92f3c0a31a9ece2c83c61fee29
child 111960 97ef51f7f37a1dae8da2895bf53fd56d3d5240e3
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
milestone19.0a1
Use #include guards in the web audio code, no bug
content/media/webaudio/AudioBuffer.h
content/media/webaudio/AudioBufferSourceNode.h
content/media/webaudio/AudioContext.h
content/media/webaudio/AudioDestinationNode.h
content/media/webaudio/AudioEventTimeline.h
content/media/webaudio/AudioNode.h
content/media/webaudio/AudioParam.h
content/media/webaudio/AudioSourceNode.h
content/media/webaudio/EnableWebAudioCheck.h
--- a/content/media/webaudio/AudioBuffer.h
+++ b/content/media/webaudio/AudioBuffer.h
@@ -1,15 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#pragma once
+#ifndef AudioBuffer_h_
+#define AudioBuffer_h_
 
 #include "nsWrapperCache.h"
 #include "nsCycleCollectionParticipant.h"
 #include "mozilla/Attributes.h"
 #include "EnableWebAudioCheck.h"
 #include "nsAutoPtr.h"
 #include "nsTArray.h"
 #include "AudioContext.h"
@@ -76,8 +77,10 @@ private:
   FallibleTArray<JSObject*> mChannels;
   uint32_t mLength;
   float mSampleRate;
 };
 
 }
 }
 
+#endif
+
--- a/content/media/webaudio/AudioBufferSourceNode.h
+++ b/content/media/webaudio/AudioBufferSourceNode.h
@@ -1,15 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#pragma once
+#ifndef AudioBufferSourceNode_h_
+#define AudioBufferSourceNode_h_
 
 #include "AudioSourceNode.h"
 #include "AudioBuffer.h"
 
 namespace mozilla {
 namespace dom {
 
 class AudioBufferSourceNode : public AudioSourceNode
@@ -34,8 +35,10 @@ public:
 
 private:
   nsRefPtr<AudioBuffer> mBuffer;
 };
 
 }
 }
 
+#endif
+
--- a/content/media/webaudio/AudioContext.h
+++ b/content/media/webaudio/AudioContext.h
@@ -1,15 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#pragma once
+#ifndef AudioContext_h_
+#define AudioContext_h_
 
 #include "nsWrapperCache.h"
 #include "nsCycleCollectionParticipant.h"
 #include "mozilla/Attributes.h"
 #include "nsCOMPtr.h"
 #include "EnableWebAudioCheck.h"
 #include "nsAutoPtr.h"
 
@@ -63,8 +64,10 @@ public:
 private:
   nsCOMPtr<nsIDOMWindow> mWindow;
   nsRefPtr<AudioDestinationNode> mDestination;
 };
 
 }
 }
 
+#endif
+
--- a/content/media/webaudio/AudioDestinationNode.h
+++ b/content/media/webaudio/AudioDestinationNode.h
@@ -1,15 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#pragma once
+#ifndef AudioDestinationNode_h_
+#define AudioDestinationNode_h_
 
 #include "AudioNode.h"
 
 namespace mozilla {
 namespace dom {
 
 class AudioContext;
 
@@ -32,8 +33,10 @@ public:
     return 0;
   }
 
 };
 
 }
 }
 
+#endif
+
--- a/content/media/webaudio/AudioEventTimeline.h
+++ b/content/media/webaudio/AudioEventTimeline.h
@@ -1,15 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#pragma once
+#ifndef AudioEventTimeline_h_
+#define AudioEventTimeline_h_
 
 #include "mozilla/Attributes.h"
 #include "mozilla/FloatingPoint.h"
 #include "nsTArray.h"
 #include "math.h"
 
 namespace mozilla {
 
@@ -367,8 +368,10 @@ private:
   const float mDefaultValue;
   const float mMinValue;
   const float mMaxValue;
 };
 
 }
 }
 
+#endif
+
--- a/content/media/webaudio/AudioNode.h
+++ b/content/media/webaudio/AudioNode.h
@@ -1,15 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#pragma once
+#ifndef AudioNode_h_
+#define AudioNode_h_
 
 #include "nsWrapperCache.h"
 #include "nsCycleCollectionParticipant.h"
 #include "mozilla/Attributes.h"
 #include "EnableWebAudioCheck.h"
 #include "nsAutoPtr.h"
 #include "nsTArray.h"
 #include "AudioContext.h"
@@ -123,8 +124,10 @@ private:
   nsRefPtr<AudioContext> mContext;
   nsTArray<Input> mInputs;
   nsTArray<Output> mOutputs;
 };
 
 }
 }
 
+#endif
+
--- a/content/media/webaudio/AudioParam.h
+++ b/content/media/webaudio/AudioParam.h
@@ -1,15 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#pragma once
+#ifndef AudioParam_h_
+#define AudioParam_h_
 
 #include "AudioEventTimeline.h"
 #include "nsWrapperCache.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsCOMPtr.h"
 #include "EnableWebAudioCheck.h"
 #include "nsAutoPtr.h"
 #include "AudioContext.h"
@@ -109,8 +110,10 @@ public:
 
 private:
   nsRefPtr<AudioContext> mContext;
 };
 
 }
 }
 
+#endif
+
--- a/content/media/webaudio/AudioSourceNode.h
+++ b/content/media/webaudio/AudioSourceNode.h
@@ -1,15 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#pragma once
+#ifndef AudioSourceNode_h_
+#define AudioSourceNode_h_
 
 #include "AudioNode.h"
 
 namespace mozilla {
 namespace dom {
 
 class AudioSourceNode : public AudioNode
 {
@@ -27,8 +28,10 @@ public:
     return 1;
   }
 
 };
 
 }
 }
 
+#endif
+
--- a/content/media/webaudio/EnableWebAudioCheck.h
+++ b/content/media/webaudio/EnableWebAudioCheck.h
@@ -1,21 +1,24 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#pragma once
+#ifndef EnableWebAudioCheck_h_
+#define EnableWebAudioCheck_h_
 
 namespace mozilla {
 namespace dom {
 
 // This is a helper class which enables Web Audio to be enabled or disabled
 // as whole.  Individual Web Audio object classes should inherit from this.
 class EnableWebAudioCheck {
 public:
   static bool PrefEnabled();
 };
 
 }
 }
 
+#endif
+