/work/obj-fuzz/dist/include/mozilla/dom/CoalescedMouseData.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* vim: set ts=8 sts=2 et sw=2 tw=80: */ |
3 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
4 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | | |
7 | | #ifndef mozilla_dom_CoalescedMouseData_h |
8 | | #define mozilla_dom_CoalescedMouseData_h |
9 | | |
10 | | #include "CoalescedInputData.h" |
11 | | #include "mozilla/MouseEvents.h" |
12 | | #include "nsRefreshDriver.h" |
13 | | |
14 | | namespace mozilla { |
15 | | namespace dom { |
16 | | |
17 | | class CoalescedMouseData final : public CoalescedInputData<WidgetMouseEvent> |
18 | | { |
19 | | public: |
20 | | CoalescedMouseData() |
21 | 0 | { |
22 | 0 | MOZ_COUNT_CTOR(mozilla::dom::CoalescedMouseData); |
23 | 0 | } |
24 | | |
25 | | ~CoalescedMouseData() |
26 | 0 | { |
27 | 0 | MOZ_COUNT_DTOR(mozilla::dom::CoalescedMouseData); |
28 | 0 | } |
29 | | |
30 | | void Coalesce(const WidgetMouseEvent& aEvent, |
31 | | const ScrollableLayerGuid& aGuid, |
32 | | const uint64_t& aInputBlockId); |
33 | | |
34 | | bool CanCoalesce(const WidgetMouseEvent& aEvent, |
35 | | const ScrollableLayerGuid& aGuid, |
36 | | const uint64_t& aInputBlockId); |
37 | | }; |
38 | | |
39 | | class CoalescedMouseMoveFlusher final : public nsARefreshObserver { |
40 | | public: |
41 | | explicit CoalescedMouseMoveFlusher(TabChild* aTabChild) |
42 | | : mTabChild(aTabChild) |
43 | 0 | { |
44 | 0 | MOZ_ASSERT(mTabChild); |
45 | 0 | } |
46 | | |
47 | | virtual void WillRefresh(mozilla::TimeStamp aTime) override; |
48 | | |
49 | | NS_INLINE_DECL_REFCOUNTING(CoalescedMouseMoveFlusher, override) |
50 | | |
51 | | void StartObserver(); |
52 | | void RemoveObserver(); |
53 | | |
54 | | private: |
55 | 0 | ~CoalescedMouseMoveFlusher() { |
56 | 0 | RemoveObserver(); |
57 | 0 | } |
58 | | |
59 | | nsRefreshDriver* GetRefreshDriver(); |
60 | | |
61 | | TabChild* mTabChild; |
62 | | RefPtr<nsRefreshDriver> mRefreshDriver; |
63 | | }; |
64 | | |
65 | | } // namespace dom |
66 | | } // namespace mozilla |
67 | | |
68 | | #endif // mozilla_dom_CoalescedMouseData_h |