mozIStorageVacuumParticipant 编辑

/storage/public/mozIStorageVacuumParticipant.idlScriptable 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

AttributeTypeDescription
databaseConnectionmozIStorageConnectionA connection to the database file to be vacuumed.
expectedDatabasePageSizelong

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:42 次

字数:4049

最后编辑:8 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文