Bug 858680 - Part 3: Allow mozStorage to access the dbstats virtual table, r=asuth.

This commit is contained in:
Ben Turner 2015-04-30 16:30:57 -07:00
parent a6d03ec2cc
commit 804ea0ac1c
2 changed files with 13 additions and 1 deletions

View File

@ -51,6 +51,7 @@ EXPORTS
sqlite3_create_function16
sqlite3_create_module
sqlite3_data_count
sqlite3_dbstat_register
sqlite3_db_filename
sqlite3_db_handle
sqlite3_db_mutex

View File

@ -62,6 +62,10 @@ PRLogModuleInfo* gStorageLog = nullptr;
#define CHECK_MAINTHREAD_ABUSE() do { /* Nothing */ } while(0)
#endif
extern "C" {
int sqlite3_dbstat_register(sqlite3 *db);
}
namespace mozilla {
namespace storage {
@ -144,7 +148,14 @@ struct Module
};
Module gModules[] = {
{ "filesystem", RegisterFileSystemModule }
{ "filesystem", RegisterFileSystemModule },
{ "dbstat",
[](sqlite3* aDatabase, const char* aName) -> int
{
MOZ_ASSERT(!strcmp(aName, "dbstat"));
return sqlite3_dbstat_register(aDatabase);
}
}
};
////////////////////////////////////////////////////////////////////////////////