Bug 942356 - Fix up Flash version string on Linux. r=bsmedberg
authorDongie Agnir <dongie.agnir@gmail.com>
Wed, 04 Dec 2013 17:46:20 -0500
changeset 174474 e61b29079c0255ffb7154b5bd19c3efde828b1bc
parent 174473 9b14d922a5141d47d2233e2fde16e00c4ef1b4bb
child 174475 aa4d322d811f42ed1f3d26d639c1f0df53be4e74
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs942356
milestone28.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 942356 - Fix up Flash version string on Linux. r=bsmedberg
dom/plugins/base/nsPluginTags.cpp
dom/plugins/base/nsPluginTags.h
--- a/dom/plugins/base/nsPluginTags.cpp
+++ b/dom/plugins/base/nsPluginTags.cpp
@@ -76,16 +76,17 @@ nsPluginTag::nsPluginTag(nsPluginInfo* a
     mCachedBlocklistState(nsIBlocklistService::STATE_NOT_BLOCKED),
     mCachedBlocklistStateValid(false)
 {
   InitMime(aPluginInfo->fMimeTypeArray,
            aPluginInfo->fMimeDescriptionArray,
            aPluginInfo->fExtensionArray,
            aPluginInfo->fVariantCount);
   EnsureMembersAreUTF8();
+  FixupVersion();
 }
 
 nsPluginTag::nsPluginTag(const char* aName,
                          const char* aDescription,
                          const char* aFileName,
                          const char* aFullPath,
                          const char* aVersion,
                          const char* const* aMimeTypes,
@@ -106,16 +107,17 @@ nsPluginTag::nsPluginTag(const char* aNa
     mNiceFileName(),
     mCachedBlocklistState(nsIBlocklistService::STATE_NOT_BLOCKED),
     mCachedBlocklistStateValid(false)
 {
   InitMime(aMimeTypes, aMimeDescriptions, aExtensions,
            static_cast<uint32_t>(aVariants));
   if (!aArgsAreUTF8)
     EnsureMembersAreUTF8();
+  FixupVersion();
 }
 
 nsPluginTag::~nsPluginTag()
 {
   NS_ASSERTION(!mNext, "Risk of exhausting the stack space, bug 486349");
 }
 
 NS_IMPL_ISUPPORTS1(nsPluginTag, nsIPluginTag)
@@ -255,16 +257,25 @@ nsresult nsPluginTag::EnsureMembersAreUT
     for (uint32_t i = 0; i < mMimeDescriptions.Length(); ++i) {
       ConvertToUTF8(decoder, mMimeDescriptions[i]);
     }
   }
   return NS_OK;
 #endif
 }
 
+void nsPluginTag::FixupVersion()
+{
+#if defined(XP_LINUX)
+  if (mIsFlashPlugin) {
+    mVersion.ReplaceChar(',', '.');
+  }
+#endif
+}
+
 NS_IMETHODIMP
 nsPluginTag::GetDescription(nsACString& aDescription)
 {
   aDescription = mDescription;
   return NS_OK;
 }
 
 NS_IMETHODIMP
--- a/dom/plugins/base/nsPluginTags.h
+++ b/dom/plugins/base/nsPluginTags.h
@@ -93,11 +93,12 @@ private:
   uint16_t      mCachedBlocklistState;
   bool          mCachedBlocklistStateValid;
 
   void InitMime(const char* const* aMimeTypes,
                 const char* const* aMimeDescriptions,
                 const char* const* aExtensions,
                 uint32_t aVariantCount);
   nsresult EnsureMembersAreUTF8();
+  void FixupVersion();
 };
 
 #endif // nsPluginTags_h_