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

--HG--
extra : rebase_source : 250bc47337695abb09e926fb8a21e5df72724fe4
This commit is contained in:
Ben Turner 2015-04-30 16:30:57 -07:00
parent b553d50f23
commit c769c6825d
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);
}
}
};
////////////////////////////////////////////////////////////////////////////////