Back out bug 1177916 (changeset d4c34d7fb112) for test_urlSearchParams.html failure.

This commit is contained in:
Cameron McCormack 2015-06-27 12:18:19 +10:00
parent 5ccbe11d06
commit 860a9f7d1a
7 changed files with 17 additions and 31 deletions

View File

@ -613,7 +613,7 @@ void
Link::CreateSearchParamsIfNeeded()
{
if (!mSearchParams) {
mSearchParams = new URLSearchParams(this, this);
mSearchParams = new URLSearchParams(this);
UpdateURLSearchParams();
}
}

View File

@ -533,7 +533,7 @@ void
URL::CreateSearchParamsIfNeeded()
{
if (!mSearchParams) {
mSearchParams = new URLSearchParams(this, this);
mSearchParams = new URLSearchParams(this);
UpdateURLSearchParams();
}
}

View File

@ -293,7 +293,7 @@ URLParams::Serialize(nsAString& aValue) const
}
}
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)
@ -302,19 +302,13 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(URLSearchParams)
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)
{
}
@ -334,10 +328,8 @@ 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();
}
@ -346,9 +338,7 @@ 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();
}

View File

@ -114,16 +114,14 @@ 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*
@ -176,7 +174,6 @@ private:
void NotifyObserver();
UniquePtr<URLParams> mParams;
nsCOMPtr<nsISupports> mParent;
nsRefPtr<URLSearchParamsObserver> mObserver;
};

View File

@ -1543,12 +1543,12 @@ FetchBody<Derived>::ContinueConsumeBody(nsresult aStatus, uint32_t aResultLength
}
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);

View File

@ -952,7 +952,7 @@ void
URL::CreateSearchParamsIfNeeded()
{
if (!mSearchParams) {
mSearchParams = new URLSearchParams(this, this);
mSearchParams = new URLSearchParams(this);
UpdateURLSearchParams();
}
}

View File

@ -145,8 +145,7 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(URLSearchParams)
NS_INTERFACE_MAP_END
URLSearchParams::URLSearchParams(nsISupports* aParent,
URLSearchParamsObserver* aObserver)
URLSearchParams::URLSearchParams(URLSearchParamsObserver* aObserver)
{
}