Bug 780562 - Remove support for the chrome "platform" flag. r?bsmedberg
Now that the sole use of the flag was removed, remove support for it.
--- a/chrome/nsChromeRegistry.cpp
+++ b/chrome/nsChromeRegistry.cpp
@@ -288,26 +288,16 @@ nsChromeRegistry::ConvertChromeURL(nsIUR
nsIURI* baseURI = GetBaseURIFromPackage(package, provider, path);
uint32_t flags;
rv = GetFlagsFromPackage(package, &flags);
if (NS_FAILED(rv))
return rv;
- if (flags & PLATFORM_PACKAGE) {
-#if defined(XP_WIN)
- path.Insert("win/", 0);
-#elif defined(XP_MACOSX)
- path.Insert("mac/", 0);
-#else
- path.Insert("unix/", 0);
-#endif
- }
-
if (!baseURI) {
LogMessage("No chrome package registered for chrome://%s/%s/%s",
package.get(), provider.get(), path.get());
return NS_ERROR_FILE_NOT_FOUND;
}
return NS_NewURI(aResult, path, nullptr, baseURI);
}
--- a/chrome/nsChromeRegistry.h
+++ b/chrome/nsChromeRegistry.h
@@ -135,20 +135,16 @@ public:
char *const * argv, int flags) = 0;
virtual void ManifestOverride(ManifestProcessingContext& cx, int lineno,
char *const * argv, int flags) = 0;
virtual void ManifestResource(ManifestProcessingContext& cx, int lineno,
char *const * argv, int flags) = 0;
// Available flags
enum {
- // This is a "platform" package (e.g. chrome://global-platform/).
- // Appends one of win/ unix/ mac/ to the base URI.
- PLATFORM_PACKAGE = 1 << 0,
-
// This package should use the new XPCNativeWrappers to separate
// content from chrome. This flag is currently unused (because we call
// into xpconnect at registration time).
XPCNATIVEWRAPPERS = 1 << 1,
// Content script may access files in this package
CONTENT_ACCESSIBLE = 1 << 2,
--- a/xpcom/components/ManifestParser.cpp
+++ b/xpcom/components/ManifestParser.cpp
@@ -51,17 +51,17 @@ struct ManifestDirective
// Some directives should only be delivered for APP or EXTENSION locations.
bool componentonly;
bool ischrome;
bool allowbootstrap;
- // The platform/contentaccessible flags only apply to content directives.
+ // The contentaccessible flags only apply to content directives.
bool contentflags;
// Function to handle this directive. This isn't a union because C++ still
// hasn't learned how to initialize unions in a sane way.
void (nsComponentManagerImpl::*mgrfunc)(
nsComponentManagerImpl::ManifestProcessingContext& aCx,
int aLineNo, char* const* aArgv);
void (nsChromeRegistry::*regfunc)(
@@ -444,17 +444,16 @@ void
ParseManifest(NSLocationType aType, FileLocation& aFile, char* aBuf,
bool aChromeOnly, bool aXPTOnly)
{
nsComponentManagerImpl::ManifestProcessingContext mgrcx(aType, aFile,
aChromeOnly);
nsChromeRegistry::ManifestProcessingContext chromecx(aType, aFile);
nsresult rv;
- NS_NAMED_LITERAL_STRING(kPlatform, "platform");
NS_NAMED_LITERAL_STRING(kContentAccessible, "contentaccessible");
NS_NAMED_LITERAL_STRING(kRemoteEnabled, "remoteenabled");
NS_NAMED_LITERAL_STRING(kRemoteRequired, "remoterequired");
NS_NAMED_LITERAL_STRING(kApplication, "application");
NS_NAMED_LITERAL_STRING(kAppVersion, "appversion");
NS_NAMED_LITERAL_STRING(kGeckoVersion, "platformversion");
NS_NAMED_LITERAL_STRING(kOs, "os");
NS_NAMED_LITERAL_STRING(kOsVersion, "osversion");
@@ -680,21 +679,16 @@ ParseManifest(NSLocationType aType, File
if (CheckFlag(kTablet, wtoken, tablet)) {
stTablet = (tablet == isTablet) ? eOK : eBad;
continue;
}
#endif
if (directive->contentflags) {
bool flag;
- if (CheckFlag(kPlatform, wtoken, flag)) {
- if (flag)
- flags |= nsChromeRegistry::PLATFORM_PACKAGE;
- continue;
- }
if (CheckFlag(kContentAccessible, wtoken, flag)) {
if (flag)
flags |= nsChromeRegistry::CONTENT_ACCESSIBLE;
continue;
}
if (CheckFlag(kRemoteEnabled, wtoken, flag)) {
if (flag)
flags |= nsChromeRegistry::REMOTE_ALLOWED;