Bug 1252617 - Probe to measure when offline error page is shown. r=mfinkle
authorBarbara Bermes <bbermes@mozilla.com>
Wed, 02 Mar 2016 15:36:05 -0500
changeset 287335 893ca601352abf582cb64e1cfbcec68dcc06871a
parent 287334 3071a0f6359d689fa1b17ba657b4f6afbde9399c
child 287336 865dec79d8c1579af2999424822ed1c53d8e9082
push id18082
push userryanvm@gmail.com
push dateWed, 09 Mar 2016 04:24:12 +0000
treeherderfx-team@893ca601352a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs1252617
milestone48.0a1
Bug 1252617 - Probe to measure when offline error page is shown. r=mfinkle
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -4004,22 +4004,31 @@ Tab.prototype = {
           let computedStyle = contentWindow.getComputedStyle(contentDocument.body);
           backgroundColor = computedStyle.backgroundColor;
         } catch (e) {
           // Ignore. Catching and ignoring exceptions here ensures that Talos succeeds.
         }
 
         let docURI = target.documentURI;
         let errorType = "";
-        if (docURI.startsWith("about:certerror"))
+        if (docURI.startsWith("about:certerror")) {
           errorType = "certerror";
-        else if (docURI.startsWith("about:blocked"))
-          errorType = "blocked"
-        else if (docURI.startsWith("about:neterror"))
+        }
+        else if (docURI.startsWith("about:blocked")) {
+          errorType = "blocked";
+        }
+        else if (docURI.startsWith("about:neterror")) {
+          let error = docURI.search(/e\=/);
+          let duffUrl = docURI.search(/\&u\=/);
+          let errorExtra = decodeURIComponent(docURI.slice(error + 2, duffUrl));
+          // Here is a list of errorExtra types (et_*)
+          // http://mxr.mozilla.org/mozilla-central/source/mobile/android/chrome/content/netError.xhtml#287
+          UITelemetry.addEvent("neterror.1", "content", null, errorExtra);
           errorType = "neterror";
+        }
 
         // Attach a listener to watch for "click" events bubbling up from error
         // pages and other similar page. This lets us fix bugs like 401575 which
         // require error page UI to do privileged things, without letting error
         // pages have any privilege themselves.
         if (docURI.startsWith("about:neterror")) {
           NetErrorHelper.attachToBrowser(this.browser);
         }