Bug 1425686 - Remove scroll input methods telemetry code. r=kats

MozReview-Commit-ID: 1PC4826SMvh

--HG--
extra : rebase_source : 0123b921159864518e92077dd81d5185816e063a
This commit is contained in:
Botond Ballo 2017-12-20 15:16:18 -05:00
Родитель d0dc09b759
Коммит 7e42a77d38
13 изменённых файлов: 0 добавлений и 211 удалений

Просмотреть файл

@ -72,7 +72,6 @@
#include "mozilla/dom/SelectionBinding.h"
#include "mozilla/AsyncEventDispatcher.h"
#include "mozilla/Telemetry.h"
#include "mozilla/layers/ScrollInputMethods.h"
#include "nsViewManager.h"
#include "nsFocusManager.h"
@ -80,7 +79,6 @@
using namespace mozilla;
using namespace mozilla::dom;
using mozilla::layers::ScrollInputMethod;
//#define DEBUG_TABLE 1
@ -3677,11 +3675,6 @@ Selection::ScrollIntoView(SelectionRegion aRegion,
flags |= nsIPresShell::SCROLL_OVERFLOW_HIDDEN;
}
if (aFlags & Selection::SCROLL_FOR_CARET_MOVE) {
mozilla::Telemetry::Accumulate(mozilla::Telemetry::SCROLL_INPUT_METHODS,
(uint32_t) ScrollInputMethod::MainThreadScrollCaretIntoView);
}
presShell->ScrollFrameRectIntoView(frame, rect, aVertical, aHorizontal,
flags);
return NS_OK;

Просмотреть файл

@ -47,11 +47,9 @@
#include "nsFrameSelection.h"
#include "mozilla/ErrorResult.h"
#include "mozilla/Telemetry.h"
#include "mozilla/layers/ScrollInputMethods.h"
using namespace mozilla;
using namespace mozilla::dom;
using mozilla::layers::ScrollInputMethod;
class MOZ_STACK_CLASS ValueSetter
{
@ -669,9 +667,6 @@ nsTextInputSelectionImpl::CompleteScroll(bool aForward)
if (!mScrollFrame)
return NS_ERROR_NOT_INITIALIZED;
mozilla::Telemetry::Accumulate(mozilla::Telemetry::SCROLL_INPUT_METHODS,
(uint32_t) ScrollInputMethod::MainThreadCompleteScroll);
mScrollFrame->ScrollBy(nsIntPoint(0, aForward ? 1 : -1),
nsIScrollableFrame::WHOLE,
nsIScrollableFrame::INSTANT);
@ -724,9 +719,6 @@ nsTextInputSelectionImpl::ScrollPage(bool aForward)
if (!mScrollFrame)
return NS_ERROR_NOT_INITIALIZED;
mozilla::Telemetry::Accumulate(mozilla::Telemetry::SCROLL_INPUT_METHODS,
(uint32_t) ScrollInputMethod::MainThreadScrollPage);
mScrollFrame->ScrollBy(nsIntPoint(0, aForward ? 1 : -1),
nsIScrollableFrame::PAGES,
nsIScrollableFrame::SMOOTH);
@ -739,9 +731,6 @@ nsTextInputSelectionImpl::ScrollLine(bool aForward)
if (!mScrollFrame)
return NS_ERROR_NOT_INITIALIZED;
mozilla::Telemetry::Accumulate(mozilla::Telemetry::SCROLL_INPUT_METHODS,
(uint32_t) ScrollInputMethod::MainThreadScrollLine);
mScrollFrame->ScrollBy(nsIntPoint(0, aForward ? 1 : -1),
nsIScrollableFrame::LINES,
nsIScrollableFrame::SMOOTH);
@ -754,9 +743,6 @@ nsTextInputSelectionImpl::ScrollCharacter(bool aRight)
if (!mScrollFrame)
return NS_ERROR_NOT_INITIALIZED;
mozilla::Telemetry::Accumulate(mozilla::Telemetry::SCROLL_INPUT_METHODS,
(uint32_t) ScrollInputMethod::MainThreadScrollCharacter);
mScrollFrame->ScrollBy(nsIntPoint(aRight ? 1 : -1, 0),
nsIScrollableFrame::LINES,
nsIScrollableFrame::SMOOTH);

Просмотреть файл

@ -59,7 +59,6 @@
#include "mozilla/layers/DirectionUtils.h" // for GetAxis{Start,End,Length,Scale}
#include "mozilla/layers/LayerTransactionParent.h" // for LayerTransactionParent
#include "mozilla/layers/MetricsSharingController.h" // for MetricsSharingController
#include "mozilla/layers/ScrollInputMethods.h" // for ScrollInputMethod
#include "mozilla/mozalloc.h" // for operator new, etc
#include "mozilla/Unused.h" // for unused
#include "mozilla/FloatingPoint.h" // for FuzzyEquals*
@ -930,9 +929,6 @@ nsEventStatus AsyncPanZoomController::HandleDragEvent(const MouseInput& aEvent,
MOZ_ASSERT(thumbData.mDirection.isSome());
ScrollDirection direction = *thumbData.mDirection;
mozilla::Telemetry::Accumulate(mozilla::Telemetry::SCROLL_INPUT_METHODS,
(uint32_t) ScrollInputMethod::ApzScrollbarDrag);
bool isMouseAwayFromThumb = false;
if (int snapMultiplier = gfxPrefs::SliderSnapMultiplier()) {
// It's fine to ignore the async component of the thumb's transform,
@ -1741,40 +1737,9 @@ AsyncPanZoomController::GetScrollWheelDelta(const ScrollWheelInput& aEvent) cons
return delta;
}
static
void ReportKeyboardScrollAction(const KeyboardScrollAction& aAction)
{
ScrollInputMethod scrollMethod;
switch (aAction.mType) {
case KeyboardScrollAction::eScrollLine: {
scrollMethod = ScrollInputMethod::ApzScrollLine;
break;
}
case KeyboardScrollAction::eScrollCharacter: {
scrollMethod = ScrollInputMethod::ApzScrollCharacter;
break;
}
case KeyboardScrollAction::eScrollPage: {
scrollMethod = ScrollInputMethod::ApzScrollPage;
break;
}
case KeyboardScrollAction::eScrollComplete: {
scrollMethod = ScrollInputMethod::ApzCompleteScroll;
break;
}
}
mozilla::Telemetry::Accumulate(mozilla::Telemetry::SCROLL_INPUT_METHODS,
(uint32_t)scrollMethod);
}
nsEventStatus
AsyncPanZoomController::OnKeyboard(const KeyboardInput& aEvent)
{
// Report the type of scroll action to telemetry
ReportKeyboardScrollAction(aEvent.mAction);
// Mark that this APZC has async key scrolled
mTestHasAsyncKeyScrolled = true;
@ -2010,24 +1975,6 @@ void AsyncPanZoomController::DoDelayedRequestContentRepaint()
mPinchPaintTimerSet = false;
}
static ScrollInputMethod
ScrollInputMethodForWheelDeltaType(ScrollWheelInput::ScrollDeltaType aDeltaType)
{
switch (aDeltaType) {
case ScrollWheelInput::SCROLLDELTA_LINE: {
return ScrollInputMethod::ApzWheelLine;
}
case ScrollWheelInput::SCROLLDELTA_PAGE: {
return ScrollInputMethod::ApzWheelPage;
}
case ScrollWheelInput::SCROLLDELTA_PIXEL: {
return ScrollInputMethod::ApzWheelPixel;
}
}
MOZ_ASSERT_UNREACHABLE("Invalid value");
return ScrollInputMethod::ApzWheelLine;
}
static void
AdjustDeltaForAllowedScrollDirections(
ParentLayerPoint& aDelta,
@ -2068,10 +2015,6 @@ nsEventStatus AsyncPanZoomController::OnScrollWheel(const ScrollWheelInput& aEve
return nsEventStatus_eIgnore;
}
mozilla::Telemetry::Accumulate(mozilla::Telemetry::SCROLL_INPUT_METHODS,
(uint32_t) ScrollInputMethodForWheelDeltaType(aEvent.mDeltaType));
switch (aEvent.mScrollMode) {
case ScrollWheelInput::SCROLLMODE_INSTANT: {
@ -2275,9 +2218,6 @@ nsEventStatus AsyncPanZoomController::OnPan(const PanGestureInput& aEvent, bool
HandlePanningUpdate(physicalPanDisplacement);
mozilla::Telemetry::Accumulate(mozilla::Telemetry::SCROLL_INPUT_METHODS,
(uint32_t) ScrollInputMethod::ApzPanGesture);
ScreenPoint panDistance(fabs(physicalPanDisplacement.x), fabs(physicalPanDisplacement.y));
OverscrollHandoffState handoffState(
*GetCurrentPanGestureBlock()->GetOverscrollHandoffChain(),
@ -3006,8 +2946,6 @@ void AsyncPanZoomController::TrackTouch(const MultiTouchInput& aEvent) {
UpdateWithTouchAtDevicePoint(aEvent);
if (prevTouchPoint != touchPoint) {
mozilla::Telemetry::Accumulate(mozilla::Telemetry::SCROLL_INPUT_METHODS,
(uint32_t) ScrollInputMethod::ApzTouch);
MOZ_ASSERT(GetCurrentTouchBlock());
OverscrollHandoffState handoffState(
*GetCurrentTouchBlock()->GetOverscrollHandoffChain(),

Просмотреть файл

@ -10,7 +10,6 @@
#include "AsyncPanZoomController.h"
#include "mozilla/Telemetry.h" // for Telemetry
#include "mozilla/layers/ScrollInputMethods.h" // for ScrollInputMethod
namespace mozilla {
namespace layers {
@ -46,9 +45,6 @@ AutoscrollAnimation::DoSample(FrameMetrics& aFrameMetrics, const TimeDuration& a
return false;
}
Telemetry::Accumulate(Telemetry::SCROLL_INPUT_METHODS,
(uint32_t) ScrollInputMethod::ApzAutoscrolling);
ScreenPoint mouseLocation = treeManager->GetCurrentMousePosition();
// The implementation of this function closely mirrors that of its main-

Просмотреть файл

@ -1,78 +0,0 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_layers_ScrollInputMethods_h
#define mozilla_layers_ScrollInputMethods_h
namespace mozilla {
namespace layers {
/**
* An enumeration that lists various input methods used to trigger scrolling.
* Used as the values for the SCROLL_INPUT_METHODS telemetry histogram.
*/
enum class ScrollInputMethod {
// === Driven by APZ ===
ApzTouch, // touch events
ApzWheelPixel, // wheel events, pixel scrolling mode
ApzWheelLine, // wheel events, line scrolling mode
ApzWheelPage, // wheel events, page scrolling mode
ApzPanGesture, // pan gesture events (generally triggered by trackpad)
ApzScrollbarDrag, // dragging the scrollbar
// === Driven by the main thread ===
// Keyboard
MainThreadScrollLine, // line scrolling
// (generally triggered by up/down arrow keys)
MainThreadScrollCharacter, // character scrolling
// (generally triggered by left/right arrow keys)
MainThreadScrollPage, // page scrolling
// (generally triggered by PageUp/PageDown keys)
MainThreadCompleteScroll, // scrolling to the end of the scroll range
// (generally triggered by Home/End keys)
MainThreadScrollCaretIntoView, // scrolling to bring the caret into view
// after moving the caret via the keyboard
// Touch
MainThreadTouch, // touch events
// Scrollbar
MainThreadScrollbarDrag, // dragging the scrollbar
MainThreadScrollbarButtonClick, // clicking the buttons at the ends of the
// scrollback track
MainThreadScrollbarTrackClick, // clicking the scrollbar track above or
// below the thumb
// Autoscrolling
MainThreadAutoscrolling, // autoscrolling
// === Additional input methods implemented in APZ ===
// Async Keyboard
ApzScrollLine, // line scrolling
// (generally triggered by up/down arrow keys)
ApzScrollCharacter, // character scrolling
// (generally triggered by left/right arrow keys)
ApzScrollPage, // page scrolling
// (generally triggered by PageUp/PageDown keys)
ApzCompleteScroll, // scrolling to the end of the scroll range
// (generally triggered by Home/End keys)
// Autoscrolling
ApzAutoscrolling,
// New input methods can be added at the end, up to a maximum of 64.
// They should only be added at the end, to preserve the numerical values
// of the existing enumerators.
};
} // namespace layers
} // namespace mozilla
#endif /* mozilla_layers_ScrollInputMethods_h */

Просмотреть файл

@ -116,7 +116,6 @@ EXPORTS.mozilla.layers += [
'apz/util/ContentProcessController.h',
'apz/util/DoubleTapToZoom.h',
'apz/util/InputAPZContext.h',
'apz/util/ScrollInputMethods.h',
'apz/util/ScrollLinkedEffectDetector.h',
'apz/util/TouchActionHelper.h',
'AsyncCanvasRenderer.h',

Просмотреть файл

@ -178,7 +178,6 @@
#include "nsQueryObject.h"
#include "nsLayoutStylesheetCache.h"
#include "mozilla/layers/InputAPZContext.h"
#include "mozilla/layers/ScrollInputMethods.h"
#include "mozilla/layers/FocusTarget.h"
#include "nsStyleSet.h"
#include "mozilla/StyleSetHandle.h"
@ -2327,8 +2326,6 @@ PresShell::ScrollPage(bool aForward)
nsIScrollableFrame* scrollFrame =
GetScrollableFrameToScroll(nsIPresShell::eVertical);
if (scrollFrame) {
mozilla::Telemetry::Accumulate(mozilla::Telemetry::SCROLL_INPUT_METHODS,
(uint32_t) ScrollInputMethod::MainThreadScrollPage);
scrollFrame->ScrollBy(nsIntPoint(0, aForward ? 1 : -1),
nsIScrollableFrame::PAGES,
nsIScrollableFrame::SMOOTH,
@ -2345,9 +2342,6 @@ PresShell::ScrollLine(bool aForward)
nsIScrollableFrame* scrollFrame =
GetScrollableFrameToScroll(nsIPresShell::eVertical);
if (scrollFrame) {
mozilla::Telemetry::Accumulate(mozilla::Telemetry::SCROLL_INPUT_METHODS,
(uint32_t) ScrollInputMethod::MainThreadScrollLine);
int32_t lineCount = Preferences::GetInt("toolkit.scrollbox.verticalScrollDistance",
NS_DEFAULT_VERTICAL_SCROLL_DISTANCE);
scrollFrame->ScrollBy(nsIntPoint(0, aForward ? lineCount : -lineCount),
@ -2366,8 +2360,6 @@ PresShell::ScrollCharacter(bool aRight)
nsIScrollableFrame* scrollFrame =
GetScrollableFrameToScroll(nsIPresShell::eHorizontal);
if (scrollFrame) {
mozilla::Telemetry::Accumulate(mozilla::Telemetry::SCROLL_INPUT_METHODS,
(uint32_t) ScrollInputMethod::MainThreadScrollCharacter);
int32_t h = Preferences::GetInt("toolkit.scrollbox.horizontalScrollDistance",
NS_DEFAULT_HORIZONTAL_SCROLL_DISTANCE);
scrollFrame->ScrollBy(nsIntPoint(aRight ? h : -h, 0),
@ -2386,8 +2378,6 @@ PresShell::CompleteScroll(bool aForward)
nsIScrollableFrame* scrollFrame =
GetScrollableFrameToScroll(nsIPresShell::eVertical);
if (scrollFrame) {
mozilla::Telemetry::Accumulate(mozilla::Telemetry::SCROLL_INPUT_METHODS,
(uint32_t) ScrollInputMethod::MainThreadCompleteScroll);
scrollFrame->ScrollBy(nsIntPoint(0, aForward ? 1 : -1),
nsIScrollableFrame::WHOLE,
nsIScrollableFrame::SMOOTH,

Просмотреть файл

@ -81,14 +81,12 @@ static NS_DEFINE_CID(kFrameTraversalCID, NS_FRAMETRAVERSAL_CID);
#include "mozilla/dom/SelectionBinding.h"
#include "mozilla/AsyncEventDispatcher.h"
#include "mozilla/Telemetry.h"
#include "mozilla/layers/ScrollInputMethods.h"
#include "nsFocusManager.h"
#include "nsPIDOMWindow.h"
using namespace mozilla;
using namespace mozilla::dom;
using mozilla::layers::ScrollInputMethod;
//#define DEBUG_TABLE 1
@ -1796,8 +1794,6 @@ nsFrameSelection::CommonPageMove(bool aForward,
return;
// scroll one page
mozilla::Telemetry::Accumulate(mozilla::Telemetry::SCROLL_INPUT_METHODS,
(uint32_t) ScrollInputMethod::MainThreadScrollPage);
aScrollableFrame->ScrollBy(nsIntPoint(0, aForward ? 1 : -1),
nsIScrollableFrame::PAGES,
nsIScrollableFrame::SMOOTH);

Просмотреть файл

@ -24,10 +24,8 @@
#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
@ -173,9 +171,6 @@ nsScrollbarButtonFrame::HandleButtonPress(nsPresContext* aPresContext,
return false;
}
mozilla::Telemetry::Accumulate(mozilla::Telemetry::SCROLL_INPUT_METHODS,
(uint32_t) ScrollInputMethod::MainThreadScrollbarButtonClick);
if (!m) {
sb->MoveToNewPosition();
if (!weakFrame.IsAlive()) {

Просмотреть файл

@ -48,7 +48,6 @@
#include "mozilla/layers/APZCCallbackHelper.h"
#include "mozilla/layers/AsyncDragMetrics.h"
#include "mozilla/layers/InputAPZContext.h"
#include "mozilla/layers/ScrollInputMethods.h"
#include <algorithm>
using namespace mozilla;
@ -56,7 +55,6 @@ using mozilla::layers::APZCCallbackHelper;
using mozilla::layers::AsyncDragMetrics;
using mozilla::layers::InputAPZContext;
using mozilla::layers::ScrollDirection;
using mozilla::layers::ScrollInputMethod;
using mozilla::layers::ScrollThumbData;
bool nsSliderFrame::gMiddlePref = false;
@ -622,9 +620,6 @@ 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;
@ -691,9 +686,6 @@ 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
AutoWeakFrame weakFrame(this);
// should aMaySnap be true here?
@ -1455,9 +1447,6 @@ nsSliderFrame::HandlePress(nsPresContext* aPresContext,
return NS_OK;
}
mozilla::Telemetry::Accumulate(mozilla::Telemetry::SCROLL_INPUT_METHODS,
(uint32_t) ScrollInputMethod::MainThreadScrollbarTrackClick);
if (IsXULHorizontal() ? eventPoint.x < thumbRect.x
: eventPoint.y < thumbRect.y)
change = -1;

Просмотреть файл

@ -12303,15 +12303,6 @@
"releaseChannelCollection": "opt-out",
"description": "Graphics Crash Reason (...)"
},
"SCROLL_INPUT_METHODS": {
"record_in_processes": ["main", "content", "gpu"],
"alert_emails": ["botond@mozilla.com"],
"bug_numbers": [1238137],
"expires_in_version": "60",
"kind": "enumerated",
"n_values": 64,
"description": "Count of scroll actions triggered by different input methods. See gfx/layers/apz/util/ScrollInputMethods.h for a list of possible values and their meanings."
},
"TOTAL_SCROLL_Y": {
"record_in_processes": ["main", "content"],
"alert_emails": ["hkirschner@mozilla.com"],

Просмотреть файл

@ -306,9 +306,6 @@ var ClickEventHandler = {
this._scrollErrorX = (desiredScrollX - actualScrollX);
}
const kAutoscroll = 15; // defined in mozilla/layers/ScrollInputMethods.h
Services.telemetry.getHistogramById("SCROLL_INPUT_METHODS").add(kAutoscroll);
this._scrollable.scrollBy({
left: actualScrollX,
top: actualScrollY,

Просмотреть файл

@ -206,7 +206,6 @@
#include "mozilla/layers/APZCTreeManager.h"
#include "mozilla/layers/InputAPZContext.h"
#include "mozilla/layers/KnowsCompositor.h"
#include "mozilla/layers/ScrollInputMethods.h"
#include "InputData.h"
#include "mozilla/Telemetry.h"
@ -7023,8 +7022,6 @@ bool nsWindow::OnGesture(WPARAM wParam, LPARAM lParam)
bool endFeedback = true;
if (mGesture.PanDeltaToPixelScroll(wheelEvent)) {
mozilla::Telemetry::Accumulate(mozilla::Telemetry::SCROLL_INPUT_METHODS,
(uint32_t) ScrollInputMethod::MainThreadTouch);
DispatchEvent(&wheelEvent, status);
}