Bug 1024465 - Define an out of line destructor for DataStore so that we can forward delcare DataStoreImpl in DataStore.h; r=bzbarsky
authorEhsan Akhgari <ehsan@mozilla.com>
Thu, 12 Jun 2014 11:31:36 -0400
changeset 202265 bd5ebedffaf953e1f86e00fd63208fc71520fcdf
parent 202264 d4debc189f17c3ae341eb82225fd244cc22c3b9b
child 202266 9a188d035eeecae92da54a4ce4da020fbb64b79d
push id6561
push userasasaki@mozilla.com
push dateMon, 21 Jul 2014 21:23:20 +0000
treeherdermozilla-aurora@428d4d3c8588 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbzbarsky
bugs1024465
milestone33.0a1
Bug 1024465 - Define an out of line destructor for DataStore so that we can forward delcare DataStoreImpl in DataStore.h; r=bzbarsky This is required because the destructor for the nsRefPtr<DataStoreImpl> member requires the full definition of the type.
dom/datastore/DataStore.cpp
dom/datastore/DataStore.h
--- a/dom/datastore/DataStore.cpp
+++ b/dom/datastore/DataStore.cpp
@@ -24,16 +24,20 @@ NS_INTERFACE_MAP_END_INHERITING(DOMEvent
 
 NS_IMPL_CYCLE_COLLECTION_INHERITED(DataStore, DOMEventTargetHelper, mStore)
 
 DataStore::DataStore(nsPIDOMWindow* aWindow)
   : DOMEventTargetHelper(aWindow)
 {
 }
 
+DataStore::~DataStore()
+{
+}
+
 already_AddRefed<DataStore>
 DataStore::Constructor(GlobalObject& aGlobal, ErrorResult& aRv)
 {
   nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aGlobal.GetAsSupports());
   if (!window) {
     aRv.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
--- a/dom/datastore/DataStore.h
+++ b/dom/datastore/DataStore.h
@@ -22,16 +22,17 @@ class OwningStringOrUnsignedLong;
 class DataStore MOZ_FINAL : public DOMEventTargetHelper
 {
 public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DataStore,
                                            DOMEventTargetHelper)
 
   explicit DataStore(nsPIDOMWindow* aWindow);
+  ~DataStore();
 
   // WebIDL (internal functions)
 
   static already_AddRefed<DataStore> Constructor(GlobalObject& aGlobal,
                                                  ErrorResult& aRv);
 
   virtual JSObject* WrapObject(JSContext *aCx) MOZ_OVERRIDE;
 
@@ -84,9 +85,9 @@ public:
 
 private:
   nsRefPtr<DataStoreImpl> mStore;
 };
 
 } //namespace dom
 } //namespace mozilla
 
-#endif
\ No newline at end of file
+#endif