Bug 798033 - Removes 'using namespace' from /content headers - r=bsmedberg
☠☠ backed out by b9ec7a9582c9 ☠ ☠
authorMatt Joras <mjoras@sbcglobal.net>
Sun, 14 Oct 2012 00:04:51 -0500
changeset 111728 c25bc74b7fd3d095ad56eee04e8bf29c8eaca4a6
parent 111727 e7aebe2c45efac8d1d2fdf59b4ae7f7ff861d204
child 111729 b9ec7a9582c9f40b731fe2fa97578f0acf4d1520
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersbsmedberg
bugs798033
milestone19.0a1
Bug 798033 - Removes 'using namespace' from /content headers - r=bsmedberg
content/canvas/src/CanvasUtils.cpp
content/canvas/src/CanvasUtils.h
content/media/gstreamer/nsGStreamerReader.h
content/media/nsAudioAvailableEventManager.h
content/media/nsBuiltinDecoderStateMachine.h
content/media/ogg/nsOggReader.h
content/media/raw/nsRawReader.cpp
content/media/raw/nsRawReader.h
content/xul/document/src/nsXULPrototypeCache.h
--- a/content/canvas/src/CanvasUtils.cpp
+++ b/content/canvas/src/CanvasUtils.cpp
@@ -18,16 +18,18 @@
 
 #include "nsGfxCIID.h"
 
 #include "nsTArray.h"
 
 #include "CanvasUtils.h"
 #include "mozilla/gfx/Matrix.h"
 
+using namespace mozilla::gfx;
+
 namespace mozilla {
 namespace CanvasUtils {
 
 void
 DoDrawImageSecurityCheck(nsHTMLCanvasElement *aCanvasElement,
                          nsIPrincipal *aPrincipal,
                          bool forceWriteOnly,
                          bool CORSUsed)
--- a/content/canvas/src/CanvasUtils.h
+++ b/content/canvas/src/CanvasUtils.h
@@ -16,17 +16,16 @@ class nsIPrincipal;
 namespace mozilla {
 
 namespace gfx {
 class Matrix;
 }
 
 namespace CanvasUtils {
 
-using namespace gfx;
 
 // Check that the rectangle [x,y,w,h] is a subrectangle of [0,0,realWidth,realHeight]
 
 inline bool CheckSaneSubrectSize(int32_t x, int32_t y, int32_t w, int32_t h,
                             int32_t realWidth, int32_t realHeight) {
     CheckedInt32 checked_xmost  = CheckedInt32(x) + w;
     CheckedInt32 checked_ymost  = CheckedInt32(y) + h;
 
@@ -50,21 +49,21 @@ void DoDrawImageSecurityCheck(nsHTMLCanv
 // succeeded.
 bool CoerceDouble(jsval v, double* d);
 
 // Return true iff the conversion succeeded, false otherwise.  *rv is
 // the value to return to script if this returns false.
 bool JSValToMatrix(JSContext* cx, const jsval& val,
                    gfxMatrix* matrix, nsresult* rv);
 bool JSValToMatrix(JSContext* cx, const jsval& val,
-                   Matrix* matrix, nsresult* rv);
+                   gfx::Matrix* matrix, nsresult* rv);
 
 nsresult MatrixToJSVal(const gfxMatrix& matrix,
                        JSContext* cx, jsval* val);
-nsresult MatrixToJSVal(const Matrix& matrix,
+nsresult MatrixToJSVal(const gfx::Matrix& matrix,
                        JSContext* cx, jsval* val);
 
     /* Float validation stuff */
 #define VALIDATE(_f)  if (!NS_finite(_f)) return false
 
 inline bool FloatValidate (double f1) {
     VALIDATE(f1);
     return true;
--- a/content/media/gstreamer/nsGStreamerReader.h
+++ b/content/media/gstreamer/nsGStreamerReader.h
@@ -6,17 +6,16 @@
 #define nsGStreamerReader_h_
 
 #include <gst/gst.h>
 #include <gst/app/gstappsrc.h>
 #include <gst/app/gstappsink.h>
 #include <gst/video/video.h>
 #include "nsBuiltinDecoderReader.h"
 
-using namespace mozilla;
 
 class nsMediaDecoder;
 class nsTimeRanges;
 
 class nsGStreamerReader : public nsBuiltinDecoderReader
 {
 public:
   nsGStreamerReader(nsBuiltinDecoder* aDecoder);
--- a/content/media/nsAudioAvailableEventManager.h
+++ b/content/media/nsAudioAvailableEventManager.h
@@ -7,17 +7,16 @@
 #ifndef nsAudioAvailableEventManager_h__
 #define nsAudioAvailableEventManager_h__
 
 #include "nsCOMPtr.h"
 #include "nsIRunnable.h"
 #include "nsBuiltinDecoder.h"
 #include "nsBuiltinDecoderReader.h"
 
-using namespace mozilla;
 
 class nsAudioAvailableEventManager
 {
 public:
   nsAudioAvailableEventManager(nsBuiltinDecoder* aDecoder);
   ~nsAudioAvailableEventManager();
 
   // Initialize the event manager with audio metadata.  Called before
@@ -74,17 +73,17 @@ private:
   uint32_t mSignalBufferPosition;
 
   // The MozAudioAvailable events to be dispatched.  This queue is shared
   // between the state machine and audio threads.
   nsTArray< nsCOMPtr<nsIRunnable> > mPendingEvents;
 
   // ReentrantMonitor for shared access to mPendingEvents queue or
   // buffer length.
-  ReentrantMonitor mReentrantMonitor;
+  mozilla::ReentrantMonitor mReentrantMonitor;
 
   // True if something in the owning document has a listener on the
   // "MozAudioAvailable" event. If not, we don't need to bother copying played
   // audio data and dispatching the event. Synchronized by mReentrantMonitor.
   bool mHasListener;
 };
 
 #endif
--- a/content/media/nsBuiltinDecoderStateMachine.h
+++ b/content/media/nsBuiltinDecoderStateMachine.h
@@ -270,31 +270,31 @@ protected:
     WakeDecoderRunnable(nsBuiltinDecoderStateMachine* aSM)
       : mMutex("WakeDecoderRunnable"), mStateMachine(aSM) {}
     NS_IMETHOD Run()
     {
       nsRefPtr<nsBuiltinDecoderStateMachine> stateMachine;
       {
         // Don't let Run() (called by media stream graph thread) race with
         // Revoke() (called by decoder state machine thread)
-        MutexAutoLock lock(mMutex);
+        mozilla::MutexAutoLock lock(mMutex);
         if (!mStateMachine)
           return NS_OK;
         stateMachine = mStateMachine;
       }
       stateMachine->ScheduleStateMachineWithLockAndWakeDecoder();
       return NS_OK;
     }
     void Revoke()
     {
-      MutexAutoLock lock(mMutex);
+      mozilla::MutexAutoLock lock(mMutex);
       mStateMachine = nullptr;
     }
 
-    Mutex mMutex;
+    mozilla::Mutex mMutex;
     // Protected by mMutex.
     // We don't use an owning pointer here, because keeping mStateMachine alive
     // would mean in some cases we'd have to destroy mStateMachine from this
     // object, which would be problematic since nsBuiltinDecoderStateMachine can
     // only be destroyed on the main thread whereas this object can be destroyed
     // on the media stream graph thread.
     nsBuiltinDecoderStateMachine* mStateMachine;
   };
--- a/content/media/ogg/nsOggReader.h
+++ b/content/media/ogg/nsOggReader.h
@@ -12,17 +12,16 @@
 #include <tremor/ivorbiscodec.h>
 #else
 #include <vorbis/codec.h>
 #endif
 #include "nsBuiltinDecoderReader.h"
 #include "nsOggCodecState.h"
 #include "VideoUtils.h"
 
-using namespace mozilla;
 
 class nsMediaDecoder;
 class nsTimeRanges;
 
 class nsOggReader : public nsBuiltinDecoderReader
 {
 public:
   nsOggReader(nsBuiltinDecoder* aDecoder);
--- a/content/media/raw/nsRawReader.cpp
+++ b/content/media/raw/nsRawReader.cpp
@@ -4,16 +4,18 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsBuiltinDecoderStateMachine.h"
 #include "nsBuiltinDecoder.h"
 #include "nsRawReader.h"
 #include "nsRawDecoder.h"
 #include "VideoUtils.h"
 
+using namespace mozilla;
+
 nsRawReader::nsRawReader(nsBuiltinDecoder* aDecoder)
   : nsBuiltinDecoderReader(aDecoder),
     mCurrentFrame(0), mFrameSize(0)
 {
   MOZ_COUNT_CTOR(nsRawReader);
 }
 
 nsRawReader::~nsRawReader()
--- a/content/media/raw/nsRawReader.h
+++ b/content/media/raw/nsRawReader.h
@@ -38,17 +38,17 @@ public:
   virtual nsresult GetBuffered(nsTimeRanges* aBuffered, int64_t aStartTime);
 
   // By seeking in the media resource, it is possible to seek.
   bool IsSeekableInBufferedRanges() {
     return true;
   }
 
 private:
-  bool ReadFromResource(MediaResource *aResource, uint8_t *aBuf, uint32_t aLength);
+  bool ReadFromResource(mozilla::MediaResource *aResource, uint8_t *aBuf, uint32_t aLength);
 
   nsRawVideoHeader mMetadata;
   uint32_t mCurrentFrame;
   double mFrameRate;
   uint32_t mFrameSize;
   nsIntRect mPicture;
 };
 
--- a/content/xul/document/src/nsXULPrototypeCache.h
+++ b/content/xul/document/src/nsXULPrototypeCache.h
@@ -16,17 +16,16 @@
 #include "nsXULPrototypeDocument.h"
 #include "nsIInputStream.h"
 #include "nsIStorageStream.h"
 
 #include "jspubtd.h"
 
 #include "mozilla/scache/StartupCache.h"
 
-using namespace mozilla::scache;
 
 class nsCSSStyleSheet;
 
 struct CacheScriptEntry
 {
     JSScript*   mScriptObject; // the script object.
 };
 
@@ -107,17 +106,17 @@ public:
      * startupCache.
      */
     nsresult GetInputStream(nsIURI* aURI, nsIObjectInputStream** objectInput);
     nsresult FinishInputStream(nsIURI* aURI);
     nsresult GetOutputStream(nsIURI* aURI, nsIObjectOutputStream** objectOutput);
     nsresult FinishOutputStream(nsIURI* aURI);
     nsresult HasData(nsIURI* aURI, bool* exists);
 
-    static StartupCache* GetStartupCache();
+    static mozilla::scache::StartupCache* GetStartupCache();
 
     static nsXULPrototypeCache* GetInstance();
 
     static void ReleaseGlobals()
     {
         NS_IF_RELEASE(sInstance);
     }
 
@@ -139,17 +138,17 @@ protected:
     nsDataHashtable<nsURIHashKey,CacheScriptEntry>         mScriptTable;
     nsRefPtrHashtable<nsURIHashKey,nsXBLDocumentInfo>  mXBLDocTable;
 
     ///////////////////////////////////////////////////////////////////////////
     // StartupCache
     // this is really a hash set, with a dummy data parameter
     nsDataHashtable<nsURIHashKey,uint32_t> mCacheURITable;
 
-    static StartupCache* gStartupCache;
+    static mozilla::scache::StartupCache* gStartupCache;
     nsInterfaceHashtable<nsURIHashKey, nsIStorageStream> mOutputStreamTable;
     nsInterfaceHashtable<nsURIHashKey, nsIObjectInputStream> mInputStreamTable;
  
     // Bootstrap caching service
     nsresult BeginCaching(nsIURI* aDocumentURI);
 };
 
 #endif // nsXULPrototypeCache_h__