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
This commit is contained in:
Andrew McCreight 2023-11-20 17:44:21 +00:00
parent 2cf7aa1df8
commit 925ab3694e
2 changed files with 11 additions and 21 deletions

View File

@ -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")) {

View File

@ -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_