Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/ipc/ipdl/PFilePickerChild.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/PFilePickerChild.h"
8
#include "ipc/IPCMessageUtils.h"
9
10
#include "mozilla/dom/PBrowserChild.h"
11
#include "mozilla/ipc/PChildToParentStreamChild.h"
12
#include "mozilla/ipc/PIPCBlobInputStreamChild.h"
13
#include "mozilla/ipc/PFileDescriptorSetChild.h"
14
#include "mozilla/ipc/PParentToChildStreamChild.h"
15
16
#include "nsIFile.h"
17
#include "GeckoProfiler.h"
18
19
namespace mozilla {
20
namespace dom {
21
22
23
auto PFilePickerChild::Recv__delete__(
24
        const MaybeInputData& data,
25
        const int16_t& result) -> mozilla::ipc::IPCResult
26
0
{
27
0
    return IPC_OK();
28
0
}
29
30
auto PFilePickerChild::ActorDestroy(ActorDestroyReason aWhy) -> void
31
0
{
32
0
}
33
34
MOZ_IMPLICIT PFilePickerChild::PFilePickerChild() :
35
    mozilla::ipc::IProtocol(mozilla::ipc::ChildSide),
36
    mLivenessState(mozilla::ipc::LivenessState::Dead)
37
0
{
38
0
    MOZ_COUNT_CTOR(PFilePickerChild);
39
0
}
40
41
PFilePickerChild::~PFilePickerChild()
42
0
{
43
0
    MOZ_COUNT_DTOR(PFilePickerChild);
44
0
}
45
46
auto PFilePickerChild::Manager() const -> PBrowserChild*
47
0
{
48
0
    return static_cast<PBrowserChild*>(IProtocol::Manager());
49
0
}
50
51
auto PFilePickerChild::SendOpen(
52
        const int16_t& selectedType,
53
        const bool& addToRecentDocs,
54
        const nsString& defaultFile,
55
        const nsString& defaultExtension,
56
        const nsTArray<nsString>& filters,
57
        const nsTArray<nsString>& filterNames,
58
        const nsString& displayDirectory,
59
        const nsString& displaySpecialDirectory,
60
        const nsString& okButtonLabel) -> bool
61
0
{
62
0
    IPC::Message* msg__ = PFilePicker::Msg_Open(Id());
63
0
64
0
    WriteIPDLParam(msg__, this, selectedType);
65
0
    // Sentinel = 'selectedType'
66
0
    (msg__)->WriteSentinel(2754221735);
67
0
    WriteIPDLParam(msg__, this, addToRecentDocs);
68
0
    // Sentinel = 'addToRecentDocs'
69
0
    (msg__)->WriteSentinel(3834132697);
70
0
    WriteIPDLParam(msg__, this, defaultFile);
71
0
    // Sentinel = 'defaultFile'
72
0
    (msg__)->WriteSentinel(3931097842);
73
0
    WriteIPDLParam(msg__, this, defaultExtension);
74
0
    // Sentinel = 'defaultExtension'
75
0
    (msg__)->WriteSentinel(1359835382);
76
0
    WriteIPDLParam(msg__, this, filters);
77
0
    // Sentinel = 'filters'
78
0
    (msg__)->WriteSentinel(4001190422);
79
0
    WriteIPDLParam(msg__, this, filterNames);
80
0
    // Sentinel = 'filterNames'
81
0
    (msg__)->WriteSentinel(1860280721);
82
0
    WriteIPDLParam(msg__, this, displayDirectory);
83
0
    // Sentinel = 'displayDirectory'
84
0
    (msg__)->WriteSentinel(2246103527);
85
0
    WriteIPDLParam(msg__, this, displaySpecialDirectory);
86
0
    // Sentinel = 'displaySpecialDirectory'
87
0
    (msg__)->WriteSentinel(4025076023);
88
0
    WriteIPDLParam(msg__, this, okButtonLabel);
89
0
    // Sentinel = 'okButtonLabel'
90
0
    (msg__)->WriteSentinel(670178141);
91
0
92
0
93
0
94
0
95
0
    if (mozilla::ipc::LoggingEnabledFor("PFilePickerChild")) {
96
0
        mozilla::ipc::LogMessageForProtocol("PFilePickerChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
97
0
    }
98
0
    AUTO_PROFILER_LABEL("PFilePicker::Msg_Open", OTHER);
99
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
100
0
        mozilla::ipc::LogicError("Transition error");
101
0
    }
102
0
103
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
104
0
    return sendok__;
105
0
}
106
107
auto PFilePickerChild::RemoveManagee(
108
        int32_t aProtocolId,
109
        IProtocol* aListener) -> void
110
0
{
111
0
    FatalError("unreached");
112
0
    return;
113
0
}
114
115
auto PFilePickerChild::OnMessageReceived(const Message& msg__) -> PFilePickerChild::Result
116
0
{
117
0
    switch ((msg__).type()) {
118
0
    case PFilePicker::Msg___delete____ID:
119
0
        {
120
0
            if (mozilla::ipc::LoggingEnabledFor("PFilePickerChild")) {
121
0
                mozilla::ipc::LogMessageForProtocol("PFilePickerChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
122
0
            }
123
0
            AUTO_PROFILER_LABEL("PFilePicker::Msg___delete__", OTHER);
124
0
125
0
            PickleIterator iter__(msg__);
126
0
            PFilePickerChild* actor;
127
0
            MaybeInputData data;
128
0
            int16_t result;
129
0
130
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(actor)))))) {
131
0
                FatalError("Error deserializing 'PFilePickerChild'");
132
0
                return MsgValueError;
133
0
            }
134
0
            if ((!((*((&(actor))))))) {
135
0
                FatalError("Error deserializing 'PFilePickerChild'");
136
0
                return MsgValueError;
137
0
            }
138
0
            // Sentinel = 'actor'
139
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) {
140
0
                mozilla::ipc::SentinelReadError("Error deserializing 'PFilePickerChild'");
141
0
                return MsgValueError;
142
0
            }
143
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(data)))))) {
144
0
                FatalError("Error deserializing 'MaybeInputData'");
145
0
                return MsgValueError;
146
0
            }
147
0
            // Sentinel = 'data'
148
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 843352540)))) {
149
0
                mozilla::ipc::SentinelReadError("Error deserializing 'MaybeInputData'");
150
0
                return MsgValueError;
151
0
            }
152
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(result)))))) {
153
0
                FatalError("Error deserializing 'int16_t'");
154
0
                return MsgValueError;
155
0
            }
156
0
            // Sentinel = 'result'
157
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3991766165)))) {
158
0
                mozilla::ipc::SentinelReadError("Error deserializing 'int16_t'");
159
0
                return MsgValueError;
160
0
            }
161
0
            (msg__).EndRead(iter__, (msg__).type());
162
0
            if ((!(StateTransition(true, (&(mLivenessState)))))) {
163
0
                FatalError("Transition error");
164
0
                return MsgValueError;
165
0
            }
166
0
            if ((!(Recv__delete__(data, result)))) {
167
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
168
0
                // Error handled in mozilla::ipc::IPCResult
169
0
                return MsgProcessingError;
170
0
            }
171
0
172
0
173
0
            IProtocol* mgr = (actor)->Manager();
174
0
            (actor)->DestroySubtree(Deletion);
175
0
            (actor)->DeallocSubtree();
176
0
            (mgr)->RemoveManagee(PFilePickerMsgStart, actor);
177
0
178
0
            return MsgProcessed;
179
0
        }
180
0
    default:
181
0
        {
182
0
            return MsgNotKnown;
183
0
        }
184
0
    }
185
0
}
186
187
auto PFilePickerChild::OnMessageReceived(
188
        const Message& msg__,
189
        Message*& reply__) -> PFilePickerChild::Result
190
0
{
191
0
    return MsgNotKnown;
192
0
}
193
194
auto PFilePickerChild::OnCallReceived(
195
        const Message& msg__,
196
        Message*& reply__) -> PFilePickerChild::Result
197
0
{
198
0
    MOZ_ASSERT_UNREACHABLE("message protocol not supported");
199
0
    return MsgNotKnown;
200
0
}
201
202
auto PFilePickerChild::GetProtocolTypeId() -> int32_t
203
0
{
204
0
    return PFilePickerMsgStart;
205
0
}
206
207
auto PFilePickerChild::DestroySubtree(ActorDestroyReason why) -> void
208
0
{
209
0
    // Unregister from our manager.
210
0
    Unregister(Id());
211
0
212
0
    // Reject owning pending responses.
213
0
    (GetIPCChannel())->RejectPendingResponsesForActor(this);
214
0
215
0
    // Finally, destroy "us".
216
0
    ActorDestroy(why);
217
0
}
218
219
auto PFilePickerChild::DeallocSubtree() -> void
220
0
{
221
0
}
222
223
224
225
} // namespace dom
226
} // namespace mozilla
227
namespace mozilla {
228
namespace ipc {
229
auto IPDLParamTraits<mozilla::dom::PFilePickerChild>::Write(
230
        IPC::Message* aMsg,
231
        mozilla::ipc::IProtocol* aActor,
232
        const paramType& aVar) -> void
233
0
{
234
0
    int32_t id;
235
0
    if ((!(aVar))) {
236
0
        id = 0;
237
0
    }
238
0
    else {
239
0
        id = (aVar)->Id();
240
0
        if ((1) == (id)) {
241
0
            (aActor)->FatalError("actor has been |delete|d");
242
0
        }
243
0
    }
244
0
    WriteIPDLParam(aMsg, aActor, id);
245
0
}
246
247
auto IPDLParamTraits<mozilla::dom::PFilePickerChild>::Read(
248
        const IPC::Message* aMsg,
249
        PickleIterator* aIter,
250
        mozilla::ipc::IProtocol* aActor,
251
        paramType* aVar) -> bool
252
0
{
253
0
    mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PFilePicker", PFilePickerMsgStart);
254
0
    if ((actor).isNothing()) {
255
0
        return false;
256
0
    }
257
0
258
0
    (*(aVar)) = static_cast<mozilla::dom::PFilePickerChild*>((actor).value());
259
0
    return true;
260
0
}
261
262
} // namespace ipc
263
} // namespace mozilla