Bug 1234729 - Add telemetry probe for when we load a page from cache r=sebastian p=margaret
authorMark Finkle <mfinkle@mozilla.com>
Wed, 23 Dec 2015 11:59:11 -0500
changeset 317405 869deb5491192921298b0a1edc0ab3fc17502648
parent 317404 30b9e8aa695d29d815baa2b1f8c05ff2fa10df6a
child 317406 14aea198d5b18b4850801a23c61cbd066bf93f4f
push id8691
push userbmo:vivekb.balakrishnan@gmail.com
push dateWed, 23 Dec 2015 21:07:27 +0000
reviewerssebastian
bugs1234729
milestone46.0a1
Bug 1234729 - Add telemetry probe for when we load a page from cache r=sebastian p=margaret
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -7496,16 +7496,17 @@ var Tabs = {
         // Notify if we are loading a page from cache.
         if (this._useCache) {
           let targetDoc = aEvent.originalTarget;
           let isTopLevel = (targetDoc.defaultView.parent === targetDoc.defaultView);
 
           // Ignore any about: pages, especially about:neterror since it means we failed to find the page in cache.
           let targetURI = targetDoc.documentURI;
           if (isTopLevel && !targetURI.startsWith("about:")) {
+            UITelemetry.addEvent("neterror.1", "toast", null, "usecache");
             Snackbars.show(Strings.browser.GetStringFromName("networkOffline.message"), Snackbars.LENGTH_INDEFINITE);
           }
         }
         break;
       case "TabOpen":
         // Use opening a new tab as a trigger to expire the most stale tab.
         this.expireLruTab();
         break;