XPConnect:Security:XPCNativeWrapper Automation: Difference between revisions

 
(7 intermediate revisions by the same user not shown)
Line 10: Line 10:
** automatically unwrap when appropriate
** automatically unwrap when appropriate
** preserve object equality in JS (== and != but not === and !==)
** preserve object equality in JS (== and != but not === and !==)
** improve performance over the scriped implementation
** improve performance over the scripted implementation
* Optimize the chrome-accesses content test using JS engine changes
* Optimize the chrome-accesses-content test using JS engine changes
** a new GCF_SYSTEM flag for objects
** a new GCF_SYSTEM flag for objects
*** to distinguish chrome from content objects
*** to distinguish chrome from content objects
*** using the one spare bit above the lock bit for objects
*** using the one spare bit above the lock bit for objects
** new JS_IsSystemObject and JS_IsSystemScript APIs
** new JS_IsSystemObject and JS_GetTopScriptFilenameFlags APIs
** new JS_FlagSystemObject and JS_FlagSystemScriptFilename APIs
** new JS_FlagSystemObject and JS_FlagScriptFilenamePrefix APIs
*** JS_FlagSystemScriptFilename allows the embedding to preconfigure script filenames as "system" (chrome, not content)
*** JS_FlagScriptFilenamePrefix allows the embedding to preconfigure script filenames as "system" by setting filename prefixes
*** these filenames are pinned for the life of the JSRuntime
*** these filename prefixes are pinned for the life of the JSRuntime
* Extend our extension model compatibly
* Extend our extension model compatibly
** support extensions sharing content wrappers
** support extensions sharing content wrappers
*** do not risk breaking extensions by imposing automated XPCNativeWrapper
*** do not risk breaking extensions by imposing automated XPCNativeWrapper
*** evangelize extension authors, convert them one by one
*** when enough have converted, we can flip the default wrapper sharing policy
** allow app and extension files to opt into XPCNativeWrapper automation
** allow app and extension files to opt into XPCNativeWrapper automation
** this means a wrapper-sharing policy declaration in the chrome manifest
** this means a wrapper-sharing policy declaration in the chrome manifest
* Open issues
* Resolved issues
** should "system" applied to a script mean has system principals, or wants system XPCNativeWrapper?
** should "system" applied to a script mean has system principals, or wants system XPCNativeWrapper?
** if so, we have enough bits, and IsSystemPrincipal checks can be optimized
** if so, we have enough bits, and HasSystemPrincipal checks can be optimized
** if not, we need another bit, for wrapper sharing policy, per script filename (but not object) as opposed to a fast has-system-principals test
** if not, we need another bit, for wrapper sharing policy, per script filename (but not object) as opposed to a fast has-system-principals test
*** JS_FlagScriptFilenamePrefix can take a flags argument
*** do we want JS_UnflagScriptFilenamePrefix?  do we ever unload chrome?
** the resolution:
*** bsmedberg will support an xpcnativewrappers=yes option in the chrome manifest
*** this will cause chrome to get the XPConnect service and call its new wantXPCNativeWrappers(filenamePrefix) method
*** which will call JS_FlagScriptFilenamePrefix
* Open Issues
** bz may have --enable-extensions=all, is seeing double-auto-reg on every start (I am seeing single, separate bug)
** this leads to a restart with zero live contexts, apparently, and some prefixes are lost
** never to be re-added (although all are added at least twice)
Confirmed users, Bureaucrats and Sysops emeriti
419

edits