Bug 840559 - Rename nsMediaError to MediaError. r=Ms2ger
authorAndrea Marchesini <amarchesini@mozilla.com>
Thu, 14 Feb 2013 10:59:21 -0500
changeset 131790 a61cbf1da7004815f073a6ec95e766ef35c65fb2
parent 131789 74828c564a362e19ffc56e6e94d959bcf31df8dc
child 131791 d0ff1ebd98858de16508f59da7075e7d3fcd5127
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMs2ger
bugs840559
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 840559 - Rename nsMediaError to MediaError. r=Ms2ger
content/html/content/src/Makefile.in
content/html/content/src/MediaError.cpp
content/html/content/src/MediaError.h
content/html/content/src/nsHTMLMediaElement.cpp
content/html/content/src/nsHTMLVideoElement.cpp
content/html/content/src/nsMediaError.cpp
content/html/content/src/nsMediaError.h
--- a/content/html/content/src/Makefile.in
+++ b/content/html/content/src/Makefile.in
@@ -137,22 +137,23 @@ CPPSRCS		= \
 		nsRadioVisitor.cpp \
 		nsDOMStringMap.cpp \
 		UndoManager.cpp \
 		$(NULL)
 
 ifdef MOZ_MEDIA
 EXPORTS_mozilla/dom += \
 		HTMLSourceElement.h \
+		MediaError.h \
 		$(NULL)
 
 CPPSRCS		+= \
 		nsHTMLAudioElement.cpp \
 		nsHTMLMediaElement.cpp \
-		nsMediaError.cpp \
+		MediaError.cpp \
 		nsMediaFragmentURIParser.cpp \
 		HTMLSourceElement.cpp \
 		nsTimeRanges.cpp \
 		nsHTMLVideoElement.cpp \
 		$(NULL)
 endif
 
 # we don't want the shared lib, but we want to force the creation of a static lib.
rename from content/html/content/src/nsMediaError.cpp
rename to content/html/content/src/MediaError.cpp
--- a/content/html/content/src/nsMediaError.cpp
+++ b/content/html/content/src/MediaError.cpp
@@ -1,31 +1,38 @@
 /* -*- 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/. */
-#include "nsMediaError.h"
+
+#include "mozilla/dom/MediaError.h"
 #include "nsDOMClassInfoID.h"
 
-NS_IMPL_ADDREF(nsMediaError)
-NS_IMPL_RELEASE(nsMediaError)
+DOMCI_DATA(MediaError, mozilla::dom::MediaError)
+
+namespace mozilla {
+namespace dom {
 
-DOMCI_DATA(MediaError, nsMediaError)
+NS_IMPL_ADDREF(MediaError)
+NS_IMPL_RELEASE(MediaError)
 
-NS_INTERFACE_MAP_BEGIN(nsMediaError)
+NS_INTERFACE_MAP_BEGIN(MediaError)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
   NS_INTERFACE_MAP_ENTRY(nsIDOMMediaError)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MediaError)
 NS_INTERFACE_MAP_END
 
-nsMediaError::nsMediaError(uint16_t aCode) :
-  mCode(aCode)
+MediaError::MediaError(uint16_t aCode)
+: mCode(aCode)
 {
 }
 
-NS_IMETHODIMP nsMediaError::GetCode(uint16_t* aCode)
+NS_IMETHODIMP MediaError::GetCode(uint16_t* aCode)
 {
   if (aCode)
     *aCode = mCode;
 
   return NS_OK;
 }
+
+} // namespace dom
+} // namespace mozilla
rename from content/html/content/src/nsMediaError.h
rename to content/html/content/src/MediaError.h
--- a/content/html/content/src/nsMediaError.h
+++ b/content/html/content/src/MediaError.h
@@ -1,24 +1,36 @@
 /* -*- 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/. */
+
+#ifndef mozilla_dom_MediaError_h
+#define mozilla_dom_MediaError_h
+
 #include "nsIDOMMediaError.h"
 #include "nsISupports.h"
 #include "mozilla/Attributes.h"
 
-class nsMediaError MOZ_FINAL : public nsIDOMMediaError
+namespace mozilla {
+namespace dom {
+
+class MediaError MOZ_FINAL : public nsIDOMMediaError
 {
 public:
-  nsMediaError(uint16_t aCode);
+  MediaError(uint16_t aCode);
 
   // nsISupports
   NS_DECL_ISUPPORTS
 
   // nsIDOMMediaError
   NS_DECL_NSIDOMMEDIAERROR
 
 private:
   // Error code
   uint16_t mCode;
 };
+
+} // namespace dom
+} // namespace mozilla
+
+#endif // mozilla_dom_MediaError_h
--- a/content/html/content/src/nsHTMLMediaElement.cpp
+++ b/content/html/content/src/nsHTMLMediaElement.cpp
@@ -33,17 +33,17 @@
 #include "nsFrameManager.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsIXPConnect.h"
 #include "jsapi.h"
 
 #include "nsITimer.h"
 
 #include "nsEventDispatcher.h"
-#include "nsMediaError.h"
+#include "MediaError.h"
 #include "MediaDecoder.h"
 #include "nsICategoryManager.h"
 #include "MediaResource.h"
 
 #include "nsIDOMHTMLVideoElement.h"
 #include "nsIContentPolicy.h"
 #include "nsContentPolicyUtils.h"
 #include "nsCrossSiteListenerProxy.h"
@@ -655,17 +655,17 @@ void nsHTMLMediaElement::AbortExistingLo
 
   mIsRunningSelectResource = false;
 }
 
 void nsHTMLMediaElement::NoSupportedMediaSourceError()
 {
   NS_ASSERTION(mDelayingLoadEvent, "Load event not delayed during source selection?");
 
-  mError = new nsMediaError(nsIDOMMediaError::MEDIA_ERR_SRC_NOT_SUPPORTED);
+  mError = new MediaError(nsIDOMMediaError::MEDIA_ERR_SRC_NOT_SUPPORTED);
   mNetworkState = nsIDOMHTMLMediaElement::NETWORK_NO_SOURCE;
   DispatchAsyncEvent(NS_LITERAL_STRING("error"));
   // This clears mDelayingLoadEvent, so AddRemoveSelfReference will be called
   ChangeDelayLoadStatus(false);
 }
 
 typedef void (nsHTMLMediaElement::*SyncSectionFn)();
 
@@ -2735,17 +2735,17 @@ void nsHTMLMediaElement::LoadAborted()
 }
 
 void nsHTMLMediaElement::Error(uint16_t aErrorCode)
 {
   NS_ASSERTION(aErrorCode == nsIDOMMediaError::MEDIA_ERR_DECODE ||
                aErrorCode == nsIDOMMediaError::MEDIA_ERR_NETWORK ||
                aErrorCode == nsIDOMMediaError::MEDIA_ERR_ABORTED,
                "Only use nsIDOMMediaError codes!");
-  mError = new nsMediaError(aErrorCode);
+  mError = new MediaError(aErrorCode);
   mBegun = false;
   DispatchAsyncEvent(NS_LITERAL_STRING("error"));
   if (mReadyState == nsIDOMHTMLMediaElement::HAVE_NOTHING) {
     mNetworkState = nsIDOMHTMLMediaElement::NETWORK_EMPTY;
     DispatchAsyncEvent(NS_LITERAL_STRING("emptied"));
   } else {
     mNetworkState = nsIDOMHTMLMediaElement::NETWORK_IDLE;
   }
--- a/content/html/content/src/nsHTMLVideoElement.cpp
+++ b/content/html/content/src/nsHTMLVideoElement.cpp
@@ -24,17 +24,17 @@
 #include "nsIScriptSecurityManager.h"
 #include "nsIXPConnect.h"
 #include "jsapi.h"
 
 #include "nsITimer.h"
 
 #include "nsEventDispatcher.h"
 #include "nsIDOMProgressEvent.h"
-#include "nsMediaError.h"
+#include "MediaError.h"
 #include "MediaDecoder.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(Video)
 
 NS_IMPL_ADDREF_INHERITED(nsHTMLVideoElement, nsHTMLMediaElement)