Skip to content

Commit

Permalink
Bug 858680 - Part 3: Allow mozStorage to access the dbstats virtual t…
Browse files Browse the repository at this point in the history
…able, r=asuth.
  • Loading branch information
benturner committed Apr 30, 2015
1 parent 5e7ae73 commit d99742b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions db/sqlite3/src/sqlite.def
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 12 additions & 1 deletion storage/mozStorageConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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);
}
}
};

////////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit d99742b

Please sign in to comment.