Bug 780562 - Remove support for the chrome "platform" flag. r=bsmedberg
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 14 Apr 2017 20:48:53 +0900
changeset 409114 82edbfe72c47d736a604612fab8d7ebc417e6105
parent 409113 c94e87a18096092f475074bafeb4fe61c21d2600
child 409115 7c0bd165daf4943618ee6eac5b6344c1fc22af5c
push id1490
push usermtabara@mozilla.com
push dateMon, 31 Jul 2017 14:08:16 +0000
treeherdermozilla-release@70e32e6bf15e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs780562
milestone55.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 780562 - Remove support for the chrome "platform" flag. r=bsmedberg Now that the sole use of the flag was removed, remove support for it.
chrome/nsChromeRegistry.cpp
chrome/nsChromeRegistry.h
xpcom/components/ManifestParser.cpp
--- 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
@@ -131,20 +131,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;