Join MDN and developers like you at Mozilla's View Source conference, 12-14 September in Berlin, Germany. Learn more at https://viewsourceconf.org

mozIStorageVacuumParticipant

Components can implement this interface to provide information to allow a database to be periodically vacuumed by the Storage service.
1.0
28
Introduced
Gecko 2.0
Inherits from: nsISupports Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)

To create an instance of this interface, use the Category Manger, with the category "vacuum-participant".

Add more details here.

Method overview

boolean onBeginVacuum();
void onEndVacuum(in boolean aSucceeded);

Attributes

Attribute Type Description
databaseConnection mozIStorageConnection A connection to the database file to be vacuumed.
expectedDatabasePageSize long

The expected page size, in bytes, for the database. The vacuum manager will try to correct the page size when the browser is idle, using this value as a target. Valid page sizes are in the range 512 to 65,536. The recommended value is mozIStorageConnection::DEFAULT_PAGE_SIZE.

Note: If the database is using the WAL journal node and the current page size is not the expected one, the journal node will be changed to TRUNCATE because WAL doesn't allow page size changes. The vacuum manager will try to restore WAL mode, but this will only work reliably if the participant properly resets statements. If the attempt to restore the journal node fails, it will remain TRUNCATE.

Methods

onBeginVacuum()

Called when a vacuum operation begins. Once you receive this notification, you should avoid using the database until onEndVacuum() is called.

boolean onBeginVacuum();
Parameters

None.

Return value

Return true to allow the vacuum operation to proceed, or false if you don't want the database to be vacuumed. You may wish to return false, for example, if you're in the middle of an operation that you don't want to (or can't) interrupt.

onEndVacuum()

Called when a vacuum operation ends.

void onEndVacuum(
  in boolean aSucceeded
); 
Parameters
aSucceeded
true if the vacuum operation was successful, or false if it wasn't successful.

Document Tags and Contributors

 Contributors to this page: Sheppy
 Last updated by: Sheppy,