mozIStorageVacuumParticipant 编辑
/storage/public/mozIStorageVacuumParticipant.idl
Scriptable Components can implement this interface to provide information to allow a database to be periodically vacuumed by the Storage service. 1.0 66 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 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, orfalse
if it wasn't successful.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论