Coverage Report

Created: 2018-09-25 14:53

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