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