Coverage Report

Created: 2018-09-25 14:53

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