Coverage Report

Created: 2018-09-25 14:53

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