Coverage Report

Created: 2018-09-25 14:53

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