Coverage Report

Created: 2018-09-25 14:53

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