Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/ipc/ipdl/PCompositorWidgetParent.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/widget/PCompositorWidgetParent.h"
8
9
#include "mozilla/layers/PCompositorBridgeParent.h"
10
11
#include "nsIFile.h"
12
#include "GeckoProfiler.h"
13
14
namespace mozilla {
15
namespace widget {
16
17
18
auto PCompositorWidgetParent::Recv__delete__() -> mozilla::ipc::IPCResult
19
0
{
20
0
    return IPC_OK();
21
0
}
22
23
auto PCompositorWidgetParent::ActorDestroy(ActorDestroyReason aWhy) -> void
24
0
{
25
0
}
26
27
MOZ_IMPLICIT PCompositorWidgetParent::PCompositorWidgetParent() :
28
    mozilla::ipc::IProtocol(mozilla::ipc::ParentSide),
29
    mLivenessState(mozilla::ipc::LivenessState::Dead)
30
0
{
31
0
    MOZ_COUNT_CTOR(PCompositorWidgetParent);
32
0
}
33
34
PCompositorWidgetParent::~PCompositorWidgetParent()
35
0
{
36
0
    MOZ_COUNT_DTOR(PCompositorWidgetParent);
37
0
}
38
39
auto PCompositorWidgetParent::Manager() const -> PCompositorBridgeParent*
40
0
{
41
0
    return static_cast<PCompositorBridgeParent*>(IProtocol::Manager());
42
0
}
43
44
auto PCompositorWidgetParent::SendObserveVsync() -> bool
45
0
{
46
0
    IPC::Message* msg__ = PCompositorWidget::Msg_ObserveVsync(Id());
47
0
48
0
49
0
50
0
51
0
52
0
    if (mozilla::ipc::LoggingEnabledFor("PCompositorWidgetParent")) {
53
0
        mozilla::ipc::LogMessageForProtocol("PCompositorWidgetParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
54
0
    }
55
0
    AUTO_PROFILER_LABEL("PCompositorWidget::Msg_ObserveVsync", OTHER);
56
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
57
0
        mozilla::ipc::LogicError("Transition error");
58
0
    }
59
0
60
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
61
0
    return sendok__;
62
0
}
63
64
auto PCompositorWidgetParent::SendUnobserveVsync() -> bool
65
0
{
66
0
    IPC::Message* msg__ = PCompositorWidget::Msg_UnobserveVsync(Id());
67
0
68
0
69
0
70
0
71
0
72
0
    if (mozilla::ipc::LoggingEnabledFor("PCompositorWidgetParent")) {
73
0
        mozilla::ipc::LogMessageForProtocol("PCompositorWidgetParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
74
0
    }
75
0
    AUTO_PROFILER_LABEL("PCompositorWidget::Msg_UnobserveVsync", OTHER);
76
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
77
0
        mozilla::ipc::LogicError("Transition error");
78
0
    }
79
0
80
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
81
0
    return sendok__;
82
0
}
83
84
auto PCompositorWidgetParent::RemoveManagee(
85
        int32_t aProtocolId,
86
        IProtocol* aListener) -> void
87
0
{
88
0
    FatalError("unreached");
89
0
    return;
90
0
}
91
92
auto PCompositorWidgetParent::OnMessageReceived(const Message& msg__) -> PCompositorWidgetParent::Result
93
0
{
94
0
    switch ((msg__).type()) {
95
0
    case PCompositorWidget::Msg___delete____ID:
96
0
        {
97
0
            if (mozilla::ipc::LoggingEnabledFor("PCompositorWidgetParent")) {
98
0
                mozilla::ipc::LogMessageForProtocol("PCompositorWidgetParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
99
0
            }
100
0
            AUTO_PROFILER_LABEL("PCompositorWidget::Msg___delete__", OTHER);
101
0
102
0
            PickleIterator iter__(msg__);
103
0
            PCompositorWidgetParent* actor;
104
0
105
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(actor)))))) {
106
0
                FatalError("Error deserializing 'PCompositorWidgetParent'");
107
0
                return MsgValueError;
108
0
            }
109
0
            if ((!((*((&(actor))))))) {
110
0
                FatalError("Error deserializing 'PCompositorWidgetParent'");
111
0
                return MsgValueError;
112
0
            }
113
0
            // Sentinel = 'actor'
114
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) {
115
0
                mozilla::ipc::SentinelReadError("Error deserializing 'PCompositorWidgetParent'");
116
0
                return MsgValueError;
117
0
            }
118
0
            (msg__).EndRead(iter__, (msg__).type());
119
0
            if ((!(StateTransition(true, (&(mLivenessState)))))) {
120
0
                FatalError("Transition error");
121
0
                return MsgValueError;
122
0
            }
123
0
            if ((!(Recv__delete__()))) {
124
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
125
0
                // Error handled in mozilla::ipc::IPCResult
126
0
                return MsgProcessingError;
127
0
            }
128
0
129
0
130
0
            IProtocol* mgr = (actor)->Manager();
131
0
            (actor)->DestroySubtree(Deletion);
132
0
            (actor)->DeallocSubtree();
133
0
            (mgr)->RemoveManagee(PCompositorWidgetMsgStart, actor);
134
0
135
0
            return MsgProcessed;
136
0
        }
137
0
    case PCompositorWidget::Msg_NotifyClientSizeChanged__ID:
138
0
        {
139
0
            if (mozilla::ipc::LoggingEnabledFor("PCompositorWidgetParent")) {
140
0
                mozilla::ipc::LogMessageForProtocol("PCompositorWidgetParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
141
0
            }
142
0
            AUTO_PROFILER_LABEL("PCompositorWidget::Msg_NotifyClientSizeChanged", OTHER);
143
0
144
0
            PickleIterator iter__(msg__);
145
0
            LayoutDeviceIntSize aClientSize;
146
0
147
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aClientSize)))))) {
148
0
                FatalError("Error deserializing 'LayoutDeviceIntSize'");
149
0
                return MsgValueError;
150
0
            }
151
0
            // Sentinel = 'aClientSize'
152
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3895995060)))) {
153
0
                mozilla::ipc::SentinelReadError("Error deserializing 'LayoutDeviceIntSize'");
154
0
                return MsgValueError;
155
0
            }
156
0
            (msg__).EndRead(iter__, (msg__).type());
157
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
158
0
                FatalError("Transition error");
159
0
                return MsgValueError;
160
0
            }
161
0
            if ((!(RecvNotifyClientSizeChanged(aClientSize)))) {
162
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
163
0
                // Error handled in mozilla::ipc::IPCResult
164
0
                return MsgProcessingError;
165
0
            }
166
0
167
0
            return MsgProcessed;
168
0
        }
169
0
    default:
170
0
        {
171
0
            return MsgNotKnown;
172
0
        }
173
0
    }
174
0
}
175
176
auto PCompositorWidgetParent::OnMessageReceived(
177
        const Message& msg__,
178
        Message*& reply__) -> PCompositorWidgetParent::Result
179
0
{
180
0
    return MsgNotKnown;
181
0
}
182
183
auto PCompositorWidgetParent::OnCallReceived(
184
        const Message& msg__,
185
        Message*& reply__) -> PCompositorWidgetParent::Result
186
0
{
187
0
    MOZ_ASSERT_UNREACHABLE("message protocol not supported");
188
0
    return MsgNotKnown;
189
0
}
190
191
auto PCompositorWidgetParent::GetProtocolTypeId() -> int32_t
192
0
{
193
0
    return PCompositorWidgetMsgStart;
194
0
}
195
196
auto PCompositorWidgetParent::DestroySubtree(ActorDestroyReason why) -> void
197
0
{
198
0
    // Unregister from our manager.
199
0
    Unregister(Id());
200
0
201
0
    // Reject owning pending responses.
202
0
    (GetIPCChannel())->RejectPendingResponsesForActor(this);
203
0
204
0
    // Finally, destroy "us".
205
0
    ActorDestroy(why);
206
0
}
207
208
auto PCompositorWidgetParent::DeallocSubtree() -> void
209
0
{
210
0
}
211
212
213
214
} // namespace widget
215
} // namespace mozilla
216
namespace mozilla {
217
namespace ipc {
218
auto IPDLParamTraits<mozilla::widget::PCompositorWidgetParent>::Write(
219
        IPC::Message* aMsg,
220
        mozilla::ipc::IProtocol* aActor,
221
        const paramType& aVar) -> void
222
0
{
223
0
    int32_t id;
224
0
    if ((!(aVar))) {
225
0
        id = 0;
226
0
    }
227
0
    else {
228
0
        id = (aVar)->Id();
229
0
        if ((1) == (id)) {
230
0
            (aActor)->FatalError("actor has been |delete|d");
231
0
        }
232
0
    }
233
0
    WriteIPDLParam(aMsg, aActor, id);
234
0
}
235
236
auto IPDLParamTraits<mozilla::widget::PCompositorWidgetParent>::Read(
237
        const IPC::Message* aMsg,
238
        PickleIterator* aIter,
239
        mozilla::ipc::IProtocol* aActor,
240
        paramType* aVar) -> bool
241
0
{
242
0
    mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PCompositorWidget", PCompositorWidgetMsgStart);
243
0
    if ((actor).isNothing()) {
244
0
        return false;
245
0
    }
246
0
247
0
    (*(aVar)) = static_cast<mozilla::widget::PCompositorWidgetParent*>((actor).value());
248
0
    return true;
249
0
}
250
251
} // namespace ipc
252
} // namespace mozilla