Bug 1238137 - Telemetry pings for main thread scrollbar-driven scroll input methods. r=kats

This commit is contained in:
Botond Ballo 2016-02-05 16:21:54 -05:00
parent 096fcf4562
commit 9a4e984984
2 changed files with 16 additions and 0 deletions

View File

@ -22,8 +22,11 @@
#include "nsRepeatService.h"
#include "mozilla/LookAndFeel.h"
#include "mozilla/MouseEvents.h"
#include "mozilla/Telemetry.h"
#include "mozilla/layers/ScrollInputMethods.h"
using namespace mozilla;
using mozilla::layers::ScrollInputMethod;
//
// NS_NewToolbarFrame
@ -167,6 +170,10 @@ nsScrollbarButtonFrame::HandleButtonPress(nsPresContext* aPresContext,
if (!weakFrame.IsAlive()) {
return false;
}
mozilla::Telemetry::Accumulate(mozilla::Telemetry::SCROLL_INPUT_METHODS,
(uint32_t) ScrollInputMethod::MainThreadScrollbarButtonClick);
if (!m) {
sb->MoveToNewPosition();
if (!weakFrame.IsAlive()) {

View File

@ -36,13 +36,16 @@
#include "mozilla/Preferences.h"
#include "mozilla/LookAndFeel.h"
#include "mozilla/MouseEvents.h"
#include "mozilla/Telemetry.h"
#include "mozilla/layers/AsyncDragMetrics.h"
#include "mozilla/layers/InputAPZContext.h"
#include "mozilla/layers/ScrollInputMethods.h"
#include <algorithm>
using namespace mozilla;
using mozilla::layers::AsyncDragMetrics;
using mozilla::layers::InputAPZContext;
using mozilla::layers::ScrollInputMethod;
bool nsSliderFrame::gMiddlePref = false;
int32_t nsSliderFrame::gSnapMultiplier;
@ -513,6 +516,9 @@ nsSliderFrame::HandleEvent(nsPresContext* aPresContext,
return NS_OK;
}
mozilla::Telemetry::Accumulate(mozilla::Telemetry::SCROLL_INPUT_METHODS,
(uint32_t) ScrollInputMethod::MainThreadScrollbarDrag);
// take our current position and subtract the start location
pos -= mDragStart;
bool isMouseOutsideThumb = false;
@ -579,6 +585,9 @@ nsSliderFrame::HandleEvent(nsPresContext* aPresContext,
nsSize thumbSize = thumbFrame->GetSize();
nscoord thumbLength = isHorizontal ? thumbSize.width : thumbSize.height;
mozilla::Telemetry::Accumulate(mozilla::Telemetry::SCROLL_INPUT_METHODS,
(uint32_t) ScrollInputMethod::MainThreadScrollbarTrackClick);
// set it
nsWeakFrame weakFrame(this);
// should aMaySnap be true here?