Coverage Report

Created: 2018-09-25 14:53

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