Bug 1416066 - Update script_cache.py to support new version of startup script cache file.
MozReview-Commit-ID: IuNZ3kjLcak
--- 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)