Back out bug 1177916 (changeset d4c34d7fb112) for test_urlSearchParams.html failure.
authorCameron McCormack <cam@mcc.id.au>
Sat, 27 Jun 2015 12:18:19 +1000
changeset 250387 9280a393a6f74dcebab20215ea59e1711399bfa5
parent 250386 31a691e3ac2bad80fe73c97681f683d72a774b1b
child 250388 1524034982b8c7d30298412522ee222af0550b39
push id61543
push usercmccormack@mozilla.com
push dateSat, 27 Jun 2015 02:18:33 +0000
treeherdermozilla-inbound@9280a393a6f7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1177916
milestone41.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
Back out bug 1177916 (changeset d4c34d7fb112) for test_urlSearchParams.html failure.
dom/base/Link.cpp
dom/base/URL.cpp
dom/base/URLSearchParams.cpp
dom/base/URLSearchParams.h
dom/fetch/Fetch.cpp
dom/workers/URL.cpp
toolkit/components/places/tests/cpp/mock_Link.h
--- a/dom/base/Link.cpp
+++ b/dom/base/Link.cpp
@@ -608,17 +608,17 @@ Link::UpdateURLSearchParams()
 
   mSearchParams->ParseInput(search);
 }
 
 void
 Link::CreateSearchParamsIfNeeded()
 {
   if (!mSearchParams) {
-    mSearchParams = new URLSearchParams(this, this);
+    mSearchParams = new URLSearchParams(this);
     UpdateURLSearchParams();
   }
 }
 
 void
 Link::Unlink()
 {
   if (mSearchParams) {
--- a/dom/base/URL.cpp
+++ b/dom/base/URL.cpp
@@ -528,15 +528,15 @@ bool IsChromeURI(nsIURI* aURI)
       return isChrome;
   return false;
 }
 
 void
 URL::CreateSearchParamsIfNeeded()
 {
   if (!mSearchParams) {
-    mSearchParams = new URLSearchParams(this, this);
+    mSearchParams = new URLSearchParams(this);
     UpdateURLSearchParams();
   }
 }
 
 }
 }
--- a/dom/base/URLSearchParams.cpp
+++ b/dom/base/URLSearchParams.cpp
@@ -288,38 +288,32 @@ URLParams::Serialize(nsAString& aValue) 
     }
 
     SerializeString(NS_ConvertUTF16toUTF8(mParams[i].mKey), aValue);
     aValue.Append('=');
     SerializeString(NS_ConvertUTF16toUTF8(mParams[i].mValue), aValue);
   }
 }
 
-NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(URLSearchParams, mParent, mObserver)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(URLSearchParams, mObserver)
 NS_IMPL_CYCLE_COLLECTING_ADDREF(URLSearchParams)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(URLSearchParams)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(URLSearchParams)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
-URLSearchParams::URLSearchParams(nsISupports* aParent,
-                                 URLSearchParamsObserver* aObserver)
-  : mParams(new URLParams())
-  , mParent(aParent)
-  , mObserver(aObserver)
+URLSearchParams::URLSearchParams(URLSearchParamsObserver* aObserver)
+  : mParams(new URLParams()), mObserver(aObserver)
 {
 }
 
-URLSearchParams::URLSearchParams(nsISupports* aParent,
-                                 const URLSearchParams& aOther)
-  : mParams(new URLParams(*aOther.mParams.get()))
-  , mParent(aParent)
-  , mObserver(aOther.mObserver)
+URLSearchParams::URLSearchParams(const URLSearchParams& aOther)
+  : mParams(new URLParams(*aOther.mParams.get())), mObserver(aOther.mObserver)
 {
 }
 
 URLSearchParams::~URLSearchParams()
 {
   DeleteAll();
 }
 
@@ -329,31 +323,27 @@ URLSearchParams::WrapObject(JSContext* a
   return URLSearchParamsBinding::Wrap(aCx, this, aGivenProto);
 }
 
 /* static */ already_AddRefed<URLSearchParams>
 URLSearchParams::Constructor(const GlobalObject& aGlobal,
                              const nsAString& aInit,
                              ErrorResult& aRv)
 {
-  nsRefPtr<URLSearchParams> sp =
-    new URLSearchParams(aGlobal.GetAsSupports(), nullptr);
+  nsRefPtr<URLSearchParams> sp = new URLSearchParams(nullptr);
   sp->ParseInput(NS_ConvertUTF16toUTF8(aInit));
-
   return sp.forget();
 }
 
 /* static */ already_AddRefed<URLSearchParams>
 URLSearchParams::Constructor(const GlobalObject& aGlobal,
                              URLSearchParams& aInit,
                              ErrorResult& aRv)
 {
-  nsRefPtr<URLSearchParams> sp =
-    new URLSearchParams(aGlobal.GetAsSupports(), aInit);
-
+  nsRefPtr<URLSearchParams> sp = new URLSearchParams(aInit);
   return sp.forget();
 }
 
 void
 URLSearchParams::ParseInput(const nsACString& aInput)
 {
   mParams->ParseInput(aInput);
 }
--- a/dom/base/URLSearchParams.h
+++ b/dom/base/URLSearchParams.h
@@ -109,26 +109,24 @@ class URLSearchParams final : public nsI
                               public nsWrapperCache
 {
   ~URLSearchParams();
 
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(URLSearchParams)
 
-  URLSearchParams(nsISupports* aParent,
-                  URLSearchParamsObserver* aObserver);
+  explicit URLSearchParams(URLSearchParamsObserver* aObserver);
 
-  URLSearchParams(nsISupports* aParent,
-                  const URLSearchParams& aOther);
+  explicit URLSearchParams(const URLSearchParams& aOther);
 
   // WebIDL methods
   nsISupports* GetParentObject() const
   {
-    return mParent;
+    return nullptr;
   }
 
   virtual JSObject*
   WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
 
   static already_AddRefed<URLSearchParams>
   Constructor(const GlobalObject& aGlobal, const nsAString& aInit,
               ErrorResult& aRv);
@@ -171,16 +169,15 @@ public:
 private:
   void AppendInternal(const nsAString& aName, const nsAString& aValue);
 
   void DeleteAll();
 
   void NotifyObserver();
 
   UniquePtr<URLParams> mParams;
-  nsCOMPtr<nsISupports> mParent;
   nsRefPtr<URLSearchParamsObserver> mObserver;
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif /* mozilla_dom_URLSearchParams_h */
--- a/dom/fetch/Fetch.cpp
+++ b/dom/fetch/Fetch.cpp
@@ -1538,22 +1538,22 @@ FetchBody<Derived>::ContinueConsumeBody(
         NS_NAMED_LITERAL_CSTRING(urlDataMimeType, "application/x-www-form-urlencoded");
         bool isValidUrlEncodedMimeType = StringBeginsWith(mMimeType, urlDataMimeType);
 
         if (isValidUrlEncodedMimeType && mMimeType.Length() > urlDataMimeType.Length()) {
           isValidUrlEncodedMimeType = mMimeType[urlDataMimeType.Length()] == ';';
         }
 
         if (isValidUrlEncodedMimeType) {
-          URLParams params;
-          params.ParseInput(data);
+          nsRefPtr<URLSearchParams> params = new URLSearchParams(nullptr);
+          params->ParseInput(data);
 
           nsRefPtr<nsFormData> fd = new nsFormData(DerivedClass()->GetParentObject());
           FillFormIterator iterator(fd);
-          DebugOnly<bool> status = params.ForEach(iterator);
+          DebugOnly<bool> status = params->ForEach(iterator);
           MOZ_ASSERT(status);
 
           localPromise->MaybeResolve(fd);
         } else {
           ErrorResult result;
           result.ThrowTypeError(MSG_BAD_FORMDATA);
           localPromise->MaybeReject(result);
         }
--- a/dom/workers/URL.cpp
+++ b/dom/workers/URL.cpp
@@ -947,14 +947,14 @@ URL::UpdateURLSearchParams()
     mSearchParams->ParseInput(NS_ConvertUTF16toUTF8(Substring(search, 1)));
   }
 }
 
 void
 URL::CreateSearchParamsIfNeeded()
 {
   if (!mSearchParams) {
-    mSearchParams = new URLSearchParams(this, this);
+    mSearchParams = new URLSearchParams(this);
     UpdateURLSearchParams();
   }
 }
 
 END_WORKERS_NAMESPACE
--- a/toolkit/components/places/tests/cpp/mock_Link.h
+++ b/toolkit/components/places/tests/cpp/mock_Link.h
@@ -140,18 +140,17 @@ NS_IMPL_CYCLE_COLLECTING_ADDREF(URLSearc
 NS_IMPL_CYCLE_COLLECTING_RELEASE(URLSearchParams)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(URLSearchParams)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 
-URLSearchParams::URLSearchParams(nsISupports* aParent,
-                                 URLSearchParamsObserver* aObserver)
+URLSearchParams::URLSearchParams(URLSearchParamsObserver* aObserver)
 {
 }
 
 URLSearchParams::~URLSearchParams()
 {
 }
 
 JSObject*