Coverage Report

Created: 2018-09-25 14:53

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