Bug 1005578 - Change nsIURI object from nsStandardURL to nsJSURI when calling url.href. r=bz, a=sledru
authorValentin Gosu <valentin.gosu@gmail.com>
Tue, 06 May 2014 17:14:04 -0400
changeset 199084 0f40e6c752c8ec96d68d6036c1dd588c524e31df
parent 199083 cff3a438c3e13877d4223f0e5740954d177a3c8f
child 199085 025e2cc8643095b704f10f49ea9332675261b997
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz, sledru
bugs1005578
milestone31.0a2
Bug 1005578 - Change nsIURI object from nsStandardURL to nsJSURI when calling url.href. r=bz, a=sledru
dom/base/URL.cpp
--- a/dom/base/URL.cpp
+++ b/dom/base/URL.cpp
@@ -226,17 +226,17 @@ URL::SetHref(const nsAString& aHref, Err
   nsCOMPtr<nsIURI> uri;
   rv = ioService->NewURI(href, nullptr, nullptr, getter_AddRefs(uri));
   if (NS_FAILED(rv)) {
     nsAutoString label(aHref);
     aRv.ThrowTypeError(MSG_INVALID_URL, &label);
     return;
   }
 
-  aRv = mURI->SetSpec(href);
+  mURI = uri;
   UpdateURLSearchParams();
 }
 
 void
 URL::GetOrigin(nsString& aOrigin) const
 {
   nsContentUtils::GetUTFNonNullOrigin(mURI, aOrigin);
 }