Coverage Report

Created: 2018-09-25 14:53

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