/src/mozilla-central/gfx/layers/ipc/APZChild.cpp
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 | | #include "mozilla/layers/APZChild.h" |
8 | | #include "mozilla/layers/GeckoContentController.h" |
9 | | |
10 | | #include "mozilla/dom/TabChild.h" |
11 | | #include "mozilla/layers/APZCCallbackHelper.h" |
12 | | |
13 | | #include "InputData.h" // for InputData |
14 | | |
15 | | namespace mozilla { |
16 | | namespace layers { |
17 | | |
18 | | APZChild::APZChild(RefPtr<GeckoContentController> aController) |
19 | | : mController(aController) |
20 | 0 | { |
21 | 0 | MOZ_ASSERT(mController); |
22 | 0 | } |
23 | | |
24 | | APZChild::~APZChild() |
25 | 0 | { |
26 | 0 | if (mController) { |
27 | 0 | mController->Destroy(); |
28 | 0 | mController = nullptr; |
29 | 0 | } |
30 | 0 | } |
31 | | |
32 | | mozilla::ipc::IPCResult |
33 | | APZChild::RecvRequestContentRepaint(const FrameMetrics& aFrameMetrics) |
34 | 0 | { |
35 | 0 | MOZ_ASSERT(mController->IsRepaintThread()); |
36 | 0 |
|
37 | 0 | mController->RequestContentRepaint(aFrameMetrics); |
38 | 0 | return IPC_OK(); |
39 | 0 | } |
40 | | |
41 | | mozilla::ipc::IPCResult |
42 | | APZChild::RecvUpdateOverscrollVelocity(const float& aX, const float& aY, const bool& aIsRootContent) |
43 | 0 | { |
44 | 0 | mController->UpdateOverscrollVelocity(aX, aY, aIsRootContent); |
45 | 0 | return IPC_OK(); |
46 | 0 | } |
47 | | |
48 | | mozilla::ipc::IPCResult |
49 | | APZChild::RecvUpdateOverscrollOffset(const float& aX, const float& aY, const bool& aIsRootContent) |
50 | 0 | { |
51 | 0 | mController->UpdateOverscrollOffset(aX, aY, aIsRootContent); |
52 | 0 | return IPC_OK(); |
53 | 0 | } |
54 | | |
55 | | mozilla::ipc::IPCResult |
56 | | APZChild::RecvNotifyMozMouseScrollEvent(const ViewID& aScrollId, |
57 | | const nsString& aEvent) |
58 | 0 | { |
59 | 0 | mController->NotifyMozMouseScrollEvent(aScrollId, aEvent); |
60 | 0 | return IPC_OK(); |
61 | 0 | } |
62 | | |
63 | | mozilla::ipc::IPCResult |
64 | | APZChild::RecvNotifyAPZStateChange(const ScrollableLayerGuid& aGuid, |
65 | | const APZStateChange& aChange, |
66 | | const int& aArg) |
67 | 0 | { |
68 | 0 | mController->NotifyAPZStateChange(aGuid, aChange, aArg); |
69 | 0 | return IPC_OK(); |
70 | 0 | } |
71 | | |
72 | | mozilla::ipc::IPCResult |
73 | | APZChild::RecvNotifyFlushComplete() |
74 | 0 | { |
75 | 0 | MOZ_ASSERT(mController->IsRepaintThread()); |
76 | 0 |
|
77 | 0 | mController->NotifyFlushComplete(); |
78 | 0 | return IPC_OK(); |
79 | 0 | } |
80 | | |
81 | | mozilla::ipc::IPCResult |
82 | | APZChild::RecvNotifyAsyncScrollbarDragRejected(const ViewID& aScrollId) |
83 | 0 | { |
84 | 0 | mController->NotifyAsyncScrollbarDragRejected(aScrollId); |
85 | 0 | return IPC_OK(); |
86 | 0 | } |
87 | | |
88 | | mozilla::ipc::IPCResult |
89 | | APZChild::RecvNotifyAsyncAutoscrollRejected(const ViewID& aScrollId) |
90 | 0 | { |
91 | 0 | mController->NotifyAsyncAutoscrollRejected(aScrollId); |
92 | 0 | return IPC_OK(); |
93 | 0 | } |
94 | | |
95 | | mozilla::ipc::IPCResult |
96 | | APZChild::RecvDestroy() |
97 | 0 | { |
98 | 0 | // mController->Destroy will be called in the destructor |
99 | 0 | PAPZChild::Send__delete__(this); |
100 | 0 | return IPC_OK(); |
101 | 0 | } |
102 | | |
103 | | |
104 | | } // namespace layers |
105 | | } // namespace mozilla |