From 925ab3694e336266dc1ecdfa59b9fbdce7482638 Mon Sep 17 00:00:00 2001 From: Andrew McCreight Date: Mon, 20 Nov 2023 17:44:21 +0000 Subject: [PATCH] Bug 1859535, part 5 - Turn nsPluginHost into a namespace. r=dom-core,sefeng Only a single static method is used, so turn it from a class into a namespace. Differential Revision: https://phabricator.services.mozilla.com/D191194 --- dom/plugins/base/nsPluginHost.cpp | 4 ---- dom/plugins/base/nsPluginHost.h | 28 +++++++++++----------------- 2 files changed, 11 insertions(+), 21 deletions(-) diff --git a/dom/plugins/base/nsPluginHost.cpp b/dom/plugins/base/nsPluginHost.cpp index da930c2f6711..eeb653361716 100644 --- a/dom/plugins/base/nsPluginHost.cpp +++ b/dom/plugins/base/nsPluginHost.cpp @@ -9,10 +9,6 @@ #include "nsTString.h" -using namespace mozilla; - -NS_IMPL_ISUPPORTS(nsPluginHost, nsISupportsWeakReference) - nsPluginHost::SpecialType nsPluginHost::GetSpecialType( const nsACString& aMIMEType) { if (aMIMEType.LowerCaseEqualsASCII("application/x-test")) { diff --git a/dom/plugins/base/nsPluginHost.h b/dom/plugins/base/nsPluginHost.h index 344b4c492c7a..66c5c5f140c7 100644 --- a/dom/plugins/base/nsPluginHost.h +++ b/dom/plugins/base/nsPluginHost.h @@ -7,25 +7,19 @@ #define nsPluginHost_h_ #include "nsStringFwd.h" -#include "nsWeakReference.h" -class nsPluginHost final : public nsSupportsWeakReference { - virtual ~nsPluginHost() = default; +namespace nsPluginHost { - public: - nsPluginHost() = default; - - NS_DECL_ISUPPORTS - - // checks whether aType is a type we recognize for potential special handling - enum SpecialType { - eSpecialType_None, - // Needed to whitelist for async init support - eSpecialType_Test, - // Informs some decisions about OOP and quirks - eSpecialType_Flash - }; - static SpecialType GetSpecialType(const nsACString& aMIMEType); +// checks whether aType is a type we recognize for potential special handling +enum SpecialType { + eSpecialType_None, + // Needed to whitelist for async init support + eSpecialType_Test, + // Informs some decisions about OOP and quirks + eSpecialType_Flash }; +SpecialType GetSpecialType(const nsACString& aMIMEType); + +} // namespace nsPluginHost #endif // nsPluginHost_h_