Bug 702559 - Adapting FHR to mozIStorageAsyncConnection-based Sqlite.jsm;r=gps
☠☠ backed out by 0cd729c9f1a4 ☠ ☠
authorDavid Rajchenbach-Teller <dteller@mozilla.com>
Wed, 26 Jun 2013 05:45:50 -0400
changeset 136501 562c3fe054e5f61c49e3b1bd29ee27d4f06dba4a
parent 136500 a01ced6de845bfdbf79c0ef443859a0379181927
child 136502 e99cc9801ae1bc39533daf38922ba355436466b2
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersgps
bugs702559
milestone25.0a1
Bug 702559 - Adapting FHR to mozIStorageAsyncConnection-based Sqlite.jsm;r=gps
services/metrics/storage.jsm
services/metrics/tests/xpcshell/test_metrics_storage.js
--- a/services/metrics/storage.jsm
+++ b/services/metrics/storage.jsm
@@ -1158,26 +1158,26 @@ MetricsStorageSqliteBackend.prototype = 
         // loss.
         yield self._connection.execute("PRAGMA synchronous=FULL");
       }
 
       let doCheckpoint = false;
 
       // 1. Create the schema.
       yield self._connection.executeTransaction(function ensureSchema(conn) {
-        let schema = conn.schemaVersion;
+        let schema = yield conn.getSchemaVersion();
 
         if (schema == 0) {
           self._log.info("Creating database schema.");
 
           for (let k of self._SCHEMA_STATEMENTS) {
             yield self._connection.execute(SQL[k]);
           }
 
-          self._connection.schemaVersion = 1;
+          yield self._connection.setSchemaVersion(1);
           doCheckpoint = true;
         } else if (schema != 1) {
           throw new Error("Unknown database schema: " + schema);
         } else {
           self._log.debug("Database schema up to date.");
         }
       });
 
--- a/services/metrics/tests/xpcshell/test_metrics_storage.js
+++ b/services/metrics/tests/xpcshell/test_metrics_storage.js
@@ -75,17 +75,17 @@ add_task(function test_reconnect() {
   yield backend.close();
 
   let backend2 = yield Metrics.Storage("reconnect");
   yield backend2.close();
 });
 
 add_task(function test_future_schema_errors() {
   let backend = yield Metrics.Storage("future_schema_errors");
-  backend._connection.schemaVersion = 2;
+  yield backend._connection.setSchemaVersion(2);
   yield backend.close();
 
   let backend2;
   let failed = false;
   try {
     backend2 = yield Metrics.Storage("future_schema_errors");
   } catch (ex) {
     failed = true;