Extension Manager:API Rewrite: Difference between revisions

Line 21: Line 21:
Some types of add-ons may require restarts for certain operations. XPI style extensions for example require restarts for almost all operations. The API exposes the operations that are pending in the pendingOperations property. It is also possible that this property may be used to indicate operations that have been deferred for any reason, maybe timing issues, maybe a dependency is pending install. Pending operations can make it hard to tell what state an actual add-on is in. To help solve this the isActive property indicates whether the add-on is currently active. This is separate to and may be different to the various userDisabled, isCompatible and other properties that indicate whether an add-on can be active or not.
Some types of add-ons may require restarts for certain operations. XPI style extensions for example require restarts for almost all operations. The API exposes the operations that are pending in the pendingOperations property. It is also possible that this property may be used to indicate operations that have been deferred for any reason, maybe timing issues, maybe a dependency is pending install. Pending operations can make it hard to tell what state an actual add-on is in. To help solve this the isActive property indicates whether the add-on is currently active. This is separate to and may be different to the various userDisabled, isCompatible and other properties that indicate whether an add-on can be active or not.


'''It is currently undecided whether Addon objects are truly live views or not. There are a few options with pros and cons'''
''It is currently undecided whether Addon objects are truly live views or not. There are a few options with pros and cons''


;Totally live :Here the Addon object's properties are always guaranteed to be up to date. There are really only two ways to do this, either a property access ends up as a database query or we cache every Addon object retrieved through the API and make sure that is up to date. The former is a problem since we want to avoid synchronous database queries and making all property accesses asynch would be wrong. The latter is a potential memory concern perhaps mitigated if we could get some weak reference support into JS.
;Totally live :Here the Addon object's properties are always guaranteed to be up to date. There are really only two ways to do this, either a property access ends up as a database query or we cache every Addon object retrieved through the API and make sure that is up to date. The former is a problem since we want to avoid synchronous database queries and making all property accesses asynch would be wrong. The latter is a potential memory concern perhaps mitigated if we could get some weak reference support into JS.
canmove, Confirmed users
1,570

edits