/work/obj-fuzz/ipc/ipdl/PVsyncBridgeParent.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | // |
2 | | // Automatically generated by ipdlc. |
3 | | // Edit at your own risk |
4 | | // |
5 | | |
6 | | |
7 | | #include "mozilla/gfx/PVsyncBridgeParent.h" |
8 | | #include "mozilla/TimeStamp.h" |
9 | | |
10 | | |
11 | | #include "nsIFile.h" |
12 | | #include "GeckoProfiler.h" |
13 | | |
14 | | namespace mozilla { |
15 | | namespace gfx { |
16 | | |
17 | | |
18 | | auto PVsyncBridgeParent::ActorDestroy(ActorDestroyReason aWhy) -> void |
19 | 0 | { |
20 | 0 | } |
21 | | |
22 | | auto PVsyncBridgeParent::ProcessingError( |
23 | | Result aCode, |
24 | | const char* aReason) -> void |
25 | 0 | { |
26 | 0 | } |
27 | | |
28 | | auto PVsyncBridgeParent::ShouldContinueFromReplyTimeout() -> bool |
29 | 0 | { |
30 | 0 | return true; |
31 | 0 | } |
32 | | |
33 | | auto PVsyncBridgeParent::EnteredCxxStack() -> void |
34 | 0 | { |
35 | 0 | } |
36 | | |
37 | | auto PVsyncBridgeParent::ExitedCxxStack() -> void |
38 | 0 | { |
39 | 0 | } |
40 | | |
41 | | auto PVsyncBridgeParent::EnteredCall() -> void |
42 | 0 | { |
43 | 0 | } |
44 | | |
45 | | auto PVsyncBridgeParent::ExitedCall() -> void |
46 | 0 | { |
47 | 0 | } |
48 | | |
49 | | MOZ_IMPLICIT PVsyncBridgeParent::PVsyncBridgeParent() : |
50 | | mozilla::ipc::IToplevelProtocol("PVsyncBridgeParent", PVsyncBridgeMsgStart, mozilla::ipc::ParentSide), |
51 | | mLivenessState(mozilla::ipc::LivenessState::Start) |
52 | 0 | { |
53 | 0 | MOZ_COUNT_CTOR(PVsyncBridgeParent); |
54 | 0 | } |
55 | | |
56 | | PVsyncBridgeParent::~PVsyncBridgeParent() |
57 | 0 | { |
58 | 0 | MOZ_COUNT_DTOR(PVsyncBridgeParent); |
59 | 0 | } |
60 | | |
61 | | auto PVsyncBridgeParent::RemoveManagee( |
62 | | int32_t aProtocolId, |
63 | | IProtocol* aListener) -> void |
64 | 0 | { |
65 | 0 | FatalError("unreached"); |
66 | 0 | return; |
67 | 0 | } |
68 | | |
69 | | auto PVsyncBridgeParent::OnMessageReceived(const Message& msg__) -> PVsyncBridgeParent::Result |
70 | 0 | { |
71 | 0 | switch ((msg__).type()) { |
72 | 0 | case PVsyncBridge::Msg_NotifyVsync__ID: |
73 | 0 | { |
74 | 0 | if (mozilla::ipc::LoggingEnabledFor("PVsyncBridgeParent")) { |
75 | 0 | mozilla::ipc::LogMessageForProtocol("PVsyncBridgeParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
76 | 0 | } |
77 | 0 | AUTO_PROFILER_LABEL("PVsyncBridge::Msg_NotifyVsync", OTHER); |
78 | 0 |
|
79 | 0 | PickleIterator iter__(msg__); |
80 | 0 | TimeStamp vsyncTimeStamp; |
81 | 0 | LayersId layersId; |
82 | 0 |
|
83 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(vsyncTimeStamp)))))) { |
84 | 0 | FatalError("Error deserializing 'TimeStamp'"); |
85 | 0 | return MsgValueError; |
86 | 0 | } |
87 | 0 | // Sentinel = 'vsyncTimeStamp' |
88 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1510557875)))) { |
89 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'TimeStamp'"); |
90 | 0 | return MsgValueError; |
91 | 0 | } |
92 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(layersId)))))) { |
93 | 0 | FatalError("Error deserializing 'LayersId'"); |
94 | 0 | return MsgValueError; |
95 | 0 | } |
96 | 0 | // Sentinel = 'layersId' |
97 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2382073245)))) { |
98 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'LayersId'"); |
99 | 0 | return MsgValueError; |
100 | 0 | } |
101 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
102 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
103 | 0 | FatalError("Transition error"); |
104 | 0 | return MsgValueError; |
105 | 0 | } |
106 | 0 | if ((!(RecvNotifyVsync(vsyncTimeStamp, layersId)))) { |
107 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
108 | 0 | // Error handled in mozilla::ipc::IPCResult |
109 | 0 | return MsgProcessingError; |
110 | 0 | } |
111 | 0 | |
112 | 0 | return MsgProcessed; |
113 | 0 | } |
114 | 0 | default: |
115 | 0 | { |
116 | 0 | return MsgNotKnown; |
117 | 0 | } |
118 | 0 | case SHMEM_CREATED_MESSAGE_TYPE: |
119 | 0 | { |
120 | 0 | FatalError("this protocol tree does not use shmem"); |
121 | 0 | return MsgNotKnown; |
122 | 0 | } |
123 | 0 | case SHMEM_DESTROYED_MESSAGE_TYPE: |
124 | 0 | { |
125 | 0 | FatalError("this protocol tree does not use shmem"); |
126 | 0 | return MsgNotKnown; |
127 | 0 | } |
128 | 0 | } |
129 | 0 | } |
130 | | |
131 | | auto PVsyncBridgeParent::OnMessageReceived( |
132 | | const Message& msg__, |
133 | | Message*& reply__) -> PVsyncBridgeParent::Result |
134 | 0 | { |
135 | 0 | return MsgNotKnown; |
136 | 0 | } |
137 | | |
138 | | auto PVsyncBridgeParent::OnCallReceived( |
139 | | const Message& msg__, |
140 | | Message*& reply__) -> PVsyncBridgeParent::Result |
141 | 0 | { |
142 | 0 | MOZ_ASSERT_UNREACHABLE("message protocol not supported"); |
143 | 0 | return MsgNotKnown; |
144 | 0 | } |
145 | | |
146 | | auto PVsyncBridgeParent::GetProtocolTypeId() -> int32_t |
147 | 0 | { |
148 | 0 | return PVsyncBridgeMsgStart; |
149 | 0 | } |
150 | | |
151 | | auto PVsyncBridgeParent::OnChannelClose() -> void |
152 | 0 | { |
153 | 0 | DestroySubtree(NormalShutdown); |
154 | 0 | DeallocSubtree(); |
155 | 0 | DeallocShmems(); |
156 | 0 | DeallocPVsyncBridgeParent(); |
157 | 0 | } |
158 | | |
159 | | auto PVsyncBridgeParent::OnChannelError() -> void |
160 | 0 | { |
161 | 0 | DestroySubtree(AbnormalShutdown); |
162 | 0 | DeallocSubtree(); |
163 | 0 | DeallocShmems(); |
164 | 0 | DeallocPVsyncBridgeParent(); |
165 | 0 | } |
166 | | |
167 | | auto PVsyncBridgeParent::DestroySubtree(ActorDestroyReason why) -> void |
168 | 0 | { |
169 | 0 | // Reject owning pending responses. |
170 | 0 | (GetIPCChannel())->RejectPendingResponsesForActor(this); |
171 | 0 |
|
172 | 0 | // Finally, destroy "us". |
173 | 0 | ActorDestroy(why); |
174 | 0 | } |
175 | | |
176 | | auto PVsyncBridgeParent::DeallocSubtree() -> void |
177 | 0 | { |
178 | 0 | } |
179 | | |
180 | | auto PVsyncBridgeParent::DeallocPVsyncBridgeParent() -> void |
181 | 0 | { |
182 | 0 | } |
183 | | |
184 | | |
185 | | |
186 | | } // namespace gfx |
187 | | } // namespace mozilla |
188 | | namespace mozilla { |
189 | | namespace ipc { |
190 | | auto IPDLParamTraits<mozilla::gfx::PVsyncBridgeParent>::Write( |
191 | | IPC::Message* aMsg, |
192 | | mozilla::ipc::IProtocol* aActor, |
193 | | const paramType& aVar) -> void |
194 | 0 | { |
195 | 0 | int32_t id; |
196 | 0 | if ((!(aVar))) { |
197 | 0 | id = 0; |
198 | 0 | } |
199 | 0 | else { |
200 | 0 | id = (aVar)->Id(); |
201 | 0 | if ((1) == (id)) { |
202 | 0 | (aActor)->FatalError("actor has been |delete|d"); |
203 | 0 | } |
204 | 0 | } |
205 | 0 | WriteIPDLParam(aMsg, aActor, id); |
206 | 0 | } |
207 | | |
208 | | auto IPDLParamTraits<mozilla::gfx::PVsyncBridgeParent>::Read( |
209 | | const IPC::Message* aMsg, |
210 | | PickleIterator* aIter, |
211 | | mozilla::ipc::IProtocol* aActor, |
212 | | paramType* aVar) -> bool |
213 | 0 | { |
214 | 0 | mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PVsyncBridge", PVsyncBridgeMsgStart); |
215 | 0 | if ((actor).isNothing()) { |
216 | 0 | return false; |
217 | 0 | } |
218 | 0 | |
219 | 0 | (*(aVar)) = static_cast<mozilla::gfx::PVsyncBridgeParent*>((actor).value()); |
220 | 0 | return true; |
221 | 0 | } |
222 | | |
223 | | } // namespace ipc |
224 | | } // namespace mozilla |