Coverage Report

Created: 2018-09-25 14:53

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