From 90714a58565515db1f716a45675ef73d9a5640e6 Mon Sep 17 00:00:00 2001 From: Michael Pruett Date: Sat, 31 May 2014 13:34:58 -0500 Subject: [PATCH 1/7] Bug 1016039 - Fix switching between tab groups when cursor is on a tab. r=dao --- browser/base/content/tabbrowser.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser/base/content/tabbrowser.xml b/browser/base/content/tabbrowser.xml index 4013a5a6954..6f4558d2187 100644 --- a/browser/base/content/tabbrowser.xml +++ b/browser/base/content/tabbrowser.xml @@ -4723,7 +4723,7 @@ Date: Mon, 2 Jun 2014 12:41:15 -0700 Subject: [PATCH 2/7] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/1bc46e611785 Author: lissyx Desc: Merge pull request #19810 from lissyx/bug1017103 Bug 1017103 - Display no data radio technology when in airplane mode r=timdream ======== https://hg.mozilla.org/integration/gaia-central/rev/50bcd4b3d20b Author: Alexandre Lissy Desc: Bug 1017103 - Display no data radio technology when in airplane mode --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 64d41bd89a3..7803b12dabb 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "e204b914c3ddada45ae5ff5c9fc5e8f55f906ca7", + "revision": "1bc46e6117854554d6172801cd65da1616fed9dd", "repo_path": "/integration/gaia-central" } From 676f89e2f90b2e1417bc274b4bb1faae0e3b1642 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 2 Jun 2014 12:43:11 -0700 Subject: [PATCH 3/7] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index a30e6a5eafe..04969bbd6b0 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index b3de44f864e..93249c46d00 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 757eeb77fe2..511ecda43dd 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index a30e6a5eafe..04969bbd6b0 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 3af0082617f..9a6c07c73ba 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 1fdd6e4cce3..98b9f6a5a13 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 818ad04e1f9..0fd273c768a 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index cefc01d1bad..2a2a9385028 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 2ef97b6571c..b04e326081c 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From c8ecfb6463dfe5bc9764d3c3494f0ceec5fd49af Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 2 Jun 2014 13:21:13 -0700 Subject: [PATCH 4/7] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/fe1d2cacb28a Author: Kevin Grandon Desc: Merge pull request #19881 from KevinGrandon/bug_1009111_collections_into_apps Bug 1009111 - Move dev_apps/collection -> apps/collection ======== https://hg.mozilla.org/integration/gaia-central/rev/b9e8ec28ac2a Author: Kevin Grandon Desc: Bug 1009111 - Move dev_apps/collection -> apps/collection --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 7803b12dabb..d5a6c10ec08 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "1bc46e6117854554d6172801cd65da1616fed9dd", + "revision": "fe1d2cacb28a6876729ebb4315432c9cce2eb797", "repo_path": "/integration/gaia-central" } From 41d2fcf7fa869333be143f28042f5f3bad504005 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 2 Jun 2014 13:26:16 -0700 Subject: [PATCH 5/7] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 04969bbd6b0..bc24917b788 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 93249c46d00..b167d048b21 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 511ecda43dd..c77ad5c8fb0 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 04969bbd6b0..bc24917b788 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 9a6c07c73ba..134003e5f3d 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 98b9f6a5a13..15e6a2562c6 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 0fd273c768a..23423dab055 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 2a2a9385028..782a2a63981 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index b04e326081c..1638d17bb96 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 126a2584310c9c80ecb5b36e8f66592b875ac42d Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 2 Jun 2014 13:48:12 -0700 Subject: [PATCH 6/7] Bumping manifests a=b2g-bump --- b2g/config/flame/sources.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 134003e5f3d..6052aae273b 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -118,7 +118,7 @@ - + From e356eea0331f11a8c7e391f42d5b65f619abed54 Mon Sep 17 00:00:00 2001 From: Richard Newman Date: Mon, 2 Jun 2014 14:17:36 -0700 Subject: [PATCH 7/7] Bug 1017778 - Telemetry probe for home provider database errors. r=margaret --- .../android/base/db/FormHistoryProvider.java | 7 ++ mobile/android/base/db/HomeProvider.java | 6 ++ mobile/android/base/db/PasswordsProvider.java | 7 ++ .../base/db/SQLiteBridgeContentProvider.java | 76 ++++++++++++++++--- toolkit/components/telemetry/Histograms.json | 18 +++++ 5 files changed, 104 insertions(+), 10 deletions(-) diff --git a/mobile/android/base/db/FormHistoryProvider.java b/mobile/android/base/db/FormHistoryProvider.java index f8ead91ef6c..cb23d088dae 100644 --- a/mobile/android/base/db/FormHistoryProvider.java +++ b/mobile/android/base/db/FormHistoryProvider.java @@ -6,6 +6,7 @@ package org.mozilla.gecko.db; import java.lang.IllegalArgumentException; import java.util.HashMap; + import org.mozilla.gecko.GeckoAppShell; import org.mozilla.gecko.GeckoEvent; import org.mozilla.gecko.db.BrowserContract.FormHistory; @@ -33,6 +34,7 @@ public class FormHistoryProvider extends SQLiteBridgeContentProvider { // This should be kept in sync with the db version in toolkit/components/satchel/nsFormHistory.js private static int DB_VERSION = 4; private static String DB_FILENAME = "formhistory.sqlite"; + private static final String TELEMETRY_TAG = "SQLITEBRIDGE_PROVIDER_FORMS"; private static final String WHERE_GUID_IS_NULL = BrowserContract.DeletedFormHistory.GUID + " IS NULL"; private static final String WHERE_GUID_IS_VALUE = BrowserContract.DeletedFormHistory.GUID + " = ?"; @@ -153,6 +155,11 @@ public class FormHistoryProvider extends SQLiteBridgeContentProvider { return DB_FILENAME; } + @Override + protected String getTelemetryPrefix() { + return TELEMETRY_TAG; + } + @Override protected int getDBVersion(){ return DB_VERSION; diff --git a/mobile/android/base/db/HomeProvider.java b/mobile/android/base/db/HomeProvider.java index 9e6e557a5c9..71e5f8b1e7f 100644 --- a/mobile/android/base/db/HomeProvider.java +++ b/mobile/android/base/db/HomeProvider.java @@ -29,6 +29,7 @@ public class HomeProvider extends SQLiteBridgeContentProvider { // This should be kept in sync with the db version in mobile/android/modules/HomeProvider.jsm private static int DB_VERSION = 2; private static String DB_FILENAME = "home.sqlite"; + private static final String TELEMETRY_TAG = "SQLITEBRIDGE_PROVIDER_HOME"; private static final String TABLE_ITEMS = "items"; @@ -144,6 +145,11 @@ public class HomeProvider extends SQLiteBridgeContentProvider { return DB_FILENAME; } + @Override + protected String getTelemetryPrefix() { + return TELEMETRY_TAG; + } + @Override protected int getDBVersion(){ return DB_VERSION; diff --git a/mobile/android/base/db/PasswordsProvider.java b/mobile/android/base/db/PasswordsProvider.java index 1fe93c911c2..ce743bf1880 100644 --- a/mobile/android/base/db/PasswordsProvider.java +++ b/mobile/android/base/db/PasswordsProvider.java @@ -29,6 +29,8 @@ public class PasswordsProvider extends SQLiteBridgeContentProvider { static final String TABLE_PASSWORDS = "moz_logins"; static final String TABLE_DELETED_PASSWORDS = "moz_deleted_logins"; + private static final String TELEMETRY_TAG = "SQLITEBRIDGE_PROVIDER_PASSWORDS"; + private static final int PASSWORDS = 100; private static final int DELETED_PASSWORDS = 101; @@ -91,6 +93,11 @@ public class PasswordsProvider extends SQLiteBridgeContentProvider { return DB_FILENAME; } + @Override + protected String getTelemetryPrefix() { + return TELEMETRY_TAG; + } + @Override protected int getDBVersion(){ return DB_VERSION; diff --git a/mobile/android/base/db/SQLiteBridgeContentProvider.java b/mobile/android/base/db/SQLiteBridgeContentProvider.java index dd71641312e..e5fd82389a2 100644 --- a/mobile/android/base/db/SQLiteBridgeContentProvider.java +++ b/mobile/android/base/db/SQLiteBridgeContentProvider.java @@ -6,14 +6,14 @@ package org.mozilla.gecko.db; import java.io.File; import java.util.HashMap; -import java.util.Collection; -import java.util.Iterator; + import org.mozilla.gecko.GeckoProfile; import org.mozilla.gecko.GeckoThread; -import org.mozilla.gecko.db.BrowserContract; +import org.mozilla.gecko.Telemetry; import org.mozilla.gecko.mozglue.GeckoLoader; import org.mozilla.gecko.sqlite.SQLiteBridge; import org.mozilla.gecko.sqlite.SQLiteBridgeException; + import android.content.ContentProvider; import android.content.ContentUris; import android.content.ContentValues; @@ -35,6 +35,8 @@ import android.util.Log; */ public abstract class SQLiteBridgeContentProvider extends ContentProvider { + private static final String ERROR_MESSAGE_DATABASE_IS_LOCKED = "Can't step statement: (5) database is locked"; + private HashMap mDatabasePerProfile; protected Context mContext = null; private final String mLogTag; @@ -43,6 +45,42 @@ public abstract class SQLiteBridgeContentProvider extends ContentProvider { mLogTag = logTag; } + /** + * Subclasses must override this to allow error reporting code to compose + * the correct histogram name. + * + * Ensure that you define the new histograms if you define a new class! + */ + protected abstract String getTelemetryPrefix(); + + /** + * Errors are recorded in telemetry using an enumerated histogram. + * + * + * + * These are the allowable enumeration values. Keep these in sync with the + * histogram definition! + * + */ + private static enum TelemetryErrorOp { + BULKINSERT (0), + DELETE (1), + INSERT (2), + QUERY (3), + UPDATE (4); + + private final int bucket; + + TelemetryErrorOp(final int bucket) { + this.bucket = bucket; + } + + public int getBucket() { + return bucket; + } + } + @Override public void shutdown() { if (mDatabasePerProfile == null) { @@ -255,7 +293,7 @@ public abstract class SQLiteBridgeContentProvider extends ContentProvider { try { deleted = db.delete(getTable(uri), selection, selectionArgs); } catch (SQLiteBridgeException ex) { - Log.e(mLogTag, "Error deleting record", ex); + reportError(ex, TelemetryErrorOp.DELETE); throw ex; } @@ -291,7 +329,7 @@ public abstract class SQLiteBridgeContentProvider extends ContentProvider { db.setTransactionSuccessful(); } } catch (SQLiteBridgeException ex) { - Log.e(mLogTag, "Error inserting in db", ex); + reportError(ex, TelemetryErrorOp.INSERT); throw ex; } finally { if (useTransaction) { @@ -312,7 +350,6 @@ public abstract class SQLiteBridgeContentProvider extends ContentProvider { return 0; } - long id = -1; int rowsAdded = 0; String table = getTable(uri); @@ -323,12 +360,12 @@ public abstract class SQLiteBridgeContentProvider extends ContentProvider { ContentValues values = new ContentValues(initialValues); setupDefaults(uri, values); onPreInsert(values, uri, db); - id = db.insert(table, null, values); + db.insert(table, null, values); rowsAdded++; } db.setTransactionSuccessful(); } catch (SQLiteBridgeException ex) { - Log.e(mLogTag, "Error inserting in db", ex); + reportError(ex, TelemetryErrorOp.BULKINSERT); throw ex; } finally { db.endTransaction(); @@ -360,7 +397,7 @@ public abstract class SQLiteBridgeContentProvider extends ContentProvider { try { updated = db.update(getTable(uri), values, selection, selectionArgs); } catch (SQLiteBridgeException ex) { - Log.e(mLogTag, "Error updating table", ex); + reportError(ex, TelemetryErrorOp.UPDATE); throw ex; } @@ -386,13 +423,32 @@ public abstract class SQLiteBridgeContentProvider extends ContentProvider { cursor = db.query(getTable(uri), projection, selection, selectionArgs, null, null, sortOrder, null); onPostQuery(cursor, uri, db); } catch (SQLiteBridgeException ex) { - Log.e(mLogTag, "Error querying database", ex); + reportError(ex, TelemetryErrorOp.QUERY); throw ex; } return cursor; } + private String getHistogram(SQLiteBridgeException e) { + // If you add values here, make sure to update + // toolkit/components/telemetry/Histograms.json. + if (ERROR_MESSAGE_DATABASE_IS_LOCKED.equals(e.getMessage())) { + return getTelemetryPrefix() + "_LOCKED"; + } + return null; + } + + protected void reportError(SQLiteBridgeException e, TelemetryErrorOp op) { + Log.e(mLogTag, "Error in database " + op.name(), e); + final String histogram = getHistogram(e); + if (histogram == null) { + return; + } + + Telemetry.HistogramAdd(histogram, op.getBucket()); + } + protected abstract String getDBName(); protected abstract int getDBVersion(); diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json index 357c6b7312c..a3685f93a74 100644 --- a/toolkit/components/telemetry/Histograms.json +++ b/toolkit/components/telemetry/Histograms.json @@ -5908,6 +5908,24 @@ "extended_statistics_ok": true, "description": "Time spent to open an existing cache entry" }, + "SQLITEBRIDGE_PROVIDER_PASSWORDS_LOCKED": { + "expires_in_version": "never", + "kind": "enumerated", + "n_values": "10", + "description": "The number of errors using the PasswordsProvider due to a locked DB." + }, + "SQLITEBRIDGE_PROVIDER_FORMS_LOCKED": { + "expires_in_version": "never", + "kind": "enumerated", + "n_values": "10", + "description": "The number of errors using the FormHistoryProvider due to a locked DB." + }, + "SQLITEBRIDGE_PROVIDER_HOME_LOCKED": { + "expires_in_version": "never", + "kind": "enumerated", + "n_values": "10", + "description": "The number of errors using the HomeProvider due to a locked DB." + }, "SSL_TLS12_INTOLERANCE_REASON_PRE": { "expires_in_version": "never", "kind": "enumerated",