Bug 1479945: Part 3 - Remove support for apponly directive flag. r?froydnj draft
authorKris Maglione <maglione.k@gmail.com>
Tue, 31 Jul 2018 16:38:27 -0700
changeset 825126 9d2eec67ad73be302b0520d98fc4ab0045fb7292
parent 825125 4eaa7403778cc0bc2e789726e660758a5cd8c3e7
child 825127 1bb7d10416ee213903263201239b7ed78460225a
push id118032
push usermaglione.k@gmail.com
push dateTue, 31 Jul 2018 23:45:47 +0000
reviewersfroydnj
bugs1479945
milestone63.0a1
Bug 1479945: Part 3 - Remove support for apponly directive flag. r?froydnj This is unused now that binary component support has been removed. MozReview-Commit-ID: KHTsF4sSoZX
xpcom/components/ManifestParser.cpp
--- a/xpcom/components/ManifestParser.cpp
+++ b/xpcom/components/ManifestParser.cpp
@@ -41,19 +41,16 @@
 
 using namespace mozilla;
 
 struct ManifestDirective
 {
   const char* directive;
   int argc;
 
-  // Binary components are only allowed for APP locations.
-  bool apponly;
-
   bool ischrome;
 
   bool allowbootstrap;
 
   // The contentaccessible flags only apply to content/resource directives.
   bool contentflags;
 
   // Function to handle this directive. This isn't a union because C++ still
@@ -64,51 +61,51 @@ struct ManifestDirective
   void (nsChromeRegistry::*regfunc)(
     nsChromeRegistry::ManifestProcessingContext& aCx,
     int aLineNo, char* const* aArgv, int aFlags);
 
   bool isContract;
 };
 static const ManifestDirective kParsingTable[] = {
   {
-    "manifest",         1, false, true, true, false,
+    "manifest",         1, true, true, false,
     &nsComponentManagerImpl::ManifestManifest, nullptr,
   },
   {
-    "component",        2, false, false, false, false,
+    "component",        2, false, false, false,
     &nsComponentManagerImpl::ManifestComponent, nullptr,
   },
   {
-    "contract",         2, false, false, false, false,
+    "contract",         2, false, false, false,
     &nsComponentManagerImpl::ManifestContract, nullptr,
   },
   {
-    "category",         3, false, false, false, false,
+    "category",         3, false, false, false,
     &nsComponentManagerImpl::ManifestCategory, nullptr,
   },
   {
-    "content",          2, false, true, true,  true,
+    "content",          2, true, true,  true,
     nullptr, &nsChromeRegistry::ManifestContent,
   },
   {
-    "locale",           3, false, true, true, false,
+    "locale",           3, true, true, false,
     nullptr, &nsChromeRegistry::ManifestLocale,
   },
   {
-    "skin",             3, false, true, true, false,
+    "skin",             3, true, true, false,
     nullptr, &nsChromeRegistry::ManifestSkin,
   },
   {
     // NB: note that while skin manifests can use this, they are only allowed
     // to use it for chrome://../skin/ URLs
-    "override",         2, false, true, true, false,
+    "override",         2, true, true, false,
     nullptr, &nsChromeRegistry::ManifestOverride,
   },
   {
-    "resource",         2, false, true, false, true,
+    "resource",         2, true, false, true,
     nullptr, &nsChromeRegistry::ManifestResource,
   }
 };
 
 static const char kWhitespace[] = "\t ";
 
 static bool
 IsNewline(char aChar)
@@ -580,24 +577,16 @@ ParseManifest(NSLocationType aType, File
 
     if (!directive->allowbootstrap && NS_BOOTSTRAPPED_LOCATION == aType) {
       LogMessageWithContext(aFile, line,
                             "Bootstrapped manifest not allowed to use '%s' directive.",
                             token);
       continue;
     }
 
-#ifndef MOZ_BINARY_EXTENSIONS
-    if (directive->apponly && NS_APP_LOCATION != aType) {
-      LogMessageWithContext(aFile, line,
-                            "Only application manifests may use the '%s' directive.", token);
-      continue;
-    }
-#endif
-
     NS_ASSERTION(directive->argc < 4, "Need to reset argv array length");
     char* argv[4];
     for (int i = 0; i < directive->argc; ++i) {
       argv[i] = nsCRT::strtok(whitespace, kWhitespace, &whitespace);
     }
 
     if (!argv[directive->argc - 1]) {
       LogMessageWithContext(aFile, line,