Bug 1416066 - Update script_cache.py to support new version of startup script cache file. draft
authorimjching <jlim@mozilla.com>
Tue, 26 Jun 2018 14:02:22 -0400
changeset 816183 1ffee79fd37be72c5933d3c7a4ca7503696b2d38
parent 816182 89bd706495f2a5dc0405657130b5e80a712dac4a
child 816184 4cb4330e391e791d9fa0ac8dd03183277381d06c
push id115768
push userbmo:jlim@mozilla.com
push dateTue, 10 Jul 2018 17:22:49 +0000
bugs1416066
milestone63.0a1
Bug 1416066 - Update script_cache.py to support new version of startup script cache file. MozReview-Commit-ID: IuNZ3kjLcak
js/xpconnect/loader/script_cache.py
--- a/js/xpconnect/loader/script_cache.py
+++ b/js/xpconnect/loader/script_cache.py
@@ -1,38 +1,41 @@
 #!/usr/bin/env python
 import io
 import os
 import struct
 import sys
 
-MAGIC = b'mozXDRcachev001\0'
+MAGIC = b'mozXDRcachev002\0'
 
 
 def usage():
     print("""Usage: script_cache.py <file.bin> ...
 
         Decodes and prints out the contents of a startup script cache file
         (e.g., startupCache/scriptCache.bin) in human-readable form.""")
 
     sys.exit(1)
 
 
 class ProcessTypes:
-    Default = 0
-    Web = 1
-    Extension = 2
-    Privileged = 3
+    Uninitialized = 0
+    Parent = 1
+    Web = 2
+    Extension = 3
+    Privileged = 4
 
     def __init__(self, val):
         self.val = val
 
     def __str__(self):
         res = []
-        if self.val & (1 << self.Default):
+        if self.val & (1 << self.Uninitialized):
+            raise Exception('Uninitialized process type')
+        if self.val & (1 << self.Parent):
             res.append('Parent')
         if self.val & (1 << self.Web):
             res.append('Web')
         if self.val & (1 << self.Extension):
             res.append('Extension')
         if self.val & (1 << self.Privileged):
             res.append('Privileged')
         return '|'.join(res)