Coverage Report

Created: 2018-09-25 14:53

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