Bug 975688 part.7 Rename nsDOMDataContainerEvent to mozilla::dom::DataContainerEvent r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Wed, 26 Feb 2014 14:23:57 +0900
changeset 170709 e41a9f01d2176cd55af4762c546d521d3ea3b6ee
parent 170708 15320fc9ba1c8cb982ebc87661a3814ec9ab8cf3
child 170710 e931f64fda23042cb4b9ad2aa4684d0b7275f5f3
push id5019
push userryanvm@gmail.com
push dateWed, 26 Feb 2014 21:42:56 +0000
treeherderb2g-inbound@75f877dc0603 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs975688
milestone30.0a1
Bug 975688 part.7 Rename nsDOMDataContainerEvent to mozilla::dom::DataContainerEvent r=smaug
dom/bindings/Bindings.conf
dom/events/DataContainerEvent.cpp
dom/events/DataContainerEvent.h
dom/events/moz.build
dom/events/nsDOMDataContainerEvent.cpp
dom/events/nsDOMDataContainerEvent.h
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -295,17 +295,17 @@ DOMInterfaces = {
     'nativeType': 'nsDOMCSSValueList'
 },
 
 'DataChannel': {
     'nativeType': 'nsDOMDataChannel',
 },
 
 'DataContainerEvent': {
-    'nativeType': 'nsDOMDataContainerEvent',
+    'nativeType': 'mozilla::dom::DataContainerEvent',
 },
 
 'DedicatedWorkerGlobalScope': {
     'headerFile': 'mozilla/dom/WorkerScope.h',
     'workers': True,
 },
 
 'DelayNode': {
rename from dom/events/nsDOMDataContainerEvent.cpp
rename to dom/events/DataContainerEvent.cpp
--- a/dom/events/nsDOMDataContainerEvent.cpp
+++ b/dom/events/DataContainerEvent.cpp
@@ -1,100 +1,104 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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 "nsDOMDataContainerEvent.h"
+#include "mozilla/dom/DataContainerEvent.h"
 #include "nsContentUtils.h"
 #include "nsIXPConnect.h"
 
-using namespace mozilla;
+namespace mozilla {
+namespace dom {
 
-nsDOMDataContainerEvent::nsDOMDataContainerEvent(
-                                             mozilla::dom::EventTarget* aOwner,
-                                             nsPresContext* aPresContext,
-                                             WidgetEvent* aEvent)
+DataContainerEvent::DataContainerEvent(EventTarget* aOwner,
+                                       nsPresContext* aPresContext,
+                                       WidgetEvent* aEvent)
   : nsDOMEvent(aOwner, aPresContext, aEvent)
 {
 }
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(nsDOMDataContainerEvent)
+NS_IMPL_CYCLE_COLLECTION_CLASS(DataContainerEvent)
 
-NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsDOMDataContainerEvent,
-                                                nsDOMEvent)
+NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(DataContainerEvent, nsDOMEvent)
   tmp->mData.Clear();
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsDOMDataContainerEvent,
+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(DataContainerEvent,
                                                   nsDOMEvent)
   tmp->mData.EnumerateRead(TraverseEntry, &cb);
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_ADDREF_INHERITED(nsDOMDataContainerEvent, nsDOMEvent)
-NS_IMPL_RELEASE_INHERITED(nsDOMDataContainerEvent, nsDOMEvent)
+NS_IMPL_ADDREF_INHERITED(DataContainerEvent, nsDOMEvent)
+NS_IMPL_RELEASE_INHERITED(DataContainerEvent, nsDOMEvent)
 
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMDataContainerEvent)
+NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(DataContainerEvent)
   NS_INTERFACE_MAP_ENTRY(nsIDOMDataContainerEvent)
 NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
 
 NS_IMETHODIMP
-nsDOMDataContainerEvent::GetData(const nsAString& aKey, nsIVariant **aData)
+DataContainerEvent::GetData(const nsAString& aKey, nsIVariant** aData)
 {
   NS_ENSURE_ARG_POINTER(aData);
 
   mData.Get(aKey, aData);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsDOMDataContainerEvent::SetData(const nsAString& aKey, nsIVariant *aData)
+DataContainerEvent::SetData(const nsAString& aKey, nsIVariant* aData)
 {
   NS_ENSURE_ARG(aData);
 
   // Make sure this event isn't already being dispatched.
   NS_ENSURE_STATE(!mEvent->mFlags.mIsBeingDispatched);
   mData.Put(aKey, aData);
   return NS_OK;
 }
 
 void
-nsDOMDataContainerEvent::SetData(JSContext* aCx, const nsAString& aKey,
-                                 JS::Handle<JS::Value> aVal,
-                                 mozilla::ErrorResult& aRv)
+DataContainerEvent::SetData(JSContext* aCx, const nsAString& aKey,
+                            JS::Handle<JS::Value> aVal,
+                            ErrorResult& aRv)
 {
   if (!nsContentUtils::XPConnect()) {
     aRv = NS_ERROR_FAILURE;
     return;
   }
   nsCOMPtr<nsIVariant> val;
   nsresult rv =
     nsContentUtils::XPConnect()->JSToVariant(aCx, aVal, getter_AddRefs(val));
   if (NS_FAILED(rv)) {
     aRv = rv;
     return;
   }
   aRv = SetData(aKey, val);
 }
 
-nsresult
-NS_NewDOMDataContainerEvent(nsIDOMEvent** aInstancePtrResult,
-                            mozilla::dom::EventTarget* aOwner,
-                            nsPresContext* aPresContext,
-                            WidgetEvent* aEvent)
-{
-  nsDOMDataContainerEvent* it =
-    new nsDOMDataContainerEvent(aOwner, aPresContext, aEvent);
-
-  return CallQueryInterface(it, aInstancePtrResult);
-}
-
 PLDHashOperator
-nsDOMDataContainerEvent::TraverseEntry(const nsAString& aKey,
-                                       nsIVariant *aDataItem,
-                                       void* aUserArg)
+DataContainerEvent::TraverseEntry(const nsAString& aKey,
+                                  nsIVariant* aDataItem,
+                                  void* aUserArg)
 {
   nsCycleCollectionTraversalCallback *cb =
     static_cast<nsCycleCollectionTraversalCallback*>(aUserArg);
   cb->NoteXPCOMChild(aDataItem);
 
   return PL_DHASH_NEXT;
 }
+
+} // namespace dom
+} // namespace mozilla
+
+using namespace mozilla;
+using namespace mozilla::dom;
+
+nsresult
+NS_NewDOMDataContainerEvent(nsIDOMEvent** aInstancePtrResult,
+                            EventTarget* aOwner,
+                            nsPresContext* aPresContext,
+                            WidgetEvent* aEvent)
+{
+  DataContainerEvent* it = new DataContainerEvent(aOwner, aPresContext, aEvent);
+  return CallQueryInterface(it, aInstancePtrResult);
+}
+
rename from dom/events/nsDOMDataContainerEvent.h
rename to dom/events/DataContainerEvent.h
--- a/dom/events/nsDOMDataContainerEvent.h
+++ b/dom/events/DataContainerEvent.h
@@ -1,54 +1,59 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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 nsDOMDataContainerEvent_h___
-#define nsDOMDataContainerEvent_h___
+#ifndef mozilla_dom_DataContainerEvent_h_
+#define mozilla_dom_DataContainerEvent_h_
 
 #include "nsIDOMDataContainerEvent.h"
 #include "nsDOMEvent.h"
 #include "nsInterfaceHashtable.h"
 #include "mozilla/dom/DataContainerEventBinding.h"
 
-class nsDOMDataContainerEvent : public nsDOMEvent,
-                                public nsIDOMDataContainerEvent
+namespace mozilla {
+namespace dom {
+
+class DataContainerEvent : public nsDOMEvent,
+                           public nsIDOMDataContainerEvent
 {
 public:
-  nsDOMDataContainerEvent(mozilla::dom::EventTarget* aOwner,
-                          nsPresContext* aPresContext,
-                          mozilla::WidgetEvent* aEvent);
+  DataContainerEvent(EventTarget* aOwner,
+                     nsPresContext* aPresContext,
+                     WidgetEvent* aEvent);
 
   NS_DECL_ISUPPORTS_INHERITED
 
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsDOMDataContainerEvent, nsDOMEvent)
+  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DataContainerEvent, nsDOMEvent)
 
   NS_FORWARD_TO_NSDOMEVENT
 
   NS_DECL_NSIDOMDATACONTAINEREVENT
 
   virtual JSObject*
   WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
   {
-    return mozilla::dom::DataContainerEventBinding::Wrap(aCx, aScope, this);
+    return DataContainerEventBinding::Wrap(aCx, aScope, this);
   }
 
   already_AddRefed<nsIVariant> GetData(const nsAString& aKey)
   {
     nsCOMPtr<nsIVariant> val;
     GetData(aKey, getter_AddRefs(val));
     return val.forget();
   }
 
   void SetData(JSContext* aCx, const nsAString& aKey,
-               JS::Handle<JS::Value> aVal, mozilla::ErrorResult& aRv);
+               JS::Handle<JS::Value> aVal, ErrorResult& aRv);
 
 private:
   static PLDHashOperator
-    TraverseEntry(const nsAString& aKey, nsIVariant *aDataItem, void* aUserArg);
+    TraverseEntry(const nsAString& aKey, nsIVariant* aDataItem, void* aUserArg);
 
   nsInterfaceHashtable<nsStringHashKey, nsIVariant> mData;
 };
 
-#endif
+} // namespace dom
+} // namespace mozilla
 
+#endif // mozilla_dom_DataContainerEvent_h_
--- a/dom/events/moz.build
+++ b/dom/events/moz.build
@@ -36,35 +36,36 @@ EXPORTS.mozilla += [
 ]
 
 EXPORTS.mozilla.dom += [
     'AnimationEvent.h',
     'BeforeUnloadEvent.h',
     'ClipboardEvent.h',
     'CommandEvent.h',
     'CompositionEvent.h',
+    'DataContainerEvent.h',
     'EventTarget.h',
     'PointerEvent.h',
     'Touch.h',
     'WheelEvent.h',
 ]
 
 if CONFIG['MOZ_WEBSPEECH']:
     EXPORTS.mozilla.dom += ['SpeechRecognitionError.h']
 
 UNIFIED_SOURCES += [
     'AnimationEvent.cpp',
     'BeforeUnloadEvent.cpp',
     'ClipboardEvent.cpp',
     'CommandEvent.cpp',
     'CompositionEvent.cpp',
+    'DataContainerEvent.cpp',
     'EventTarget.cpp',
     'nsAsyncDOMEvent.cpp',
     'nsContentEventHandler.cpp',
-    'nsDOMDataContainerEvent.cpp',
     'nsDOMDataTransfer.cpp',
     'nsDOMDeviceMotionEvent.cpp',
     'nsDOMDragEvent.cpp',
     'nsDOMEventTargetHelper.cpp',
     'nsDOMFocusEvent.cpp',
     'nsDOMKeyboardEvent.cpp',
     'nsDOMMessageEvent.cpp',
     'nsDOMMouseEvent.cpp',