Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/ipc/ipdl/PBackgroundLocalStorageCacheParent.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/dom/PBackgroundLocalStorageCacheParent.h"
8
9
#include "mozilla/ipc/PBackgroundParent.h"
10
11
#include "nsIFile.h"
12
#include "GeckoProfiler.h"
13
14
namespace mozilla {
15
namespace dom {
16
17
18
auto PBackgroundLocalStorageCacheParent::ActorDestroy(ActorDestroyReason aWhy) -> void
19
0
{
20
0
}
21
22
MOZ_IMPLICIT PBackgroundLocalStorageCacheParent::PBackgroundLocalStorageCacheParent() :
23
    mozilla::ipc::IProtocol(mozilla::ipc::ParentSide),
24
    mLivenessState(mozilla::ipc::LivenessState::Dead)
25
0
{
26
0
    MOZ_COUNT_CTOR(PBackgroundLocalStorageCacheParent);
27
0
}
28
29
PBackgroundLocalStorageCacheParent::~PBackgroundLocalStorageCacheParent()
30
0
{
31
0
    MOZ_COUNT_DTOR(PBackgroundLocalStorageCacheParent);
32
0
}
33
34
auto PBackgroundLocalStorageCacheParent::Manager() const -> PBackgroundParent*
35
0
{
36
0
    return static_cast<PBackgroundParent*>(IProtocol::Manager());
37
0
}
38
39
auto PBackgroundLocalStorageCacheParent::SendObserve(
40
        const PrincipalInfo& principalInfo,
41
        const uint32_t& privateBrowsingId,
42
        const nsString& documentURI,
43
        const nsString& key,
44
        const nsString& oldValue,
45
        const nsString& newValue) -> bool
46
0
{
47
0
    IPC::Message* msg__ = PBackgroundLocalStorageCache::Msg_Observe(Id());
48
0
49
0
    WriteIPDLParam(msg__, this, principalInfo);
50
0
    // Sentinel = 'principalInfo'
51
0
    (msg__)->WriteSentinel(3386633731);
52
0
    WriteIPDLParam(msg__, this, privateBrowsingId);
53
0
    // Sentinel = 'privateBrowsingId'
54
0
    (msg__)->WriteSentinel(2950341020);
55
0
    WriteIPDLParam(msg__, this, documentURI);
56
0
    // Sentinel = 'documentURI'
57
0
    (msg__)->WriteSentinel(3585823520);
58
0
    WriteIPDLParam(msg__, this, key);
59
0
    // Sentinel = 'key'
60
0
    (msg__)->WriteSentinel(35142870);
61
0
    WriteIPDLParam(msg__, this, oldValue);
62
0
    // Sentinel = 'oldValue'
63
0
    (msg__)->WriteSentinel(2227149046);
64
0
    WriteIPDLParam(msg__, this, newValue);
65
0
    // Sentinel = 'newValue'
66
0
    (msg__)->WriteSentinel(1405873629);
67
0
68
0
69
0
70
0
71
0
    if (mozilla::ipc::LoggingEnabledFor("PBackgroundLocalStorageCacheParent")) {
72
0
        mozilla::ipc::LogMessageForProtocol("PBackgroundLocalStorageCacheParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
73
0
    }
74
0
    AUTO_PROFILER_LABEL("PBackgroundLocalStorageCache::Msg_Observe", OTHER);
75
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
76
0
        mozilla::ipc::LogicError("Transition error");
77
0
    }
78
0
79
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
80
0
    return sendok__;
81
0
}
82
83
auto PBackgroundLocalStorageCacheParent::Send__delete__(PBackgroundLocalStorageCacheParent* actor) -> bool
84
0
{
85
0
    if ((!(actor))) {
86
0
        return false;
87
0
    }
88
0
89
0
    IPC::Message* msg__ = PBackgroundLocalStorageCache::Msg___delete__((actor)->Id());
90
0
91
0
    MOZ_RELEASE_ASSERT(actor, "NULL actor value passed to non-nullable param");
92
0
    WriteIPDLParam(msg__, actor, actor);
93
0
    // Sentinel = 'actor'
94
0
    (msg__)->WriteSentinel(875202478);
95
0
96
0
97
0
98
0
    if (mozilla::ipc::LoggingEnabledFor("PBackgroundLocalStorageCacheParent")) {
99
0
        mozilla::ipc::LogMessageForProtocol("PBackgroundLocalStorageCacheParent", (actor)->OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
100
0
    }
101
0
    AUTO_PROFILER_LABEL("PBackgroundLocalStorageCache::Msg___delete__", OTHER);
102
0
    if ((!(StateTransition(true, (&((actor)->mLivenessState)))))) {
103
0
        mozilla::ipc::LogicError("Transition error");
104
0
    }
105
0
106
0
    bool sendok__ = ((actor)->GetIPCChannel())->Send(msg__);
107
0
108
0
    IProtocol* mgr = (actor)->Manager();
109
0
    (actor)->DestroySubtree(Deletion);
110
0
    (actor)->DeallocSubtree();
111
0
    (mgr)->RemoveManagee(PBackgroundLocalStorageCacheMsgStart, actor);
112
0
    return sendok__;
113
0
}
114
115
auto PBackgroundLocalStorageCacheParent::RemoveManagee(
116
        int32_t aProtocolId,
117
        IProtocol* aListener) -> void
118
0
{
119
0
    FatalError("unreached");
120
0
    return;
121
0
}
122
123
auto PBackgroundLocalStorageCacheParent::OnMessageReceived(const Message& msg__) -> PBackgroundLocalStorageCacheParent::Result
124
0
{
125
0
    switch ((msg__).type()) {
126
0
    case PBackgroundLocalStorageCache::Msg_DeleteMe__ID:
127
0
        {
128
0
            if (mozilla::ipc::LoggingEnabledFor("PBackgroundLocalStorageCacheParent")) {
129
0
                mozilla::ipc::LogMessageForProtocol("PBackgroundLocalStorageCacheParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
130
0
            }
131
0
            AUTO_PROFILER_LABEL("PBackgroundLocalStorageCache::Msg_DeleteMe", OTHER);
132
0
133
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
134
0
                FatalError("Transition error");
135
0
                return MsgValueError;
136
0
            }
137
0
            if ((!(RecvDeleteMe()))) {
138
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
139
0
                // Error handled in mozilla::ipc::IPCResult
140
0
                return MsgProcessingError;
141
0
            }
142
0
143
0
            return MsgProcessed;
144
0
        }
145
0
    case PBackgroundLocalStorageCache::Msg_Notify__ID:
146
0
        {
147
0
            if (mozilla::ipc::LoggingEnabledFor("PBackgroundLocalStorageCacheParent")) {
148
0
                mozilla::ipc::LogMessageForProtocol("PBackgroundLocalStorageCacheParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
149
0
            }
150
0
            AUTO_PROFILER_LABEL("PBackgroundLocalStorageCache::Msg_Notify", OTHER);
151
0
152
0
            PickleIterator iter__(msg__);
153
0
            nsString documentURI;
154
0
            nsString key;
155
0
            nsString oldValue;
156
0
            nsString newValue;
157
0
158
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(documentURI)))))) {
159
0
                FatalError("Error deserializing 'nsString'");
160
0
                return MsgValueError;
161
0
            }
162
0
            // Sentinel = 'documentURI'
163
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3585823520)))) {
164
0
                mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
165
0
                return MsgValueError;
166
0
            }
167
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(key)))))) {
168
0
                FatalError("Error deserializing 'nsString'");
169
0
                return MsgValueError;
170
0
            }
171
0
            // Sentinel = 'key'
172
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 35142870)))) {
173
0
                mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
174
0
                return MsgValueError;
175
0
            }
176
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(oldValue)))))) {
177
0
                FatalError("Error deserializing 'nsString'");
178
0
                return MsgValueError;
179
0
            }
180
0
            // Sentinel = 'oldValue'
181
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2227149046)))) {
182
0
                mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
183
0
                return MsgValueError;
184
0
            }
185
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(newValue)))))) {
186
0
                FatalError("Error deserializing 'nsString'");
187
0
                return MsgValueError;
188
0
            }
189
0
            // Sentinel = 'newValue'
190
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1405873629)))) {
191
0
                mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
192
0
                return MsgValueError;
193
0
            }
194
0
            (msg__).EndRead(iter__, (msg__).type());
195
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
196
0
                FatalError("Transition error");
197
0
                return MsgValueError;
198
0
            }
199
0
            if ((!(RecvNotify(documentURI, key, oldValue, newValue)))) {
200
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
201
0
                // Error handled in mozilla::ipc::IPCResult
202
0
                return MsgProcessingError;
203
0
            }
204
0
205
0
            return MsgProcessed;
206
0
        }
207
0
    case PBackgroundLocalStorageCache::Reply___delete____ID:
208
0
        {
209
0
            return MsgProcessed;
210
0
        }
211
0
    default:
212
0
        {
213
0
            return MsgNotKnown;
214
0
        }
215
0
    }
216
0
}
217
218
auto PBackgroundLocalStorageCacheParent::OnMessageReceived(
219
        const Message& msg__,
220
        Message*& reply__) -> PBackgroundLocalStorageCacheParent::Result
221
0
{
222
0
    return MsgNotKnown;
223
0
}
224
225
auto PBackgroundLocalStorageCacheParent::OnCallReceived(
226
        const Message& msg__,
227
        Message*& reply__) -> PBackgroundLocalStorageCacheParent::Result
228
0
{
229
0
    MOZ_ASSERT_UNREACHABLE("message protocol not supported");
230
0
    return MsgNotKnown;
231
0
}
232
233
auto PBackgroundLocalStorageCacheParent::GetProtocolTypeId() -> int32_t
234
0
{
235
0
    return PBackgroundLocalStorageCacheMsgStart;
236
0
}
237
238
auto PBackgroundLocalStorageCacheParent::DestroySubtree(ActorDestroyReason why) -> void
239
0
{
240
0
    // Unregister from our manager.
241
0
    Unregister(Id());
242
0
243
0
    // Reject owning pending responses.
244
0
    (GetIPCChannel())->RejectPendingResponsesForActor(this);
245
0
246
0
    // Finally, destroy "us".
247
0
    ActorDestroy(why);
248
0
}
249
250
auto PBackgroundLocalStorageCacheParent::DeallocSubtree() -> void
251
0
{
252
0
}
253
254
255
256
} // namespace dom
257
} // namespace mozilla
258
namespace mozilla {
259
namespace ipc {
260
auto IPDLParamTraits<mozilla::dom::PBackgroundLocalStorageCacheParent>::Write(
261
        IPC::Message* aMsg,
262
        mozilla::ipc::IProtocol* aActor,
263
        const paramType& aVar) -> void
264
0
{
265
0
    int32_t id;
266
0
    if ((!(aVar))) {
267
0
        id = 0;
268
0
    }
269
0
    else {
270
0
        id = (aVar)->Id();
271
0
        if ((1) == (id)) {
272
0
            (aActor)->FatalError("actor has been |delete|d");
273
0
        }
274
0
    }
275
0
    WriteIPDLParam(aMsg, aActor, id);
276
0
}
277
278
auto IPDLParamTraits<mozilla::dom::PBackgroundLocalStorageCacheParent>::Read(
279
        const IPC::Message* aMsg,
280
        PickleIterator* aIter,
281
        mozilla::ipc::IProtocol* aActor,
282
        paramType* aVar) -> bool
283
0
{
284
0
    mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PBackgroundLocalStorageCache", PBackgroundLocalStorageCacheMsgStart);
285
0
    if ((actor).isNothing()) {
286
0
        return false;
287
0
    }
288
0
289
0
    (*(aVar)) = static_cast<mozilla::dom::PBackgroundLocalStorageCacheParent*>((actor).value());
290
0
    return true;
291
0
}
292
293
} // namespace ipc
294
} // namespace mozilla