Coverage Report

Created: 2018-09-25 14:53

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