Bug 1479945: Part 5 - Remove the 'allowbootstrap' directive flag. r?froydnj draft
authorKris Maglione <maglione.k@gmail.com>
Tue, 31 Jul 2018 16:44:52 -0700
changeset 825128 ce865864f71e373d66e12ef8b1969b32f21c63e4
parent 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 5 - Remove the 'allowbootstrap' directive flag. r?froydnj For all intents and purposes, this is now the same as the 'ischrome' flag. MozReview-Commit-ID: 4z4SDs5M8zU
xpcom/components/ManifestParser.cpp
--- a/xpcom/components/ManifestParser.cpp
+++ b/xpcom/components/ManifestParser.cpp
@@ -43,67 +43,65 @@ using namespace mozilla;
 
 struct ManifestDirective
 {
   const char* directive;
   int argc;
 
   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
   // 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)(
     nsChromeRegistry::ManifestProcessingContext& aCx,
     int aLineNo, char* const* aArgv, int aFlags);
 };
 static const ManifestDirective kParsingTable[] = {
   {
-    "manifest",         1, true, true, false,
+    "manifest",         1, true, false,
     &nsComponentManagerImpl::ManifestManifest, nullptr,
   },
   {
-    "component",        2, false, false, false,
+    "component",        2, false, false,
     &nsComponentManagerImpl::ManifestComponent, nullptr,
   },
   {
-    "contract",         2, false, false, false,
+    "contract",         2, false, false,
     &nsComponentManagerImpl::ManifestContract, nullptr,
   },
   {
-    "category",         3, false, false, false,
+    "category",         3, false, false,
     &nsComponentManagerImpl::ManifestCategory, nullptr,
   },
   {
-    "content",          2, true, true,  true,
+    "content",          2, true,  true,
     nullptr, &nsChromeRegistry::ManifestContent,
   },
   {
-    "locale",           3, true, true, false,
+    "locale",           3, true, false,
     nullptr, &nsChromeRegistry::ManifestLocale,
   },
   {
-    "skin",             3, true, true, false,
+    "skin",             3, 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, true, true, false,
+    "override",         2, true, false,
     nullptr, &nsChromeRegistry::ManifestOverride,
   },
   {
-    "resource",         2, true, false, true,
+    "resource",         2, false, true,
     nullptr, &nsChromeRegistry::ManifestResource,
   }
 };
 
 static const char kWhitespace[] = "\t ";
 
 static bool
 IsNewline(char aChar)
@@ -568,17 +566,17 @@ ParseManifest(NSLocationType aType, File
 
     if (!directive) {
       LogMessageWithContext(aFile, line,
                             "Ignoring unrecognized chrome manifest directive '%s'.",
                             token);
       continue;
     }
 
-    if (!directive->allowbootstrap && NS_BOOTSTRAPPED_LOCATION == aType) {
+    if (!directive->ischrome && NS_BOOTSTRAPPED_LOCATION == aType) {
       LogMessageWithContext(aFile, line,
                             "Bootstrapped manifest not allowed to use '%s' directive.",
                             token);
       continue;
     }
 
     NS_ASSERTION(directive->argc < 4, "Need to reset argv array length");
     char* argv[4];