Coverage Report

Created: 2018-09-25 14:53

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