Bug 1238137 - Telemetry pings for main thread autoscrolling. r=mconley
authorBotond Ballo <botond@mozilla.com>
Fri, 05 Feb 2016 18:01:27 -0500
changeset 284393 9ee50c1b09a0bb03f8c835778e832a690105d475
parent 284392 64d7f3c393d0cab3efe7e860130f7dca0da96866
child 284394 6dc1883a7792857976353cfb4e024e04bcbb5188
push id71939
push userbballo@mozilla.com
push dateTue, 16 Feb 2016 19:18:44 +0000
treeherdermozilla-inbound@6dc1883a7792 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1238137
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1238137 - Telemetry pings for main thread autoscrolling. r=mconley
toolkit/content/browser-content.js
--- a/toolkit/content/browser-content.js
+++ b/toolkit/content/browser-content.js
@@ -202,16 +202,19 @@ var ClickEventHandler = {
     }
     if (this._scrolldir != 'NS') {
       var x = this.accelerate(this._screenX, this._startX) * timeCompensation;
       var desiredScrollX = this._scrollErrorX + x;
       actualScrollX = this.roundToZero(desiredScrollX);
       this._scrollErrorX = (desiredScrollX - actualScrollX);
     }
 
+    const kAutoscroll = 15;  // defined in mozilla/layers/ScrollInputMethods.h
+    Services.telemetry.getHistogramById("SCROLL_INPUT_METHODS").add(kAutoscroll);
+
     if (this._scrollable instanceof content.Window) {
       this._scrollable.scrollBy(actualScrollX, actualScrollY);
     } else { // an element with overflow
       this._scrollable.scrollLeft += actualScrollX;
       this._scrollable.scrollTop += actualScrollY;
     }
     content.requestAnimationFrame(this.autoscrollLoop);
   },