Bug 1400459 (part 1) - Remove return value from nsIAtom::ToUTF8String(). r=froydnj.
authorNicholas Nethercote <nnethercote@mozilla.com>
Mon, 25 Sep 2017 16:38:18 +1000
changeset 436210 1a063bcbef8a7bd9e6564c5b2c29264163066664
parent 436209 0e2959069bc35bfa468203980316ff63ca388b28
child 436211 8377625a20c16e3fc12513b858e5daf5c306c017
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1400459
milestone58.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 1400459 (part 1) - Remove return value from nsIAtom::ToUTF8String(). r=froydnj. It's infallible.
caps/BasePrincipal.cpp
xpcom/ds/nsAtomTable.cpp
xpcom/ds/nsIAtom.h
--- a/caps/BasePrincipal.cpp
+++ b/caps/BasePrincipal.cpp
@@ -48,17 +48,18 @@ BasePrincipal::GetOrigin(nsACString& aOr
   aOrigin.Append(suffix);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 BasePrincipal::GetOriginNoSuffix(nsACString& aOrigin)
 {
   MOZ_ASSERT(mInitialized);
-  return mOriginNoSuffix->ToUTF8String(aOrigin);
+  mOriginNoSuffix->ToUTF8String(aOrigin);
+  return NS_OK;
 }
 
 bool
 BasePrincipal::Subsumes(nsIPrincipal* aOther, DocumentDomainConsideration aConsideration)
 {
   MOZ_ASSERT(aOther);
   MOZ_ASSERT_IF(Kind() == eCodebasePrincipal, mOriginSuffix);
 
@@ -288,17 +289,18 @@ BasePrincipal::GetOriginAttributes(JSCon
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 BasePrincipal::GetOriginSuffix(nsACString& aOriginAttributes)
 {
   MOZ_ASSERT(mOriginSuffix);
-  return mOriginSuffix->ToUTF8String(aOriginAttributes);
+  mOriginSuffix->ToUTF8String(aOriginAttributes);
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 BasePrincipal::GetAppId(uint32_t* aAppId)
 {
   if (AppId() == nsIScriptSecurityManager::UNKNOWN_APP_ID) {
     MOZ_ASSERT(false);
     *aAppId = nsIScriptSecurityManager::NO_APP_ID;
--- a/xpcom/ds/nsAtomTable.cpp
+++ b/xpcom/ds/nsAtomTable.cpp
@@ -206,22 +206,21 @@ nsAtom::~nsAtom()
   if (!IsStaticAtom()) {
     MOZ_ASSERT(IsDynamicAtom() || IsHTML5Atom());
     nsStringBuffer::FromData(mString)->Release();
   }
 }
 
 NS_IMPL_QUERY_INTERFACE(nsAtom, nsIAtom);
 
-NS_IMETHODIMP
+NS_IMETHODIMP_(void)
 nsAtom::ToUTF8String(nsACString& aBuf)
 {
   MOZ_ASSERT(!IsHTML5Atom(), "Called ToUTF8String() on an HTML5 atom");
   CopyUTF16toUTF8(nsDependentString(mString, mLength), aBuf);
-  return NS_OK;
 }
 
 NS_IMETHODIMP_(size_t)
 nsAtom::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf)
 {
   MOZ_ASSERT(!IsHTML5Atom(), "Called SizeOfIncludingThis() on an HTML5 atom");
   size_t n = aMallocSizeOf(this);
   // String buffers pointed to by static atoms are in static memory, and so
--- a/xpcom/ds/nsIAtom.h
+++ b/xpcom/ds/nsIAtom.h
@@ -17,17 +17,17 @@
   {0x8b8c11d4, 0x3ed5, 0x4079, \
     { 0x89, 0x74, 0x73, 0xc7, 0x57, 0x6c, 0xdb, 0x34 }}
 
 class nsIAtom : public nsISupports
 {
 public:
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_IATOM_IID)
 
-  NS_IMETHOD ToUTF8String(nsACString& aString) = 0;
+  NS_IMETHOD_(void) ToUTF8String(nsACString& aString) = 0;
 
   NS_IMETHOD_(size_t)
   SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) = 0;
 
   // The kind of atom we have, in order to be able to devirtualize hot stuff
   // looking at mKind.
   enum class AtomKind : uint8_t {
     DynamicAtom = 0,
@@ -93,17 +93,17 @@ protected:
   // points to must belong to an nsStringBuffer. This is so that the
   // nsStringBuffer::FromData() calls above are valid.
   char16_t* mString;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsIAtom, NS_IATOM_IID)
 
 #define NS_DECL_NSIATOM \
-  NS_IMETHOD ToUTF8String(nsACString& _retval) override; \
+  NS_IMETHOD_(void) ToUTF8String(nsACString& _retval) override; \
   NS_IMETHOD_(size_t) SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) override;
 
 class nsAtom final : public nsIAtom
 {
 public:
   NS_DECL_NSIATOM
   NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr) final;
   typedef mozilla::TrueType HasThreadSafeRefCnt;