Coverage Report

Created: 2018-09-25 14:53

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