Bug 1396629 - P2. Change string type. r?cpearce draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Mon, 04 Sep 2017 22:43:12 +0200
changeset 658803 7fc7926dc4562a9dfb1d73e4cf6d84ca82c9b004
parent 658802 e84de159ee1bf6ae95358ef44742d0a5e5ecf787
child 658804 c0c044ff9171cec98cf2d0ab763ed0c2a53d0427
push id77874
push userbmo:jyavenard@mozilla.com
push dateMon, 04 Sep 2017 21:38:59 +0000
reviewerscpearce
bugs1396629
milestone57.0a1
Bug 1396629 - P2. Change string type. r?cpearce MozReview-Commit-ID: Jl8t60Qh600
dom/media/MediaContainerType.h
dom/media/MediaMIMETypes.h
--- a/dom/media/MediaContainerType.h
+++ b/dom/media/MediaContainerType.h
@@ -32,17 +32,17 @@ public:
   {
   }
 
   const MediaMIMEType& Type() const { return mExtendedMIMEType.Type(); }
   const MediaExtendedMIMEType& ExtendedType() const { return mExtendedMIMEType; }
 
   // Original string. Note that "type/subtype" may not be lowercase,
   // use Type().AsString() instead to get the normalized "type/subtype".
-  const nsACString& OriginalString() const { return mExtendedMIMEType.OriginalString(); }
+  const nsCString& OriginalString() const { return mExtendedMIMEType.OriginalString(); }
 
   size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
 
 private:
   MediaExtendedMIMEType mExtendedMIMEType;
 };
 
 Maybe<MediaContainerType> MakeMediaContainerType(const nsAString& aType);
--- a/dom/media/MediaMIMETypes.h
+++ b/dom/media/MediaMIMETypes.h
@@ -51,17 +51,17 @@ public:
   // Construction from a DependentMediaMIMEType, with its inherent checks.
   // Implicit so MEDIAMIMETYPE can be used wherever a MediaMIMEType is expected.
   MOZ_IMPLICIT MediaMIMEType(const DependentMediaMIMEType& aType)
     : mMIMEType(aType.AsDependentString())
   {
   }
 
   // MIME "type/subtype", always lowercase.
-  const nsACString& AsString() const { return mMIMEType; }
+  const nsCString& AsString() const { return mMIMEType; }
 
   // Comparison with DependentMediaMIMEType.
   // Useful to compare to MEDIAMIMETYPE literals.
   bool operator==(const DependentMediaMIMEType& aOther) const
   {
     return mMIMEType.Equals(aOther.AsDependentString());
   }
   bool operator!=(const DependentMediaMIMEType& aOther) const
@@ -113,17 +113,17 @@ public:
   // Construction from a literal comma-separated list of codecs. Unchecked.
   template <size_t N>
   explicit MediaCodecs(const char (&aCodecs)[N])
     : mCodecs(NS_ConvertUTF8toUTF16(aCodecs, N - 1))
   {
   }
 
   bool IsEmpty() const { return mCodecs.IsEmpty(); }
-  const nsAString& AsString() const { return mCodecs; }
+  const nsString& AsString() const { return mCodecs; }
 
   using RangeType =
     const StringListRange<nsString, StringListRangeEmptyItems::ProcessEmptyItems>;
 
   // Produces a range object with begin()&end(), can be used in range-for loops.
   // This will iterate through all codecs, even empty ones (except if the
   // original list was an empty string). Iterators dereference to
   // 'const nsDependentString', valid for as long as this MediaCodecs object.
@@ -175,17 +175,17 @@ public:
   // Sizes and rates.
   Maybe<int32_t> GetWidth() const { return GetMaybeNumber(mWidth); }
   Maybe<int32_t> GetHeight() const { return GetMaybeNumber(mHeight); }
   Maybe<int32_t> GetFramerate() const { return GetMaybeNumber(mFramerate); }
   Maybe<int32_t> GetBitrate() const { return GetMaybeNumber(mBitrate); }
 
   // Original string. Note that "type/subtype" may not be lowercase,
   // use Type().AsString() instead to get the normalized "type/subtype".
-  const nsACString& OriginalString() const { return mOriginalString; }
+  const nsCString& OriginalString() const { return mOriginalString; }
 
   size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
 
 private:
   friend Maybe<MediaExtendedMIMEType> MakeMediaExtendedMIMEType(const nsAString& aType);
   MediaExtendedMIMEType(const nsACString& aOriginalString,
                         const nsACString& aMIMEType,
                         bool aHaveCodecs, const nsAString& aCodecs,