Bug 1358410 - Use StringBlobImpl in BlobSet, r=qdot
authorAndrea Marchesini <amarchesini@mozilla.com>
Tue, 25 Apr 2017 22:29:13 +0200
changeset 354816 6a8d0cded18b12eacd2c1abe7b2e96a66349c1cf
parent 354815 ef22968180d52005025b4ec50de01896262601c5
child 354817 24f0f4caa0313ca2f6135a1cc350b6f8a3f6064c
push id89572
push useramarchesini@mozilla.com
push dateTue, 25 Apr 2017 20:30:40 +0000
treeherdermozilla-inbound@24f0f4caa031 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersqdot
bugs1358410
milestone55.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 1358410 - Use StringBlobImpl in BlobSet, r=qdot
dom/file/BlobSet.cpp
--- a/dom/file/BlobSet.cpp
+++ b/dom/file/BlobSet.cpp
@@ -44,18 +44,19 @@ BlobSet::AppendString(const nsAString& a
       utf8Str.ReplaceSubstring("\r\n", "\n");
       utf8Str.ReplaceSubstring("\r", "\n");
     }
 #ifdef XP_WIN
     utf8Str.ReplaceSubstring("\n", "\r\n");
 #endif
   }
 
-  return AppendVoidPtr((void*)utf8Str.Data(),
-                       utf8Str.Length());
+  RefPtr<StringBlobImpl> blobImpl =
+    StringBlobImpl::Create(utf8Str, EmptyString());
+  return AppendBlobImpl(blobImpl);
 }
 
 nsresult
 BlobSet::AppendBlobImpl(BlobImpl* aBlobImpl)
 {
   NS_ENSURE_ARG_POINTER(aBlobImpl);
   mBlobImpls.AppendElement(aBlobImpl);
   return NS_OK;