Bug 614787 - Delay expiration database setup to the first expiration.

r=dietrich,sdwilsh a=blocking
This commit is contained in:
Marco Bonardo 2010-11-29 21:47:42 +01:00
parent 7d33573bea
commit a3f54fd85f

View File

@ -408,12 +408,16 @@ const EXPIRATION_QUERIES = {
function nsPlacesExpiration()
{
this._db = Cc["@mozilla.org/browser/nav-history-service;1"].
//////////////////////////////////////////////////////////////////////////////
//// Smart Getters
XPCOMUtils.defineLazyGetter(this, "_db", function () {
let db = Cc["@mozilla.org/browser/nav-history-service;1"].
getService(Ci.nsPIPlacesDatabase).
DBConnection;
// Create a temp table for notifications.
this._db.executeSimpleSQL(
// Create the temporary notifications table.
let stmt = db.createAsyncStatement(
"CREATE TEMP TABLE expiration_notify ( "
+ " id INTEGER PRIMARY KEY "
+ ", v_id INTEGER "
@ -421,11 +425,12 @@ function nsPlacesExpiration()
+ ", url TEXT NOT NULL "
+ ", visit_date INTEGER "
+ ", expected_results INTEGER NOT NULL "
+ ")"
);
+ ") ");
stmt.executeAsync();
stmt.finalize();
//////////////////////////////////////////////////////////////////////////////
//// Smart Getters
return db;
});
XPCOMUtils.defineLazyServiceGetter(this, "_hsn",
"@mozilla.org/browser/nav-history-service;1",