Bug 1431449 - Make URLParams::DecodeString static; r=bz
authorAnthony Ramine <n.oxyde@gmail.com>
Thu, 18 Jan 2018 13:13:08 +0100
changeset 400029 d86e47eb88db367de8f5bf58643bf6b8652d2c05
parent 400028 ddb98ad66aa0d86766f4e4bd792d75b432d6f4d9
child 400030 ecc091d9860d5034147187b9360e69795b06a9f4
push id99079
push userrgurzau@mozilla.com
push dateSat, 20 Jan 2018 09:46:52 +0000
treeherdermozilla-inbound@85824602b479 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1431449
milestone59.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
Bug 1431449 - Make URLParams::DecodeString static; r=bz MozReview-Commit-ID: KKoaxHSnmSz
dom/url/URLSearchParams.cpp
dom/url/URLSearchParams.h
--- a/dom/url/URLSearchParams.cpp
+++ b/dom/url/URLSearchParams.cpp
@@ -93,25 +93,25 @@ URLParams::Delete(const nsAString& aName
     if (mParams[i].mKey.Equals(aName)) {
       mParams.RemoveElementAt(i);
     } else {
       ++i;
     }
   }
 }
 
-void
+/* static */ void
 URLParams::ConvertString(const nsACString& aInput, nsAString& aOutput)
 {
   if (NS_FAILED(UTF_8_ENCODING->DecodeWithoutBOMHandling(aInput, aOutput))) {
     MOZ_CRASH("Out of memory when converting URL params.");
   }
 }
 
-void
+/* static */ void
 URLParams::DecodeString(const nsACString& aInput, nsAString& aOutput)
 {
   nsACString::const_iterator start, end;
   aInput.BeginReading(start);
   aInput.EndReading(end);
 
   nsCString unescaped;
 
--- a/dom/url/URLSearchParams.h
+++ b/dom/url/URLSearchParams.h
@@ -108,18 +108,18 @@ public:
 
   bool
   ReadStructuredClone(JSStructuredCloneReader* aReader);
 
   bool
   WriteStructuredClone(JSStructuredCloneWriter* aWriter) const;
 
 private:
-  void DecodeString(const nsACString& aInput, nsAString& aOutput);
-  void ConvertString(const nsACString& aInput, nsAString& aOutput);
+  static void DecodeString(const nsACString& aInput, nsAString& aOutput);
+  static void ConvertString(const nsACString& aInput, nsAString& aOutput);
 
   struct Param
   {
     nsString mKey;
     nsString mValue;
   };
 
   nsTArray<Param> mParams;