Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/ipc/ipdl/PSimpleChannelChild.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/net/PSimpleChannelChild.h"
8
9
#include "mozilla/net/PNeckoChild.h"
10
11
#include "nsIFile.h"
12
#include "GeckoProfiler.h"
13
14
namespace mozilla {
15
namespace net {
16
17
18
auto PSimpleChannelChild::ActorDestroy(ActorDestroyReason aWhy) -> void
19
0
{
20
0
}
21
22
MOZ_IMPLICIT PSimpleChannelChild::PSimpleChannelChild() :
23
    mozilla::ipc::IProtocol(mozilla::ipc::ChildSide),
24
    mLivenessState(mozilla::ipc::LivenessState::Dead)
25
0
{
26
0
    MOZ_COUNT_CTOR(PSimpleChannelChild);
27
0
}
28
29
PSimpleChannelChild::~PSimpleChannelChild()
30
0
{
31
0
    MOZ_COUNT_DTOR(PSimpleChannelChild);
32
0
}
33
34
auto PSimpleChannelChild::Manager() const -> PNeckoChild*
35
0
{
36
0
    return static_cast<PNeckoChild*>(IProtocol::Manager());
37
0
}
38
39
auto PSimpleChannelChild::Send__delete__(PSimpleChannelChild* actor) -> bool
40
0
{
41
0
    if ((!(actor))) {
42
0
        return false;
43
0
    }
44
0
45
0
    IPC::Message* msg__ = PSimpleChannel::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("PSimpleChannelChild")) {
55
0
        mozilla::ipc::LogMessageForProtocol("PSimpleChannelChild", (actor)->OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
56
0
    }
57
0
    AUTO_PROFILER_LABEL("PSimpleChannel::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(PSimpleChannelMsgStart, actor);
68
0
    return sendok__;
69
0
}
70
71
auto PSimpleChannelChild::RemoveManagee(
72
        int32_t aProtocolId,
73
        IProtocol* aListener) -> void
74
0
{
75
0
    FatalError("unreached");
76
0
    return;
77
0
}
78
79
auto PSimpleChannelChild::OnMessageReceived(const Message& msg__) -> PSimpleChannelChild::Result
80
{
81
    switch ((msg__).type()) {
82
    case PSimpleChannel::Reply___delete____ID:
83
        {
84
            return MsgProcessed;
85
        }
86
    default:
87
        {
88
            return MsgNotKnown;
89
        }
90
    }
91
}
92
93
auto PSimpleChannelChild::OnMessageReceived(
94
        const Message& msg__,
95
        Message*& reply__) -> PSimpleChannelChild::Result
96
0
{
97
0
    return MsgNotKnown;
98
0
}
99
100
auto PSimpleChannelChild::OnCallReceived(
101
        const Message& msg__,
102
        Message*& reply__) -> PSimpleChannelChild::Result
103
0
{
104
0
    MOZ_ASSERT_UNREACHABLE("message protocol not supported");
105
0
    return MsgNotKnown;
106
0
}
107
108
auto PSimpleChannelChild::GetProtocolTypeId() -> int32_t
109
0
{
110
0
    return PSimpleChannelMsgStart;
111
0
}
112
113
auto PSimpleChannelChild::DestroySubtree(ActorDestroyReason why) -> void
114
0
{
115
0
    // Unregister from our manager.
116
0
    Unregister(Id());
117
0
118
0
    // Reject owning pending responses.
119
0
    (GetIPCChannel())->RejectPendingResponsesForActor(this);
120
0
121
0
    // Finally, destroy "us".
122
0
    ActorDestroy(why);
123
0
}
124
125
auto PSimpleChannelChild::DeallocSubtree() -> void
126
0
{
127
0
}
128
129
130
131
} // namespace net
132
} // namespace mozilla
133
namespace mozilla {
134
namespace ipc {
135
auto IPDLParamTraits<mozilla::net::PSimpleChannelChild>::Write(
136
        IPC::Message* aMsg,
137
        mozilla::ipc::IProtocol* aActor,
138
        const paramType& aVar) -> void
139
0
{
140
0
    int32_t id;
141
0
    if ((!(aVar))) {
142
0
        id = 0;
143
0
    }
144
0
    else {
145
0
        id = (aVar)->Id();
146
0
        if ((1) == (id)) {
147
0
            (aActor)->FatalError("actor has been |delete|d");
148
0
        }
149
0
    }
150
0
    WriteIPDLParam(aMsg, aActor, id);
151
0
}
152
153
auto IPDLParamTraits<mozilla::net::PSimpleChannelChild>::Read(
154
        const IPC::Message* aMsg,
155
        PickleIterator* aIter,
156
        mozilla::ipc::IProtocol* aActor,
157
        paramType* aVar) -> bool
158
0
{
159
0
    mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PSimpleChannel", PSimpleChannelMsgStart);
160
0
    if ((actor).isNothing()) {
161
0
        return false;
162
0
    }
163
0
164
0
    (*(aVar)) = static_cast<mozilla::net::PSimpleChannelChild*>((actor).value());
165
0
    return true;
166
0
}
167
168
} // namespace ipc
169
} // namespace mozilla