Bug 1335365 - Add telemetry to see if we can remove moz-only XHR.reponseType. r=smaug, data-review=bsmedberg, a=jcristau
authorAndrea Marchesini <amarchesini@mozilla.com>
Tue, 31 Jan 2017 17:34:08 +0100
changeset 366837 8f077c42aed8e4cd8fab03ecfbd2b0833bc66557
parent 366836 eaaf5c7cf8ecc8e7855091e40ec91ef032416e6e
child 366838 933c8878910eb265fab7395692ede33c76bbb807
push id6863
push userryanvm@gmail.com
push dateWed, 01 Feb 2017 23:58:31 +0000
treeherdermozilla-beta@227c1ff7e0fa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, jcristau
bugs1335365
milestone52.0
Bug 1335365 - Add telemetry to see if we can remove moz-only XHR.reponseType. r=smaug, data-review=bsmedberg, a=jcristau
dom/xhr/XMLHttpRequestMainThread.cpp
toolkit/components/telemetry/Histograms.json
--- a/dom/xhr/XMLHttpRequestMainThread.cpp
+++ b/dom/xhr/XMLHttpRequestMainThread.cpp
@@ -752,16 +752,25 @@ XMLHttpRequestMainThread::SetResponseTyp
 
   if (mFlagSynchronous &&
       (aResponseType == XMLHttpRequestResponseType::Moz_chunked_text ||
        aResponseType == XMLHttpRequestResponseType::Moz_chunked_arraybuffer)) {
     aRv.Throw(NS_ERROR_DOM_INVALID_STATE_XHR_CHUNKED_RESPONSETYPES_UNSUPPORTED_FOR_SYNC);
     return;
   }
 
+  // We want to get rid of this moz-only types. Bug 1335365.
+  if (aResponseType == XMLHttpRequestResponseType::Moz_blob) {
+    Telemetry::Accumulate(Telemetry::MOZ_BLOB_IN_XHR, 1);
+  } else if (aResponseType == XMLHttpRequestResponseType::Moz_chunked_text) {
+    Telemetry::Accumulate(Telemetry::MOZ_CHUNKED_TEXT_IN_XHR, 1);
+  } else if (aResponseType == XMLHttpRequestResponseType::Moz_chunked_arraybuffer) {
+    Telemetry::Accumulate(Telemetry::MOZ_CHUNKED_ARRAYBUFFER_IN_XHR, 1);
+  }
+
   // Set the responseType attribute's value to the given value.
   mResponseType = aResponseType;
 }
 
 NS_IMETHODIMP
 XMLHttpRequestMainThread::GetResponse(JSContext *aCx, JS::MutableHandle<JS::Value> aResult)
 {
   ErrorResult rv;
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -10882,10 +10882,34 @@
   "TIME_TO_NON_BLANK_PAINT_MS": {
     "alert_emails": ["hkirschner@mozilla.com"],
     "expires_in_version": "55",
     "kind": "exponential",
     "high": 100000,
     "n_buckets": 100,
     "bug_numbers": [1307242],
     "description": "The time between navigation start and the first non-blank paint of a foreground root content document, in milliseconds. This only records documents that were in an active docshell throughout the whole time between navigation start and non-blank paint. The non-blank paint timestamp is taken during display list building and does not include rasterization or compositing of that paint."
+  },
+  "MOZ_BLOB_IN_XHR": {
+    "alert_emails": ["amarchesini@mozilla.com"],
+    "expires_in_version": "58",
+    "kind": "boolean",
+    "bug_numbers": [1335365],
+    "releaseChannelCollection": "opt-out",
+    "description": "XMLHttpRequest.responseType set to moz-blob"
+  },
+  "MOZ_CHUNKED_TEXT_IN_XHR": {
+    "alert_emails": ["amarchesini@mozilla.com"],
+    "expires_in_version": "58",
+    "kind": "boolean",
+    "bug_numbers": [1335365],
+    "releaseChannelCollection": "opt-out",
+    "description": "XMLHttpRequest.responseType set to moz-chunked-text"
+  },
+  "MOZ_CHUNKED_ARRAYBUFFER_IN_XHR": {
+    "alert_emails": ["amarchesini@mozilla.com"],
+    "expires_in_version": "58",
+    "kind": "boolean",
+    "bug_numbers": [1335365],
+    "releaseChannelCollection": "opt-out",
+    "description": "XMLHttpRequest.responseType set to moz-chunked-arraybuffer"
   }
 }