Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/ipc/ipdl/PHeapSnapshotTempFileHelperParent.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/PHeapSnapshotTempFileHelperParent.h"
8
9
#include "mozilla/dom/PContentParent.h"
10
11
#include "nsIFile.h"
12
#include "GeckoProfiler.h"
13
14
namespace mozilla {
15
namespace devtools {
16
17
18
auto PHeapSnapshotTempFileHelperParent::Recv__delete__() -> mozilla::ipc::IPCResult
19
0
{
20
0
    return IPC_OK();
21
0
}
22
23
auto PHeapSnapshotTempFileHelperParent::ActorDestroy(ActorDestroyReason aWhy) -> void
24
0
{
25
0
}
26
27
MOZ_IMPLICIT PHeapSnapshotTempFileHelperParent::PHeapSnapshotTempFileHelperParent() :
28
    mozilla::ipc::IProtocol(mozilla::ipc::ParentSide),
29
    mLivenessState(mozilla::ipc::LivenessState::Dead)
30
0
{
31
0
    MOZ_COUNT_CTOR(PHeapSnapshotTempFileHelperParent);
32
0
}
33
34
PHeapSnapshotTempFileHelperParent::~PHeapSnapshotTempFileHelperParent()
35
0
{
36
0
    MOZ_COUNT_DTOR(PHeapSnapshotTempFileHelperParent);
37
0
}
38
39
auto PHeapSnapshotTempFileHelperParent::Manager() const -> PContentParent*
40
0
{
41
0
    return static_cast<PContentParent*>(IProtocol::Manager());
42
0
}
43
44
auto PHeapSnapshotTempFileHelperParent::RemoveManagee(
45
        int32_t aProtocolId,
46
        IProtocol* aListener) -> void
47
0
{
48
0
    FatalError("unreached");
49
0
    return;
50
0
}
51
52
auto PHeapSnapshotTempFileHelperParent::OnMessageReceived(const Message& msg__) -> PHeapSnapshotTempFileHelperParent::Result
53
0
{
54
0
    switch ((msg__).type()) {
55
0
    case PHeapSnapshotTempFileHelper::Msg___delete____ID:
56
0
        {
57
0
            if (mozilla::ipc::LoggingEnabledFor("PHeapSnapshotTempFileHelperParent")) {
58
0
                mozilla::ipc::LogMessageForProtocol("PHeapSnapshotTempFileHelperParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
59
0
            }
60
0
            AUTO_PROFILER_LABEL("PHeapSnapshotTempFileHelper::Msg___delete__", OTHER);
61
0
62
0
            PickleIterator iter__(msg__);
63
0
            PHeapSnapshotTempFileHelperParent* actor;
64
0
65
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(actor)))))) {
66
0
                FatalError("Error deserializing 'PHeapSnapshotTempFileHelperParent'");
67
0
                return MsgValueError;
68
0
            }
69
0
            if ((!((*((&(actor))))))) {
70
0
                FatalError("Error deserializing 'PHeapSnapshotTempFileHelperParent'");
71
0
                return MsgValueError;
72
0
            }
73
0
            // Sentinel = 'actor'
74
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) {
75
0
                mozilla::ipc::SentinelReadError("Error deserializing 'PHeapSnapshotTempFileHelperParent'");
76
0
                return MsgValueError;
77
0
            }
78
0
            (msg__).EndRead(iter__, (msg__).type());
79
0
            if ((!(StateTransition(true, (&(mLivenessState)))))) {
80
0
                FatalError("Transition error");
81
0
                return MsgValueError;
82
0
            }
83
0
            if ((!(Recv__delete__()))) {
84
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
85
0
                // Error handled in mozilla::ipc::IPCResult
86
0
                return MsgProcessingError;
87
0
            }
88
0
89
0
90
0
            IProtocol* mgr = (actor)->Manager();
91
0
            (actor)->DestroySubtree(Deletion);
92
0
            (actor)->DeallocSubtree();
93
0
            (mgr)->RemoveManagee(PHeapSnapshotTempFileHelperMsgStart, actor);
94
0
95
0
            return MsgProcessed;
96
0
        }
97
0
    default:
98
0
        {
99
0
            return MsgNotKnown;
100
0
        }
101
0
    }
102
0
}
103
104
auto PHeapSnapshotTempFileHelperParent::OnMessageReceived(
105
        const Message& msg__,
106
        Message*& reply__) -> PHeapSnapshotTempFileHelperParent::Result
107
0
{
108
0
    switch ((msg__).type()) {
109
0
    case PHeapSnapshotTempFileHelper::Msg_OpenHeapSnapshotTempFile__ID:
110
0
        {
111
0
            if (mozilla::ipc::LoggingEnabledFor("PHeapSnapshotTempFileHelperParent")) {
112
0
                mozilla::ipc::LogMessageForProtocol("PHeapSnapshotTempFileHelperParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
113
0
            }
114
0
            AUTO_PROFILER_LABEL("PHeapSnapshotTempFileHelper::Msg_OpenHeapSnapshotTempFile", OTHER);
115
0
116
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
117
0
                FatalError("Transition error");
118
0
                return MsgValueError;
119
0
            }
120
0
            int32_t id__ = Id();
121
0
            OpenHeapSnapshotTempFileResponse response;
122
0
            if ((!(RecvOpenHeapSnapshotTempFile((&(response)))))) {
123
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
124
0
                // Error handled in mozilla::ipc::IPCResult
125
0
                return MsgProcessingError;
126
0
            }
127
0
128
0
            reply__ = PHeapSnapshotTempFileHelper::Reply_OpenHeapSnapshotTempFile(id__);
129
0
130
0
            WriteIPDLParam(reply__, this, response);
131
0
            // Sentinel = 'response'
132
0
            (reply__)->WriteSentinel(2396115421);
133
0
134
0
            if (mozilla::ipc::LoggingEnabledFor("PHeapSnapshotTempFileHelperParent")) {
135
0
                mozilla::ipc::LogMessageForProtocol("PHeapSnapshotTempFileHelperParent", OtherPid(), "Sending reply ", (reply__)->type(), mozilla::ipc::MessageDirection::eSending);
136
0
            }
137
0
            return MsgProcessed;
138
0
        }
139
0
    default:
140
0
        {
141
0
            return MsgNotKnown;
142
0
        }
143
0
    }
144
0
}
145
146
auto PHeapSnapshotTempFileHelperParent::OnCallReceived(
147
        const Message& msg__,
148
        Message*& reply__) -> PHeapSnapshotTempFileHelperParent::Result
149
0
{
150
0
    MOZ_ASSERT_UNREACHABLE("message protocol not supported");
151
0
    return MsgNotKnown;
152
0
}
153
154
auto PHeapSnapshotTempFileHelperParent::GetProtocolTypeId() -> int32_t
155
0
{
156
0
    return PHeapSnapshotTempFileHelperMsgStart;
157
0
}
158
159
auto PHeapSnapshotTempFileHelperParent::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 PHeapSnapshotTempFileHelperParent::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::PHeapSnapshotTempFileHelperParent>::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::PHeapSnapshotTempFileHelperParent>::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::PHeapSnapshotTempFileHelperParent*>((actor).value());
211
0
    return true;
212
0
}
213
214
} // namespace ipc
215
} // namespace mozilla