Merge lp:~raof/mir/fewer-nasal-daemons into lp:mir
- fewer-nasal-daemons
- Merge into development-branch
Status: | Merged |
---|---|
Approved by: | Alan Griffiths |
Approved revision: | no longer in the source branch. |
Merged at revision: | 4275 |
Proposed branch: | lp:~raof/mir/fewer-nasal-daemons |
Merge into: | lp:mir |
Diff against target: |
1394 lines (+841/-82) 5 files modified
include/common/mir/log.h (+12/-1) src/common/log.cpp (+35/-0) src/protocol/wrapper_generator.cpp (+47/-19) src/server/frontend/wayland/core_generated_interfaces.h (+734/-61) src/server/frontend/wayland/wayland_connector.cpp (+13/-1) |
To merge this branch: | bzr merge lp:~raof/mir/fewer-nasal-daemons |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alan Griffiths | Approve | ||
Mir CI Bot | continuous-integration | Approve | |
Review via email: mp+331380@code.launchpad.net |
Commit message
Wayland: Prevent C++ exceptions escaping into C code.
That invokes undefined behaviour, and, in practice, results in GCC-built code aborting.
Description of the change
Mir CI Bot (mir-ci-bot) wrote : | # |
Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:4283
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Alan Griffiths (alan-griffiths) wrote : | # |
+ try
+ {
+ me->subtract(x, y, width, height);
+ }
+ catch(std:
+ {
+ ::mir::log(
+ ::mir::
+ "frontend:Wayland",
+ "Exception processing Region::subtract() request: %s",
+ boost::
+ }
+ catch (...)
+ {
+ ::mir::log(
+ ::mir::
+ "frontend:Wayland",
+ "Unknown exception processing Region::subtract() request");
+ }
Couldn't this repeated code be extracted into a function? Similar to mir::report_
Chris Halse Rogers (raof) wrote : | # |
I was thinking of a mir::log_
Mir CI Bot (mir-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:4285
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Preview Diff
1 | === modified file 'include/common/mir/log.h' | |||
2 | --- include/common/mir/log.h 2017-07-28 17:00:43 +0000 | |||
3 | +++ include/common/mir/log.h 2017-09-27 16:01:58 +0000 | |||
4 | @@ -34,6 +34,11 @@ | |||
5 | 34 | char const* fmt, ...); | 34 | char const* fmt, ...); |
6 | 35 | void log(logging::Severity sev, const char *component, | 35 | void log(logging::Severity sev, const char *component, |
7 | 36 | std::string const& message); | 36 | std::string const& message); |
8 | 37 | void log( | ||
9 | 38 | logging::Severity sev, | ||
10 | 39 | char const* component, | ||
11 | 40 | std::exception_ptr const& exception, | ||
12 | 41 | std::string const& message); | ||
13 | 37 | 42 | ||
14 | 38 | #ifndef MIR_LOG_COMPONENT | 43 | #ifndef MIR_LOG_COMPONENT |
15 | 39 | #ifdef MIR_LOG_COMPONENT_FALLBACK | 44 | #ifdef MIR_LOG_COMPONENT_FALLBACK |
16 | @@ -79,6 +84,13 @@ | |||
17 | 79 | MIR_LOG_COMPONENT, message); | 84 | MIR_LOG_COMPONENT, message); |
18 | 80 | } | 85 | } |
19 | 81 | 86 | ||
20 | 87 | template<typename... Args> | ||
21 | 88 | void log_critical(char const* fmt, Args&&... args) | ||
22 | 89 | { | ||
23 | 90 | ::mir::log(::mir::logging::Severity::critical, | ||
24 | 91 | MIR_LOG_COMPONENT, fmt, std::forward<Args>(args)...); | ||
25 | 92 | } | ||
26 | 93 | |||
27 | 82 | inline void log_error(std::string const& message) | 94 | inline void log_error(std::string const& message) |
28 | 83 | { | 95 | { |
29 | 84 | ::mir::log(::mir::logging::Severity::error, | 96 | ::mir::log(::mir::logging::Severity::error, |
30 | @@ -97,7 +109,6 @@ | |||
31 | 97 | ::mir::log(::mir::logging::Severity::warning, | 109 | ::mir::log(::mir::logging::Severity::warning, |
32 | 98 | MIR_LOG_COMPONENT, fmt, std::forward<Args>(args)...); | 110 | MIR_LOG_COMPONENT, fmt, std::forward<Args>(args)...); |
33 | 99 | } | 111 | } |
34 | 100 | |||
35 | 101 | } // (nested anonymous) namespace | 112 | } // (nested anonymous) namespace |
36 | 102 | #endif | 113 | #endif |
37 | 103 | 114 | ||
38 | 104 | 115 | ||
39 | === modified file 'src/common/log.cpp' | |||
40 | --- src/common/log.cpp 2017-07-28 17:00:43 +0000 | |||
41 | +++ src/common/log.cpp 2017-09-27 16:01:58 +0000 | |||
42 | @@ -20,6 +20,9 @@ | |||
43 | 20 | #include "mir/logging/logger.h" | 20 | #include "mir/logging/logger.h" |
44 | 21 | #include <cstdio> | 21 | #include <cstdio> |
45 | 22 | 22 | ||
46 | 23 | #include <exception> | ||
47 | 24 | #include <boost/exception/diagnostic_information.hpp> | ||
48 | 25 | |||
49 | 23 | namespace mir { | 26 | namespace mir { |
50 | 24 | 27 | ||
51 | 25 | void logv(logging::Severity sev, char const* component, | 28 | void logv(logging::Severity sev, char const* component, |
52 | @@ -51,4 +54,36 @@ | |||
53 | 51 | logging::log(sev, message, component); | 54 | logging::log(sev, message, component); |
54 | 52 | } | 55 | } |
55 | 53 | 56 | ||
56 | 57 | |||
57 | 58 | void log( | ||
58 | 59 | logging::Severity severity, | ||
59 | 60 | char const* component, | ||
60 | 61 | std::exception_ptr const& ex, | ||
61 | 62 | std::string const& message) | ||
62 | 63 | { | ||
63 | 64 | try | ||
64 | 65 | { | ||
65 | 66 | std::rethrow_exception(ex); | ||
66 | 67 | } | ||
67 | 68 | catch(std::exception const& err) | ||
68 | 69 | { | ||
69 | 70 | // TODO: We can probably format this better by pulling out | ||
70 | 71 | // the boost::errinfo's ourselves. | ||
71 | 72 | mir::log( | ||
72 | 73 | severity, | ||
73 | 74 | component, | ||
74 | 75 | "%s: %s", | ||
75 | 76 | message.c_str(), | ||
76 | 77 | boost::diagnostic_information(err).c_str()); | ||
77 | 78 | } | ||
78 | 79 | catch(...) | ||
79 | 80 | { | ||
80 | 81 | mir::log( | ||
81 | 82 | severity, | ||
82 | 83 | component, | ||
83 | 84 | "%s: unknown exception", | ||
84 | 85 | message.c_str()); | ||
85 | 86 | } | ||
86 | 87 | } | ||
87 | 88 | |||
88 | 54 | } // namespace mir | 89 | } // namespace mir |
89 | 55 | 90 | ||
90 | === modified file 'src/protocol/wrapper_generator.cpp' | |||
91 | --- src/protocol/wrapper_generator.cpp 2017-09-25 15:34:10 +0000 | |||
92 | +++ src/protocol/wrapper_generator.cpp 2017-09-27 16:01:58 +0000 | |||
93 | @@ -41,11 +41,13 @@ | |||
94 | 41 | { | 41 | { |
95 | 42 | std::cout << "#include <experimental/optional>" << std::endl; | 42 | std::cout << "#include <experimental/optional>" << std::endl; |
96 | 43 | std::cout << "#include <boost/throw_exception.hpp>" << std::endl; | 43 | std::cout << "#include <boost/throw_exception.hpp>" << std::endl; |
97 | 44 | std::cout << "#include <boost/exception/diagnostic_information.hpp>" << std::endl; | ||
98 | 44 | std::cout << std::endl; | 45 | std::cout << std::endl; |
99 | 45 | std::cout << "#include <wayland-server.h>" << std::endl; | 46 | std::cout << "#include <wayland-server.h>" << std::endl; |
100 | 46 | std::cout << "#include <wayland-server-protocol.h>" << std::endl; | 47 | std::cout << "#include <wayland-server-protocol.h>" << std::endl; |
101 | 47 | std::cout << std::endl; | 48 | std::cout << std::endl; |
102 | 48 | std::cout << "#include \"mir/fd.h\"" << std::endl; | 49 | std::cout << "#include \"mir/fd.h\"" << std::endl; |
103 | 50 | std::cout << "#include \"mir/log.h\"" << std::endl; | ||
104 | 49 | } | 51 | } |
105 | 50 | 52 | ||
106 | 51 | std::string strip_wl_prefix(std::string const& name) | 53 | std::string strip_wl_prefix(std::string const& name) |
107 | @@ -121,6 +123,20 @@ | |||
108 | 121 | return false; | 123 | return false; |
109 | 122 | } | 124 | } |
110 | 123 | 125 | ||
111 | 126 | void emit_indented_lines(std::ostream& out, std::string const& indent, | ||
112 | 127 | std::initializer_list<std::initializer_list<std::string>> lines) | ||
113 | 128 | { | ||
114 | 129 | for (auto const& line : lines) | ||
115 | 130 | { | ||
116 | 131 | out << indent; | ||
117 | 132 | for (auto const& fragment : line) | ||
118 | 133 | { | ||
119 | 134 | out << fragment; | ||
120 | 135 | } | ||
121 | 136 | out << std::endl; | ||
122 | 137 | } | ||
123 | 138 | } | ||
124 | 139 | |||
125 | 124 | class Interface; | 140 | class Interface; |
126 | 125 | 141 | ||
127 | 126 | class Argument | 142 | class Argument |
128 | @@ -216,15 +232,27 @@ | |||
129 | 216 | } | 232 | } |
130 | 217 | out << ")" << std::endl; | 233 | out << ")" << std::endl; |
131 | 218 | 234 | ||
135 | 219 | out << indent << "{" << std::endl; | 235 | emit_indented_lines( |
136 | 220 | out << indent << " auto me = static_cast<" << interface_type << "*>(" | 236 | out, |
137 | 221 | << "wl_resource_get_user_data(resource));" << std::endl; | 237 | indent, |
138 | 238 | { | ||
139 | 239 | {"{"}, | ||
140 | 240 | {" auto me = static_cast<", interface_type, "*>(wl_resource_get_user_data(resource));"} | ||
141 | 241 | }); | ||
142 | 242 | |||
143 | 222 | for (auto const& arg : arguments) | 243 | for (auto const& arg : arguments) |
144 | 223 | { | 244 | { |
145 | 224 | arg.emit_thunk_converter(out, indent + " "); | 245 | arg.emit_thunk_converter(out, indent + " "); |
146 | 225 | } | 246 | } |
147 | 226 | 247 | ||
149 | 227 | out << indent << " me->" << name << "("; | 248 | emit_indented_lines( |
150 | 249 | out, | ||
151 | 250 | indent, | ||
152 | 251 | { | ||
153 | 252 | {" try"}, | ||
154 | 253 | {" {"}, | ||
155 | 254 | }); | ||
156 | 255 | out << indent << " me->" << name << "("; | ||
157 | 228 | if (is_global) | 256 | if (is_global) |
158 | 229 | { | 257 | { |
159 | 230 | out << "client, resource"; | 258 | out << "client, resource"; |
160 | @@ -243,7 +271,21 @@ | |||
161 | 243 | } | 271 | } |
162 | 244 | out << ");" << std::endl; | 272 | out << ");" << std::endl; |
163 | 245 | 273 | ||
165 | 246 | out << indent << "}" << std::endl; | 274 | emit_indented_lines( |
166 | 275 | out, | ||
167 | 276 | indent, | ||
168 | 277 | { | ||
169 | 278 | {" }"}, | ||
170 | 279 | {" catch(...)"}, | ||
171 | 280 | {" {"}, | ||
172 | 281 | {" ::mir::log("}, | ||
173 | 282 | {" ::mir::logging::Severity::critical,"}, | ||
174 | 283 | {" \"frontend:Wayland\","}, | ||
175 | 284 | {" std::current_exception(),"}, | ||
176 | 285 | {" \"Exception processing ", interface_type, "::", name, "() request\");"}, | ||
177 | 286 | {" }"}, | ||
178 | 287 | {"}"} | ||
179 | 288 | }); | ||
180 | 247 | } | 289 | } |
181 | 248 | 290 | ||
182 | 249 | void emit_vtable_initialiser(std::ostream& out, std::string const& indent) const | 291 | void emit_vtable_initialiser(std::ostream& out, std::string const& indent) const |
183 | @@ -256,20 +298,6 @@ | |||
184 | 256 | std::vector<Argument> arguments; | 298 | std::vector<Argument> arguments; |
185 | 257 | }; | 299 | }; |
186 | 258 | 300 | ||
187 | 259 | void emit_indented_lines(std::ostream& out, std::string const& indent, | ||
188 | 260 | std::initializer_list<std::initializer_list<std::string>> lines) | ||
189 | 261 | { | ||
190 | 262 | for (auto const& line : lines) | ||
191 | 263 | { | ||
192 | 264 | out << indent; | ||
193 | 265 | for (auto const& fragment : line) | ||
194 | 266 | { | ||
195 | 267 | out << fragment; | ||
196 | 268 | } | ||
197 | 269 | out << std::endl; | ||
198 | 270 | } | ||
199 | 271 | } | ||
200 | 272 | |||
201 | 273 | class Interface | 301 | class Interface |
202 | 274 | { | 302 | { |
203 | 275 | public: | 303 | public: |
204 | 276 | 304 | ||
205 | === modified file 'src/server/frontend/wayland/core_generated_interfaces.h' | |||
206 | --- src/server/frontend/wayland/core_generated_interfaces.h 2017-09-25 15:34:10 +0000 | |||
207 | +++ src/server/frontend/wayland/core_generated_interfaces.h 2017-09-27 16:01:58 +0000 | |||
208 | @@ -7,11 +7,13 @@ | |||
209 | 7 | 7 | ||
210 | 8 | #include <experimental/optional> | 8 | #include <experimental/optional> |
211 | 9 | #include <boost/throw_exception.hpp> | 9 | #include <boost/throw_exception.hpp> |
212 | 10 | #include <boost/exception/diagnostic_information.hpp> | ||
213 | 10 | 11 | ||
214 | 11 | #include <wayland-server.h> | 12 | #include <wayland-server.h> |
215 | 12 | #include <wayland-server-protocol.h> | 13 | #include <wayland-server-protocol.h> |
216 | 13 | 14 | ||
217 | 14 | #include "mir/fd.h" | 15 | #include "mir/fd.h" |
218 | 16 | #include "mir/log.h" | ||
219 | 15 | 17 | ||
220 | 16 | namespace mir | 18 | namespace mir |
221 | 17 | { | 19 | { |
222 | @@ -64,13 +66,35 @@ | |||
223 | 64 | static void create_surface_thunk(struct wl_client* client, struct wl_resource* resource, uint32_t id) | 66 | static void create_surface_thunk(struct wl_client* client, struct wl_resource* resource, uint32_t id) |
224 | 65 | { | 67 | { |
225 | 66 | auto me = static_cast<Compositor*>(wl_resource_get_user_data(resource)); | 68 | auto me = static_cast<Compositor*>(wl_resource_get_user_data(resource)); |
227 | 67 | me->create_surface(client, resource, id); | 69 | try |
228 | 70 | { | ||
229 | 71 | me->create_surface(client, resource, id); | ||
230 | 72 | } | ||
231 | 73 | catch(...) | ||
232 | 74 | { | ||
233 | 75 | ::mir::log( | ||
234 | 76 | ::mir::logging::Severity::critical, | ||
235 | 77 | "frontend:Wayland", | ||
236 | 78 | std::current_exception(), | ||
237 | 79 | "Exception processing Compositor::create_surface() request"); | ||
238 | 80 | } | ||
239 | 68 | } | 81 | } |
240 | 69 | 82 | ||
241 | 70 | static void create_region_thunk(struct wl_client* client, struct wl_resource* resource, uint32_t id) | 83 | static void create_region_thunk(struct wl_client* client, struct wl_resource* resource, uint32_t id) |
242 | 71 | { | 84 | { |
243 | 72 | auto me = static_cast<Compositor*>(wl_resource_get_user_data(resource)); | 85 | auto me = static_cast<Compositor*>(wl_resource_get_user_data(resource)); |
245 | 73 | me->create_region(client, resource, id); | 86 | try |
246 | 87 | { | ||
247 | 88 | me->create_region(client, resource, id); | ||
248 | 89 | } | ||
249 | 90 | catch(...) | ||
250 | 91 | { | ||
251 | 92 | ::mir::log( | ||
252 | 93 | ::mir::logging::Severity::critical, | ||
253 | 94 | "frontend:Wayland", | ||
254 | 95 | std::current_exception(), | ||
255 | 96 | "Exception processing Compositor::create_region() request"); | ||
256 | 97 | } | ||
257 | 74 | } | 98 | } |
258 | 75 | 99 | ||
259 | 76 | static void bind(struct wl_client* client, void* data, uint32_t version, uint32_t id) | 100 | static void bind(struct wl_client* client, void* data, uint32_t version, uint32_t id) |
260 | @@ -123,19 +147,52 @@ | |||
261 | 123 | static void create_buffer_thunk(struct wl_client*, struct wl_resource* resource, uint32_t id, int32_t offset, int32_t width, int32_t height, int32_t stride, uint32_t format) | 147 | static void create_buffer_thunk(struct wl_client*, struct wl_resource* resource, uint32_t id, int32_t offset, int32_t width, int32_t height, int32_t stride, uint32_t format) |
262 | 124 | { | 148 | { |
263 | 125 | auto me = static_cast<ShmPool*>(wl_resource_get_user_data(resource)); | 149 | auto me = static_cast<ShmPool*>(wl_resource_get_user_data(resource)); |
265 | 126 | me->create_buffer(id, offset, width, height, stride, format); | 150 | try |
266 | 151 | { | ||
267 | 152 | me->create_buffer(id, offset, width, height, stride, format); | ||
268 | 153 | } | ||
269 | 154 | catch(...) | ||
270 | 155 | { | ||
271 | 156 | ::mir::log( | ||
272 | 157 | ::mir::logging::Severity::critical, | ||
273 | 158 | "frontend:Wayland", | ||
274 | 159 | std::current_exception(), | ||
275 | 160 | "Exception processing ShmPool::create_buffer() request"); | ||
276 | 161 | } | ||
277 | 127 | } | 162 | } |
278 | 128 | 163 | ||
279 | 129 | static void destroy_thunk(struct wl_client*, struct wl_resource* resource) | 164 | static void destroy_thunk(struct wl_client*, struct wl_resource* resource) |
280 | 130 | { | 165 | { |
281 | 131 | auto me = static_cast<ShmPool*>(wl_resource_get_user_data(resource)); | 166 | auto me = static_cast<ShmPool*>(wl_resource_get_user_data(resource)); |
283 | 132 | me->destroy(); | 167 | try |
284 | 168 | { | ||
285 | 169 | me->destroy(); | ||
286 | 170 | } | ||
287 | 171 | catch(...) | ||
288 | 172 | { | ||
289 | 173 | ::mir::log( | ||
290 | 174 | ::mir::logging::Severity::critical, | ||
291 | 175 | "frontend:Wayland", | ||
292 | 176 | std::current_exception(), | ||
293 | 177 | "Exception processing ShmPool::destroy() request"); | ||
294 | 178 | } | ||
295 | 133 | } | 179 | } |
296 | 134 | 180 | ||
297 | 135 | static void resize_thunk(struct wl_client*, struct wl_resource* resource, int32_t size) | 181 | static void resize_thunk(struct wl_client*, struct wl_resource* resource, int32_t size) |
298 | 136 | { | 182 | { |
299 | 137 | auto me = static_cast<ShmPool*>(wl_resource_get_user_data(resource)); | 183 | auto me = static_cast<ShmPool*>(wl_resource_get_user_data(resource)); |
301 | 138 | me->resize(size); | 184 | try |
302 | 185 | { | ||
303 | 186 | me->resize(size); | ||
304 | 187 | } | ||
305 | 188 | catch(...) | ||
306 | 189 | { | ||
307 | 190 | ::mir::log( | ||
308 | 191 | ::mir::logging::Severity::critical, | ||
309 | 192 | "frontend:Wayland", | ||
310 | 193 | std::current_exception(), | ||
311 | 194 | "Exception processing ShmPool::resize() request"); | ||
312 | 195 | } | ||
313 | 139 | } | 196 | } |
314 | 140 | 197 | ||
315 | 141 | static void resource_destroyed_thunk(wl_resource* us) | 198 | static void resource_destroyed_thunk(wl_resource* us) |
316 | @@ -174,7 +231,18 @@ | |||
317 | 174 | { | 231 | { |
318 | 175 | auto me = static_cast<Shm*>(wl_resource_get_user_data(resource)); | 232 | auto me = static_cast<Shm*>(wl_resource_get_user_data(resource)); |
319 | 176 | mir::Fd fd_resolved{fd}; | 233 | mir::Fd fd_resolved{fd}; |
321 | 177 | me->create_pool(client, resource, id, fd_resolved, size); | 234 | try |
322 | 235 | { | ||
323 | 236 | me->create_pool(client, resource, id, fd_resolved, size); | ||
324 | 237 | } | ||
325 | 238 | catch(...) | ||
326 | 239 | { | ||
327 | 240 | ::mir::log( | ||
328 | 241 | ::mir::logging::Severity::critical, | ||
329 | 242 | "frontend:Wayland", | ||
330 | 243 | std::current_exception(), | ||
331 | 244 | "Exception processing Shm::create_pool() request"); | ||
332 | 245 | } | ||
333 | 178 | } | 246 | } |
334 | 179 | 247 | ||
335 | 180 | static void bind(struct wl_client* client, void* data, uint32_t version, uint32_t id) | 248 | static void bind(struct wl_client* client, void* data, uint32_t version, uint32_t id) |
336 | @@ -224,7 +292,18 @@ | |||
337 | 224 | static void destroy_thunk(struct wl_client*, struct wl_resource* resource) | 292 | static void destroy_thunk(struct wl_client*, struct wl_resource* resource) |
338 | 225 | { | 293 | { |
339 | 226 | auto me = static_cast<Buffer*>(wl_resource_get_user_data(resource)); | 294 | auto me = static_cast<Buffer*>(wl_resource_get_user_data(resource)); |
341 | 227 | me->destroy(); | 295 | try |
342 | 296 | { | ||
343 | 297 | me->destroy(); | ||
344 | 298 | } | ||
345 | 299 | catch(...) | ||
346 | 300 | { | ||
347 | 301 | ::mir::log( | ||
348 | 302 | ::mir::logging::Severity::critical, | ||
349 | 303 | "frontend:Wayland", | ||
350 | 304 | std::current_exception(), | ||
351 | 305 | "Exception processing Buffer::destroy() request"); | ||
352 | 306 | } | ||
353 | 228 | } | 307 | } |
354 | 229 | 308 | ||
355 | 230 | static void resource_destroyed_thunk(wl_resource* us) | 309 | static void resource_destroyed_thunk(wl_resource* us) |
356 | @@ -273,32 +352,87 @@ | |||
357 | 273 | { | 352 | { |
358 | 274 | mime_type_resolved = std::experimental::make_optional<std::string>(mime_type); | 353 | mime_type_resolved = std::experimental::make_optional<std::string>(mime_type); |
359 | 275 | } | 354 | } |
361 | 276 | me->accept(serial, mime_type_resolved); | 355 | try |
362 | 356 | { | ||
363 | 357 | me->accept(serial, mime_type_resolved); | ||
364 | 358 | } | ||
365 | 359 | catch(...) | ||
366 | 360 | { | ||
367 | 361 | ::mir::log( | ||
368 | 362 | ::mir::logging::Severity::critical, | ||
369 | 363 | "frontend:Wayland", | ||
370 | 364 | std::current_exception(), | ||
371 | 365 | "Exception processing DataOffer::accept() request"); | ||
372 | 366 | } | ||
373 | 277 | } | 367 | } |
374 | 278 | 368 | ||
375 | 279 | static void receive_thunk(struct wl_client*, struct wl_resource* resource, char const* mime_type, int fd) | 369 | static void receive_thunk(struct wl_client*, struct wl_resource* resource, char const* mime_type, int fd) |
376 | 280 | { | 370 | { |
377 | 281 | auto me = static_cast<DataOffer*>(wl_resource_get_user_data(resource)); | 371 | auto me = static_cast<DataOffer*>(wl_resource_get_user_data(resource)); |
378 | 282 | mir::Fd fd_resolved{fd}; | 372 | mir::Fd fd_resolved{fd}; |
380 | 283 | me->receive(mime_type, fd_resolved); | 373 | try |
381 | 374 | { | ||
382 | 375 | me->receive(mime_type, fd_resolved); | ||
383 | 376 | } | ||
384 | 377 | catch(...) | ||
385 | 378 | { | ||
386 | 379 | ::mir::log( | ||
387 | 380 | ::mir::logging::Severity::critical, | ||
388 | 381 | "frontend:Wayland", | ||
389 | 382 | std::current_exception(), | ||
390 | 383 | "Exception processing DataOffer::receive() request"); | ||
391 | 384 | } | ||
392 | 284 | } | 385 | } |
393 | 285 | 386 | ||
394 | 286 | static void destroy_thunk(struct wl_client*, struct wl_resource* resource) | 387 | static void destroy_thunk(struct wl_client*, struct wl_resource* resource) |
395 | 287 | { | 388 | { |
396 | 288 | auto me = static_cast<DataOffer*>(wl_resource_get_user_data(resource)); | 389 | auto me = static_cast<DataOffer*>(wl_resource_get_user_data(resource)); |
398 | 289 | me->destroy(); | 390 | try |
399 | 391 | { | ||
400 | 392 | me->destroy(); | ||
401 | 393 | } | ||
402 | 394 | catch(...) | ||
403 | 395 | { | ||
404 | 396 | ::mir::log( | ||
405 | 397 | ::mir::logging::Severity::critical, | ||
406 | 398 | "frontend:Wayland", | ||
407 | 399 | std::current_exception(), | ||
408 | 400 | "Exception processing DataOffer::destroy() request"); | ||
409 | 401 | } | ||
410 | 290 | } | 402 | } |
411 | 291 | 403 | ||
412 | 292 | static void finish_thunk(struct wl_client*, struct wl_resource* resource) | 404 | static void finish_thunk(struct wl_client*, struct wl_resource* resource) |
413 | 293 | { | 405 | { |
414 | 294 | auto me = static_cast<DataOffer*>(wl_resource_get_user_data(resource)); | 406 | auto me = static_cast<DataOffer*>(wl_resource_get_user_data(resource)); |
416 | 295 | me->finish(); | 407 | try |
417 | 408 | { | ||
418 | 409 | me->finish(); | ||
419 | 410 | } | ||
420 | 411 | catch(...) | ||
421 | 412 | { | ||
422 | 413 | ::mir::log( | ||
423 | 414 | ::mir::logging::Severity::critical, | ||
424 | 415 | "frontend:Wayland", | ||
425 | 416 | std::current_exception(), | ||
426 | 417 | "Exception processing DataOffer::finish() request"); | ||
427 | 418 | } | ||
428 | 296 | } | 419 | } |
429 | 297 | 420 | ||
430 | 298 | static void set_actions_thunk(struct wl_client*, struct wl_resource* resource, uint32_t dnd_actions, uint32_t preferred_action) | 421 | static void set_actions_thunk(struct wl_client*, struct wl_resource* resource, uint32_t dnd_actions, uint32_t preferred_action) |
431 | 299 | { | 422 | { |
432 | 300 | auto me = static_cast<DataOffer*>(wl_resource_get_user_data(resource)); | 423 | auto me = static_cast<DataOffer*>(wl_resource_get_user_data(resource)); |
434 | 301 | me->set_actions(dnd_actions, preferred_action); | 424 | try |
435 | 425 | { | ||
436 | 426 | me->set_actions(dnd_actions, preferred_action); | ||
437 | 427 | } | ||
438 | 428 | catch(...) | ||
439 | 429 | { | ||
440 | 430 | ::mir::log( | ||
441 | 431 | ::mir::logging::Severity::critical, | ||
442 | 432 | "frontend:Wayland", | ||
443 | 433 | std::current_exception(), | ||
444 | 434 | "Exception processing DataOffer::set_actions() request"); | ||
445 | 435 | } | ||
446 | 302 | } | 436 | } |
447 | 303 | 437 | ||
448 | 304 | static void resource_destroyed_thunk(wl_resource* us) | 438 | static void resource_destroyed_thunk(wl_resource* us) |
449 | @@ -344,19 +478,52 @@ | |||
450 | 344 | static void offer_thunk(struct wl_client*, struct wl_resource* resource, char const* mime_type) | 478 | static void offer_thunk(struct wl_client*, struct wl_resource* resource, char const* mime_type) |
451 | 345 | { | 479 | { |
452 | 346 | auto me = static_cast<DataSource*>(wl_resource_get_user_data(resource)); | 480 | auto me = static_cast<DataSource*>(wl_resource_get_user_data(resource)); |
454 | 347 | me->offer(mime_type); | 481 | try |
455 | 482 | { | ||
456 | 483 | me->offer(mime_type); | ||
457 | 484 | } | ||
458 | 485 | catch(...) | ||
459 | 486 | { | ||
460 | 487 | ::mir::log( | ||
461 | 488 | ::mir::logging::Severity::critical, | ||
462 | 489 | "frontend:Wayland", | ||
463 | 490 | std::current_exception(), | ||
464 | 491 | "Exception processing DataSource::offer() request"); | ||
465 | 492 | } | ||
466 | 348 | } | 493 | } |
467 | 349 | 494 | ||
468 | 350 | static void destroy_thunk(struct wl_client*, struct wl_resource* resource) | 495 | static void destroy_thunk(struct wl_client*, struct wl_resource* resource) |
469 | 351 | { | 496 | { |
470 | 352 | auto me = static_cast<DataSource*>(wl_resource_get_user_data(resource)); | 497 | auto me = static_cast<DataSource*>(wl_resource_get_user_data(resource)); |
472 | 353 | me->destroy(); | 498 | try |
473 | 499 | { | ||
474 | 500 | me->destroy(); | ||
475 | 501 | } | ||
476 | 502 | catch(...) | ||
477 | 503 | { | ||
478 | 504 | ::mir::log( | ||
479 | 505 | ::mir::logging::Severity::critical, | ||
480 | 506 | "frontend:Wayland", | ||
481 | 507 | std::current_exception(), | ||
482 | 508 | "Exception processing DataSource::destroy() request"); | ||
483 | 509 | } | ||
484 | 354 | } | 510 | } |
485 | 355 | 511 | ||
486 | 356 | static void set_actions_thunk(struct wl_client*, struct wl_resource* resource, uint32_t dnd_actions) | 512 | static void set_actions_thunk(struct wl_client*, struct wl_resource* resource, uint32_t dnd_actions) |
487 | 357 | { | 513 | { |
488 | 358 | auto me = static_cast<DataSource*>(wl_resource_get_user_data(resource)); | 514 | auto me = static_cast<DataSource*>(wl_resource_get_user_data(resource)); |
490 | 359 | me->set_actions(dnd_actions); | 515 | try |
491 | 516 | { | ||
492 | 517 | me->set_actions(dnd_actions); | ||
493 | 518 | } | ||
494 | 519 | catch(...) | ||
495 | 520 | { | ||
496 | 521 | ::mir::log( | ||
497 | 522 | ::mir::logging::Severity::critical, | ||
498 | 523 | "frontend:Wayland", | ||
499 | 524 | std::current_exception(), | ||
500 | 525 | "Exception processing DataSource::set_actions() request"); | ||
501 | 526 | } | ||
502 | 360 | } | 527 | } |
503 | 361 | 528 | ||
504 | 362 | static void resource_destroyed_thunk(wl_resource* us) | 529 | static void resource_destroyed_thunk(wl_resource* us) |
505 | @@ -410,7 +577,18 @@ | |||
506 | 410 | { | 577 | { |
507 | 411 | icon_resolved = icon; | 578 | icon_resolved = icon; |
508 | 412 | } | 579 | } |
510 | 413 | me->start_drag(source_resolved, origin, icon_resolved, serial); | 580 | try |
511 | 581 | { | ||
512 | 582 | me->start_drag(source_resolved, origin, icon_resolved, serial); | ||
513 | 583 | } | ||
514 | 584 | catch(...) | ||
515 | 585 | { | ||
516 | 586 | ::mir::log( | ||
517 | 587 | ::mir::logging::Severity::critical, | ||
518 | 588 | "frontend:Wayland", | ||
519 | 589 | std::current_exception(), | ||
520 | 590 | "Exception processing DataDevice::start_drag() request"); | ||
521 | 591 | } | ||
522 | 414 | } | 592 | } |
523 | 415 | 593 | ||
524 | 416 | static void set_selection_thunk(struct wl_client*, struct wl_resource* resource, struct wl_resource* source, uint32_t serial) | 594 | static void set_selection_thunk(struct wl_client*, struct wl_resource* resource, struct wl_resource* source, uint32_t serial) |
525 | @@ -421,13 +599,35 @@ | |||
526 | 421 | { | 599 | { |
527 | 422 | source_resolved = source; | 600 | source_resolved = source; |
528 | 423 | } | 601 | } |
530 | 424 | me->set_selection(source_resolved, serial); | 602 | try |
531 | 603 | { | ||
532 | 604 | me->set_selection(source_resolved, serial); | ||
533 | 605 | } | ||
534 | 606 | catch(...) | ||
535 | 607 | { | ||
536 | 608 | ::mir::log( | ||
537 | 609 | ::mir::logging::Severity::critical, | ||
538 | 610 | "frontend:Wayland", | ||
539 | 611 | std::current_exception(), | ||
540 | 612 | "Exception processing DataDevice::set_selection() request"); | ||
541 | 613 | } | ||
542 | 425 | } | 614 | } |
543 | 426 | 615 | ||
544 | 427 | static void release_thunk(struct wl_client*, struct wl_resource* resource) | 616 | static void release_thunk(struct wl_client*, struct wl_resource* resource) |
545 | 428 | { | 617 | { |
546 | 429 | auto me = static_cast<DataDevice*>(wl_resource_get_user_data(resource)); | 618 | auto me = static_cast<DataDevice*>(wl_resource_get_user_data(resource)); |
548 | 430 | me->release(); | 619 | try |
549 | 620 | { | ||
550 | 621 | me->release(); | ||
551 | 622 | } | ||
552 | 623 | catch(...) | ||
553 | 624 | { | ||
554 | 625 | ::mir::log( | ||
555 | 626 | ::mir::logging::Severity::critical, | ||
556 | 627 | "frontend:Wayland", | ||
557 | 628 | std::current_exception(), | ||
558 | 629 | "Exception processing DataDevice::release() request"); | ||
559 | 630 | } | ||
560 | 431 | } | 631 | } |
561 | 432 | 632 | ||
562 | 433 | static void resource_destroyed_thunk(wl_resource* us) | 633 | static void resource_destroyed_thunk(wl_resource* us) |
563 | @@ -466,13 +666,35 @@ | |||
564 | 466 | static void create_data_source_thunk(struct wl_client* client, struct wl_resource* resource, uint32_t id) | 666 | static void create_data_source_thunk(struct wl_client* client, struct wl_resource* resource, uint32_t id) |
565 | 467 | { | 667 | { |
566 | 468 | auto me = static_cast<DataDeviceManager*>(wl_resource_get_user_data(resource)); | 668 | auto me = static_cast<DataDeviceManager*>(wl_resource_get_user_data(resource)); |
568 | 469 | me->create_data_source(client, resource, id); | 669 | try |
569 | 670 | { | ||
570 | 671 | me->create_data_source(client, resource, id); | ||
571 | 672 | } | ||
572 | 673 | catch(...) | ||
573 | 674 | { | ||
574 | 675 | ::mir::log( | ||
575 | 676 | ::mir::logging::Severity::critical, | ||
576 | 677 | "frontend:Wayland", | ||
577 | 678 | std::current_exception(), | ||
578 | 679 | "Exception processing DataDeviceManager::create_data_source() request"); | ||
579 | 680 | } | ||
580 | 470 | } | 681 | } |
581 | 471 | 682 | ||
582 | 472 | static void get_data_device_thunk(struct wl_client* client, struct wl_resource* resource, uint32_t id, struct wl_resource* seat) | 683 | static void get_data_device_thunk(struct wl_client* client, struct wl_resource* resource, uint32_t id, struct wl_resource* seat) |
583 | 473 | { | 684 | { |
584 | 474 | auto me = static_cast<DataDeviceManager*>(wl_resource_get_user_data(resource)); | 685 | auto me = static_cast<DataDeviceManager*>(wl_resource_get_user_data(resource)); |
586 | 475 | me->get_data_device(client, resource, id, seat); | 686 | try |
587 | 687 | { | ||
588 | 688 | me->get_data_device(client, resource, id, seat); | ||
589 | 689 | } | ||
590 | 690 | catch(...) | ||
591 | 691 | { | ||
592 | 692 | ::mir::log( | ||
593 | 693 | ::mir::logging::Severity::critical, | ||
594 | 694 | "frontend:Wayland", | ||
595 | 695 | std::current_exception(), | ||
596 | 696 | "Exception processing DataDeviceManager::get_data_device() request"); | ||
597 | 697 | } | ||
598 | 476 | } | 698 | } |
599 | 477 | 699 | ||
600 | 478 | static void bind(struct wl_client* client, void* data, uint32_t version, uint32_t id) | 700 | static void bind(struct wl_client* client, void* data, uint32_t version, uint32_t id) |
601 | @@ -519,7 +741,18 @@ | |||
602 | 519 | static void get_shell_surface_thunk(struct wl_client* client, struct wl_resource* resource, uint32_t id, struct wl_resource* surface) | 741 | static void get_shell_surface_thunk(struct wl_client* client, struct wl_resource* resource, uint32_t id, struct wl_resource* surface) |
603 | 520 | { | 742 | { |
604 | 521 | auto me = static_cast<Shell*>(wl_resource_get_user_data(resource)); | 743 | auto me = static_cast<Shell*>(wl_resource_get_user_data(resource)); |
606 | 522 | me->get_shell_surface(client, resource, id, surface); | 744 | try |
607 | 745 | { | ||
608 | 746 | me->get_shell_surface(client, resource, id, surface); | ||
609 | 747 | } | ||
610 | 748 | catch(...) | ||
611 | 749 | { | ||
612 | 750 | ::mir::log( | ||
613 | 751 | ::mir::logging::Severity::critical, | ||
614 | 752 | "frontend:Wayland", | ||
615 | 753 | std::current_exception(), | ||
616 | 754 | "Exception processing Shell::get_shell_surface() request"); | ||
617 | 755 | } | ||
618 | 523 | } | 756 | } |
619 | 524 | 757 | ||
620 | 525 | static void bind(struct wl_client* client, void* data, uint32_t version, uint32_t id) | 758 | static void bind(struct wl_client* client, void* data, uint32_t version, uint32_t id) |
621 | @@ -578,31 +811,86 @@ | |||
622 | 578 | static void pong_thunk(struct wl_client*, struct wl_resource* resource, uint32_t serial) | 811 | static void pong_thunk(struct wl_client*, struct wl_resource* resource, uint32_t serial) |
623 | 579 | { | 812 | { |
624 | 580 | auto me = static_cast<ShellSurface*>(wl_resource_get_user_data(resource)); | 813 | auto me = static_cast<ShellSurface*>(wl_resource_get_user_data(resource)); |
626 | 581 | me->pong(serial); | 814 | try |
627 | 815 | { | ||
628 | 816 | me->pong(serial); | ||
629 | 817 | } | ||
630 | 818 | catch(...) | ||
631 | 819 | { | ||
632 | 820 | ::mir::log( | ||
633 | 821 | ::mir::logging::Severity::critical, | ||
634 | 822 | "frontend:Wayland", | ||
635 | 823 | std::current_exception(), | ||
636 | 824 | "Exception processing ShellSurface::pong() request"); | ||
637 | 825 | } | ||
638 | 582 | } | 826 | } |
639 | 583 | 827 | ||
640 | 584 | static void move_thunk(struct wl_client*, struct wl_resource* resource, struct wl_resource* seat, uint32_t serial) | 828 | static void move_thunk(struct wl_client*, struct wl_resource* resource, struct wl_resource* seat, uint32_t serial) |
641 | 585 | { | 829 | { |
642 | 586 | auto me = static_cast<ShellSurface*>(wl_resource_get_user_data(resource)); | 830 | auto me = static_cast<ShellSurface*>(wl_resource_get_user_data(resource)); |
644 | 587 | me->move(seat, serial); | 831 | try |
645 | 832 | { | ||
646 | 833 | me->move(seat, serial); | ||
647 | 834 | } | ||
648 | 835 | catch(...) | ||
649 | 836 | { | ||
650 | 837 | ::mir::log( | ||
651 | 838 | ::mir::logging::Severity::critical, | ||
652 | 839 | "frontend:Wayland", | ||
653 | 840 | std::current_exception(), | ||
654 | 841 | "Exception processing ShellSurface::move() request"); | ||
655 | 842 | } | ||
656 | 588 | } | 843 | } |
657 | 589 | 844 | ||
658 | 590 | static void resize_thunk(struct wl_client*, struct wl_resource* resource, struct wl_resource* seat, uint32_t serial, uint32_t edges) | 845 | static void resize_thunk(struct wl_client*, struct wl_resource* resource, struct wl_resource* seat, uint32_t serial, uint32_t edges) |
659 | 591 | { | 846 | { |
660 | 592 | auto me = static_cast<ShellSurface*>(wl_resource_get_user_data(resource)); | 847 | auto me = static_cast<ShellSurface*>(wl_resource_get_user_data(resource)); |
662 | 593 | me->resize(seat, serial, edges); | 848 | try |
663 | 849 | { | ||
664 | 850 | me->resize(seat, serial, edges); | ||
665 | 851 | } | ||
666 | 852 | catch(...) | ||
667 | 853 | { | ||
668 | 854 | ::mir::log( | ||
669 | 855 | ::mir::logging::Severity::critical, | ||
670 | 856 | "frontend:Wayland", | ||
671 | 857 | std::current_exception(), | ||
672 | 858 | "Exception processing ShellSurface::resize() request"); | ||
673 | 859 | } | ||
674 | 594 | } | 860 | } |
675 | 595 | 861 | ||
676 | 596 | static void set_toplevel_thunk(struct wl_client*, struct wl_resource* resource) | 862 | static void set_toplevel_thunk(struct wl_client*, struct wl_resource* resource) |
677 | 597 | { | 863 | { |
678 | 598 | auto me = static_cast<ShellSurface*>(wl_resource_get_user_data(resource)); | 864 | auto me = static_cast<ShellSurface*>(wl_resource_get_user_data(resource)); |
680 | 599 | me->set_toplevel(); | 865 | try |
681 | 866 | { | ||
682 | 867 | me->set_toplevel(); | ||
683 | 868 | } | ||
684 | 869 | catch(...) | ||
685 | 870 | { | ||
686 | 871 | ::mir::log( | ||
687 | 872 | ::mir::logging::Severity::critical, | ||
688 | 873 | "frontend:Wayland", | ||
689 | 874 | std::current_exception(), | ||
690 | 875 | "Exception processing ShellSurface::set_toplevel() request"); | ||
691 | 876 | } | ||
692 | 600 | } | 877 | } |
693 | 601 | 878 | ||
694 | 602 | static void set_transient_thunk(struct wl_client*, struct wl_resource* resource, struct wl_resource* parent, int32_t x, int32_t y, uint32_t flags) | 879 | static void set_transient_thunk(struct wl_client*, struct wl_resource* resource, struct wl_resource* parent, int32_t x, int32_t y, uint32_t flags) |
695 | 603 | { | 880 | { |
696 | 604 | auto me = static_cast<ShellSurface*>(wl_resource_get_user_data(resource)); | 881 | auto me = static_cast<ShellSurface*>(wl_resource_get_user_data(resource)); |
698 | 605 | me->set_transient(parent, x, y, flags); | 882 | try |
699 | 883 | { | ||
700 | 884 | me->set_transient(parent, x, y, flags); | ||
701 | 885 | } | ||
702 | 886 | catch(...) | ||
703 | 887 | { | ||
704 | 888 | ::mir::log( | ||
705 | 889 | ::mir::logging::Severity::critical, | ||
706 | 890 | "frontend:Wayland", | ||
707 | 891 | std::current_exception(), | ||
708 | 892 | "Exception processing ShellSurface::set_transient() request"); | ||
709 | 893 | } | ||
710 | 606 | } | 894 | } |
711 | 607 | 895 | ||
712 | 608 | static void set_fullscreen_thunk(struct wl_client*, struct wl_resource* resource, uint32_t method, uint32_t framerate, struct wl_resource* output) | 896 | static void set_fullscreen_thunk(struct wl_client*, struct wl_resource* resource, uint32_t method, uint32_t framerate, struct wl_resource* output) |
713 | @@ -613,13 +901,35 @@ | |||
714 | 613 | { | 901 | { |
715 | 614 | output_resolved = output; | 902 | output_resolved = output; |
716 | 615 | } | 903 | } |
718 | 616 | me->set_fullscreen(method, framerate, output_resolved); | 904 | try |
719 | 905 | { | ||
720 | 906 | me->set_fullscreen(method, framerate, output_resolved); | ||
721 | 907 | } | ||
722 | 908 | catch(...) | ||
723 | 909 | { | ||
724 | 910 | ::mir::log( | ||
725 | 911 | ::mir::logging::Severity::critical, | ||
726 | 912 | "frontend:Wayland", | ||
727 | 913 | std::current_exception(), | ||
728 | 914 | "Exception processing ShellSurface::set_fullscreen() request"); | ||
729 | 915 | } | ||
730 | 617 | } | 916 | } |
731 | 618 | 917 | ||
732 | 619 | static void set_popup_thunk(struct wl_client*, struct wl_resource* resource, struct wl_resource* seat, uint32_t serial, struct wl_resource* parent, int32_t x, int32_t y, uint32_t flags) | 918 | static void set_popup_thunk(struct wl_client*, struct wl_resource* resource, struct wl_resource* seat, uint32_t serial, struct wl_resource* parent, int32_t x, int32_t y, uint32_t flags) |
733 | 620 | { | 919 | { |
734 | 621 | auto me = static_cast<ShellSurface*>(wl_resource_get_user_data(resource)); | 920 | auto me = static_cast<ShellSurface*>(wl_resource_get_user_data(resource)); |
736 | 622 | me->set_popup(seat, serial, parent, x, y, flags); | 921 | try |
737 | 922 | { | ||
738 | 923 | me->set_popup(seat, serial, parent, x, y, flags); | ||
739 | 924 | } | ||
740 | 925 | catch(...) | ||
741 | 926 | { | ||
742 | 927 | ::mir::log( | ||
743 | 928 | ::mir::logging::Severity::critical, | ||
744 | 929 | "frontend:Wayland", | ||
745 | 930 | std::current_exception(), | ||
746 | 931 | "Exception processing ShellSurface::set_popup() request"); | ||
747 | 932 | } | ||
748 | 623 | } | 933 | } |
749 | 624 | 934 | ||
750 | 625 | static void set_maximized_thunk(struct wl_client*, struct wl_resource* resource, struct wl_resource* output) | 935 | static void set_maximized_thunk(struct wl_client*, struct wl_resource* resource, struct wl_resource* output) |
751 | @@ -630,19 +940,52 @@ | |||
752 | 630 | { | 940 | { |
753 | 631 | output_resolved = output; | 941 | output_resolved = output; |
754 | 632 | } | 942 | } |
756 | 633 | me->set_maximized(output_resolved); | 943 | try |
757 | 944 | { | ||
758 | 945 | me->set_maximized(output_resolved); | ||
759 | 946 | } | ||
760 | 947 | catch(...) | ||
761 | 948 | { | ||
762 | 949 | ::mir::log( | ||
763 | 950 | ::mir::logging::Severity::critical, | ||
764 | 951 | "frontend:Wayland", | ||
765 | 952 | std::current_exception(), | ||
766 | 953 | "Exception processing ShellSurface::set_maximized() request"); | ||
767 | 954 | } | ||
768 | 634 | } | 955 | } |
769 | 635 | 956 | ||
770 | 636 | static void set_title_thunk(struct wl_client*, struct wl_resource* resource, char const* title) | 957 | static void set_title_thunk(struct wl_client*, struct wl_resource* resource, char const* title) |
771 | 637 | { | 958 | { |
772 | 638 | auto me = static_cast<ShellSurface*>(wl_resource_get_user_data(resource)); | 959 | auto me = static_cast<ShellSurface*>(wl_resource_get_user_data(resource)); |
774 | 639 | me->set_title(title); | 960 | try |
775 | 961 | { | ||
776 | 962 | me->set_title(title); | ||
777 | 963 | } | ||
778 | 964 | catch(...) | ||
779 | 965 | { | ||
780 | 966 | ::mir::log( | ||
781 | 967 | ::mir::logging::Severity::critical, | ||
782 | 968 | "frontend:Wayland", | ||
783 | 969 | std::current_exception(), | ||
784 | 970 | "Exception processing ShellSurface::set_title() request"); | ||
785 | 971 | } | ||
786 | 640 | } | 972 | } |
787 | 641 | 973 | ||
788 | 642 | static void set_class_thunk(struct wl_client*, struct wl_resource* resource, char const* class_) | 974 | static void set_class_thunk(struct wl_client*, struct wl_resource* resource, char const* class_) |
789 | 643 | { | 975 | { |
790 | 644 | auto me = static_cast<ShellSurface*>(wl_resource_get_user_data(resource)); | 976 | auto me = static_cast<ShellSurface*>(wl_resource_get_user_data(resource)); |
792 | 645 | me->set_class(class_); | 977 | try |
793 | 978 | { | ||
794 | 979 | me->set_class(class_); | ||
795 | 980 | } | ||
796 | 981 | catch(...) | ||
797 | 982 | { | ||
798 | 983 | ::mir::log( | ||
799 | 984 | ::mir::logging::Severity::critical, | ||
800 | 985 | "frontend:Wayland", | ||
801 | 986 | std::current_exception(), | ||
802 | 987 | "Exception processing ShellSurface::set_class() request"); | ||
803 | 988 | } | ||
804 | 646 | } | 989 | } |
805 | 647 | 990 | ||
806 | 648 | static void resource_destroyed_thunk(wl_resource* us) | 991 | static void resource_destroyed_thunk(wl_resource* us) |
807 | @@ -700,7 +1043,18 @@ | |||
808 | 700 | static void destroy_thunk(struct wl_client*, struct wl_resource* resource) | 1043 | static void destroy_thunk(struct wl_client*, struct wl_resource* resource) |
809 | 701 | { | 1044 | { |
810 | 702 | auto me = static_cast<Surface*>(wl_resource_get_user_data(resource)); | 1045 | auto me = static_cast<Surface*>(wl_resource_get_user_data(resource)); |
812 | 703 | me->destroy(); | 1046 | try |
813 | 1047 | { | ||
814 | 1048 | me->destroy(); | ||
815 | 1049 | } | ||
816 | 1050 | catch(...) | ||
817 | 1051 | { | ||
818 | 1052 | ::mir::log( | ||
819 | 1053 | ::mir::logging::Severity::critical, | ||
820 | 1054 | "frontend:Wayland", | ||
821 | 1055 | std::current_exception(), | ||
822 | 1056 | "Exception processing Surface::destroy() request"); | ||
823 | 1057 | } | ||
824 | 704 | } | 1058 | } |
825 | 705 | 1059 | ||
826 | 706 | static void attach_thunk(struct wl_client*, struct wl_resource* resource, struct wl_resource* buffer, int32_t x, int32_t y) | 1060 | static void attach_thunk(struct wl_client*, struct wl_resource* resource, struct wl_resource* buffer, int32_t x, int32_t y) |
827 | @@ -711,19 +1065,52 @@ | |||
828 | 711 | { | 1065 | { |
829 | 712 | buffer_resolved = buffer; | 1066 | buffer_resolved = buffer; |
830 | 713 | } | 1067 | } |
832 | 714 | me->attach(buffer_resolved, x, y); | 1068 | try |
833 | 1069 | { | ||
834 | 1070 | me->attach(buffer_resolved, x, y); | ||
835 | 1071 | } | ||
836 | 1072 | catch(...) | ||
837 | 1073 | { | ||
838 | 1074 | ::mir::log( | ||
839 | 1075 | ::mir::logging::Severity::critical, | ||
840 | 1076 | "frontend:Wayland", | ||
841 | 1077 | std::current_exception(), | ||
842 | 1078 | "Exception processing Surface::attach() request"); | ||
843 | 1079 | } | ||
844 | 715 | } | 1080 | } |
845 | 716 | 1081 | ||
846 | 717 | static void damage_thunk(struct wl_client*, struct wl_resource* resource, int32_t x, int32_t y, int32_t width, int32_t height) | 1082 | static void damage_thunk(struct wl_client*, struct wl_resource* resource, int32_t x, int32_t y, int32_t width, int32_t height) |
847 | 718 | { | 1083 | { |
848 | 719 | auto me = static_cast<Surface*>(wl_resource_get_user_data(resource)); | 1084 | auto me = static_cast<Surface*>(wl_resource_get_user_data(resource)); |
850 | 720 | me->damage(x, y, width, height); | 1085 | try |
851 | 1086 | { | ||
852 | 1087 | me->damage(x, y, width, height); | ||
853 | 1088 | } | ||
854 | 1089 | catch(...) | ||
855 | 1090 | { | ||
856 | 1091 | ::mir::log( | ||
857 | 1092 | ::mir::logging::Severity::critical, | ||
858 | 1093 | "frontend:Wayland", | ||
859 | 1094 | std::current_exception(), | ||
860 | 1095 | "Exception processing Surface::damage() request"); | ||
861 | 1096 | } | ||
862 | 721 | } | 1097 | } |
863 | 722 | 1098 | ||
864 | 723 | static void frame_thunk(struct wl_client*, struct wl_resource* resource, uint32_t callback) | 1099 | static void frame_thunk(struct wl_client*, struct wl_resource* resource, uint32_t callback) |
865 | 724 | { | 1100 | { |
866 | 725 | auto me = static_cast<Surface*>(wl_resource_get_user_data(resource)); | 1101 | auto me = static_cast<Surface*>(wl_resource_get_user_data(resource)); |
868 | 726 | me->frame(callback); | 1102 | try |
869 | 1103 | { | ||
870 | 1104 | me->frame(callback); | ||
871 | 1105 | } | ||
872 | 1106 | catch(...) | ||
873 | 1107 | { | ||
874 | 1108 | ::mir::log( | ||
875 | 1109 | ::mir::logging::Severity::critical, | ||
876 | 1110 | "frontend:Wayland", | ||
877 | 1111 | std::current_exception(), | ||
878 | 1112 | "Exception processing Surface::frame() request"); | ||
879 | 1113 | } | ||
880 | 727 | } | 1114 | } |
881 | 728 | 1115 | ||
882 | 729 | static void set_opaque_region_thunk(struct wl_client*, struct wl_resource* resource, struct wl_resource* region) | 1116 | static void set_opaque_region_thunk(struct wl_client*, struct wl_resource* resource, struct wl_resource* region) |
883 | @@ -734,7 +1121,18 @@ | |||
884 | 734 | { | 1121 | { |
885 | 735 | region_resolved = region; | 1122 | region_resolved = region; |
886 | 736 | } | 1123 | } |
888 | 737 | me->set_opaque_region(region_resolved); | 1124 | try |
889 | 1125 | { | ||
890 | 1126 | me->set_opaque_region(region_resolved); | ||
891 | 1127 | } | ||
892 | 1128 | catch(...) | ||
893 | 1129 | { | ||
894 | 1130 | ::mir::log( | ||
895 | 1131 | ::mir::logging::Severity::critical, | ||
896 | 1132 | "frontend:Wayland", | ||
897 | 1133 | std::current_exception(), | ||
898 | 1134 | "Exception processing Surface::set_opaque_region() request"); | ||
899 | 1135 | } | ||
900 | 738 | } | 1136 | } |
901 | 739 | 1137 | ||
902 | 740 | static void set_input_region_thunk(struct wl_client*, struct wl_resource* resource, struct wl_resource* region) | 1138 | static void set_input_region_thunk(struct wl_client*, struct wl_resource* resource, struct wl_resource* region) |
903 | @@ -745,31 +1143,86 @@ | |||
904 | 745 | { | 1143 | { |
905 | 746 | region_resolved = region; | 1144 | region_resolved = region; |
906 | 747 | } | 1145 | } |
908 | 748 | me->set_input_region(region_resolved); | 1146 | try |
909 | 1147 | { | ||
910 | 1148 | me->set_input_region(region_resolved); | ||
911 | 1149 | } | ||
912 | 1150 | catch(...) | ||
913 | 1151 | { | ||
914 | 1152 | ::mir::log( | ||
915 | 1153 | ::mir::logging::Severity::critical, | ||
916 | 1154 | "frontend:Wayland", | ||
917 | 1155 | std::current_exception(), | ||
918 | 1156 | "Exception processing Surface::set_input_region() request"); | ||
919 | 1157 | } | ||
920 | 749 | } | 1158 | } |
921 | 750 | 1159 | ||
922 | 751 | static void commit_thunk(struct wl_client*, struct wl_resource* resource) | 1160 | static void commit_thunk(struct wl_client*, struct wl_resource* resource) |
923 | 752 | { | 1161 | { |
924 | 753 | auto me = static_cast<Surface*>(wl_resource_get_user_data(resource)); | 1162 | auto me = static_cast<Surface*>(wl_resource_get_user_data(resource)); |
926 | 754 | me->commit(); | 1163 | try |
927 | 1164 | { | ||
928 | 1165 | me->commit(); | ||
929 | 1166 | } | ||
930 | 1167 | catch(...) | ||
931 | 1168 | { | ||
932 | 1169 | ::mir::log( | ||
933 | 1170 | ::mir::logging::Severity::critical, | ||
934 | 1171 | "frontend:Wayland", | ||
935 | 1172 | std::current_exception(), | ||
936 | 1173 | "Exception processing Surface::commit() request"); | ||
937 | 1174 | } | ||
938 | 755 | } | 1175 | } |
939 | 756 | 1176 | ||
940 | 757 | static void set_buffer_transform_thunk(struct wl_client*, struct wl_resource* resource, int32_t transform) | 1177 | static void set_buffer_transform_thunk(struct wl_client*, struct wl_resource* resource, int32_t transform) |
941 | 758 | { | 1178 | { |
942 | 759 | auto me = static_cast<Surface*>(wl_resource_get_user_data(resource)); | 1179 | auto me = static_cast<Surface*>(wl_resource_get_user_data(resource)); |
944 | 760 | me->set_buffer_transform(transform); | 1180 | try |
945 | 1181 | { | ||
946 | 1182 | me->set_buffer_transform(transform); | ||
947 | 1183 | } | ||
948 | 1184 | catch(...) | ||
949 | 1185 | { | ||
950 | 1186 | ::mir::log( | ||
951 | 1187 | ::mir::logging::Severity::critical, | ||
952 | 1188 | "frontend:Wayland", | ||
953 | 1189 | std::current_exception(), | ||
954 | 1190 | "Exception processing Surface::set_buffer_transform() request"); | ||
955 | 1191 | } | ||
956 | 761 | } | 1192 | } |
957 | 762 | 1193 | ||
958 | 763 | static void set_buffer_scale_thunk(struct wl_client*, struct wl_resource* resource, int32_t scale) | 1194 | static void set_buffer_scale_thunk(struct wl_client*, struct wl_resource* resource, int32_t scale) |
959 | 764 | { | 1195 | { |
960 | 765 | auto me = static_cast<Surface*>(wl_resource_get_user_data(resource)); | 1196 | auto me = static_cast<Surface*>(wl_resource_get_user_data(resource)); |
962 | 766 | me->set_buffer_scale(scale); | 1197 | try |
963 | 1198 | { | ||
964 | 1199 | me->set_buffer_scale(scale); | ||
965 | 1200 | } | ||
966 | 1201 | catch(...) | ||
967 | 1202 | { | ||
968 | 1203 | ::mir::log( | ||
969 | 1204 | ::mir::logging::Severity::critical, | ||
970 | 1205 | "frontend:Wayland", | ||
971 | 1206 | std::current_exception(), | ||
972 | 1207 | "Exception processing Surface::set_buffer_scale() request"); | ||
973 | 1208 | } | ||
974 | 767 | } | 1209 | } |
975 | 768 | 1210 | ||
976 | 769 | static void damage_buffer_thunk(struct wl_client*, struct wl_resource* resource, int32_t x, int32_t y, int32_t width, int32_t height) | 1211 | static void damage_buffer_thunk(struct wl_client*, struct wl_resource* resource, int32_t x, int32_t y, int32_t width, int32_t height) |
977 | 770 | { | 1212 | { |
978 | 771 | auto me = static_cast<Surface*>(wl_resource_get_user_data(resource)); | 1213 | auto me = static_cast<Surface*>(wl_resource_get_user_data(resource)); |
980 | 772 | me->damage_buffer(x, y, width, height); | 1214 | try |
981 | 1215 | { | ||
982 | 1216 | me->damage_buffer(x, y, width, height); | ||
983 | 1217 | } | ||
984 | 1218 | catch(...) | ||
985 | 1219 | { | ||
986 | 1220 | ::mir::log( | ||
987 | 1221 | ::mir::logging::Severity::critical, | ||
988 | 1222 | "frontend:Wayland", | ||
989 | 1223 | std::current_exception(), | ||
990 | 1224 | "Exception processing Surface::damage_buffer() request"); | ||
991 | 1225 | } | ||
992 | 773 | } | 1226 | } |
993 | 774 | 1227 | ||
994 | 775 | static void resource_destroyed_thunk(wl_resource* us) | 1228 | static void resource_destroyed_thunk(wl_resource* us) |
995 | @@ -817,25 +1270,69 @@ | |||
996 | 817 | static void get_pointer_thunk(struct wl_client* client, struct wl_resource* resource, uint32_t id) | 1270 | static void get_pointer_thunk(struct wl_client* client, struct wl_resource* resource, uint32_t id) |
997 | 818 | { | 1271 | { |
998 | 819 | auto me = static_cast<Seat*>(wl_resource_get_user_data(resource)); | 1272 | auto me = static_cast<Seat*>(wl_resource_get_user_data(resource)); |
1000 | 820 | me->get_pointer(client, resource, id); | 1273 | try |
1001 | 1274 | { | ||
1002 | 1275 | me->get_pointer(client, resource, id); | ||
1003 | 1276 | } | ||
1004 | 1277 | catch(...) | ||
1005 | 1278 | { | ||
1006 | 1279 | ::mir::log( | ||
1007 | 1280 | ::mir::logging::Severity::critical, | ||
1008 | 1281 | "frontend:Wayland", | ||
1009 | 1282 | std::current_exception(), | ||
1010 | 1283 | "Exception processing Seat::get_pointer() request"); | ||
1011 | 1284 | } | ||
1012 | 821 | } | 1285 | } |
1013 | 822 | 1286 | ||
1014 | 823 | static void get_keyboard_thunk(struct wl_client* client, struct wl_resource* resource, uint32_t id) | 1287 | static void get_keyboard_thunk(struct wl_client* client, struct wl_resource* resource, uint32_t id) |
1015 | 824 | { | 1288 | { |
1016 | 825 | auto me = static_cast<Seat*>(wl_resource_get_user_data(resource)); | 1289 | auto me = static_cast<Seat*>(wl_resource_get_user_data(resource)); |
1018 | 826 | me->get_keyboard(client, resource, id); | 1290 | try |
1019 | 1291 | { | ||
1020 | 1292 | me->get_keyboard(client, resource, id); | ||
1021 | 1293 | } | ||
1022 | 1294 | catch(...) | ||
1023 | 1295 | { | ||
1024 | 1296 | ::mir::log( | ||
1025 | 1297 | ::mir::logging::Severity::critical, | ||
1026 | 1298 | "frontend:Wayland", | ||
1027 | 1299 | std::current_exception(), | ||
1028 | 1300 | "Exception processing Seat::get_keyboard() request"); | ||
1029 | 1301 | } | ||
1030 | 827 | } | 1302 | } |
1031 | 828 | 1303 | ||
1032 | 829 | static void get_touch_thunk(struct wl_client* client, struct wl_resource* resource, uint32_t id) | 1304 | static void get_touch_thunk(struct wl_client* client, struct wl_resource* resource, uint32_t id) |
1033 | 830 | { | 1305 | { |
1034 | 831 | auto me = static_cast<Seat*>(wl_resource_get_user_data(resource)); | 1306 | auto me = static_cast<Seat*>(wl_resource_get_user_data(resource)); |
1036 | 832 | me->get_touch(client, resource, id); | 1307 | try |
1037 | 1308 | { | ||
1038 | 1309 | me->get_touch(client, resource, id); | ||
1039 | 1310 | } | ||
1040 | 1311 | catch(...) | ||
1041 | 1312 | { | ||
1042 | 1313 | ::mir::log( | ||
1043 | 1314 | ::mir::logging::Severity::critical, | ||
1044 | 1315 | "frontend:Wayland", | ||
1045 | 1316 | std::current_exception(), | ||
1046 | 1317 | "Exception processing Seat::get_touch() request"); | ||
1047 | 1318 | } | ||
1048 | 833 | } | 1319 | } |
1049 | 834 | 1320 | ||
1050 | 835 | static void release_thunk(struct wl_client* client, struct wl_resource* resource) | 1321 | static void release_thunk(struct wl_client* client, struct wl_resource* resource) |
1051 | 836 | { | 1322 | { |
1052 | 837 | auto me = static_cast<Seat*>(wl_resource_get_user_data(resource)); | 1323 | auto me = static_cast<Seat*>(wl_resource_get_user_data(resource)); |
1054 | 838 | me->release(client, resource); | 1324 | try |
1055 | 1325 | { | ||
1056 | 1326 | me->release(client, resource); | ||
1057 | 1327 | } | ||
1058 | 1328 | catch(...) | ||
1059 | 1329 | { | ||
1060 | 1330 | ::mir::log( | ||
1061 | 1331 | ::mir::logging::Severity::critical, | ||
1062 | 1332 | "frontend:Wayland", | ||
1063 | 1333 | std::current_exception(), | ||
1064 | 1334 | "Exception processing Seat::release() request"); | ||
1065 | 1335 | } | ||
1066 | 839 | } | 1336 | } |
1067 | 840 | 1337 | ||
1068 | 841 | static void bind(struct wl_client* client, void* data, uint32_t version, uint32_t id) | 1338 | static void bind(struct wl_client* client, void* data, uint32_t version, uint32_t id) |
1069 | @@ -894,13 +1391,35 @@ | |||
1070 | 894 | { | 1391 | { |
1071 | 895 | surface_resolved = surface; | 1392 | surface_resolved = surface; |
1072 | 896 | } | 1393 | } |
1074 | 897 | me->set_cursor(serial, surface_resolved, hotspot_x, hotspot_y); | 1394 | try |
1075 | 1395 | { | ||
1076 | 1396 | me->set_cursor(serial, surface_resolved, hotspot_x, hotspot_y); | ||
1077 | 1397 | } | ||
1078 | 1398 | catch(...) | ||
1079 | 1399 | { | ||
1080 | 1400 | ::mir::log( | ||
1081 | 1401 | ::mir::logging::Severity::critical, | ||
1082 | 1402 | "frontend:Wayland", | ||
1083 | 1403 | std::current_exception(), | ||
1084 | 1404 | "Exception processing Pointer::set_cursor() request"); | ||
1085 | 1405 | } | ||
1086 | 898 | } | 1406 | } |
1087 | 899 | 1407 | ||
1088 | 900 | static void release_thunk(struct wl_client*, struct wl_resource* resource) | 1408 | static void release_thunk(struct wl_client*, struct wl_resource* resource) |
1089 | 901 | { | 1409 | { |
1090 | 902 | auto me = static_cast<Pointer*>(wl_resource_get_user_data(resource)); | 1410 | auto me = static_cast<Pointer*>(wl_resource_get_user_data(resource)); |
1092 | 903 | me->release(); | 1411 | try |
1093 | 1412 | { | ||
1094 | 1413 | me->release(); | ||
1095 | 1414 | } | ||
1096 | 1415 | catch(...) | ||
1097 | 1416 | { | ||
1098 | 1417 | ::mir::log( | ||
1099 | 1418 | ::mir::logging::Severity::critical, | ||
1100 | 1419 | "frontend:Wayland", | ||
1101 | 1420 | std::current_exception(), | ||
1102 | 1421 | "Exception processing Pointer::release() request"); | ||
1103 | 1422 | } | ||
1104 | 904 | } | 1423 | } |
1105 | 905 | 1424 | ||
1106 | 906 | static void resource_destroyed_thunk(wl_resource* us) | 1425 | static void resource_destroyed_thunk(wl_resource* us) |
1107 | @@ -941,7 +1460,18 @@ | |||
1108 | 941 | static void release_thunk(struct wl_client*, struct wl_resource* resource) | 1460 | static void release_thunk(struct wl_client*, struct wl_resource* resource) |
1109 | 942 | { | 1461 | { |
1110 | 943 | auto me = static_cast<Keyboard*>(wl_resource_get_user_data(resource)); | 1462 | auto me = static_cast<Keyboard*>(wl_resource_get_user_data(resource)); |
1112 | 944 | me->release(); | 1463 | try |
1113 | 1464 | { | ||
1114 | 1465 | me->release(); | ||
1115 | 1466 | } | ||
1116 | 1467 | catch(...) | ||
1117 | 1468 | { | ||
1118 | 1469 | ::mir::log( | ||
1119 | 1470 | ::mir::logging::Severity::critical, | ||
1120 | 1471 | "frontend:Wayland", | ||
1121 | 1472 | std::current_exception(), | ||
1122 | 1473 | "Exception processing Keyboard::release() request"); | ||
1123 | 1474 | } | ||
1124 | 945 | } | 1475 | } |
1125 | 946 | 1476 | ||
1126 | 947 | static void resource_destroyed_thunk(wl_resource* us) | 1477 | static void resource_destroyed_thunk(wl_resource* us) |
1127 | @@ -981,7 +1511,18 @@ | |||
1128 | 981 | static void release_thunk(struct wl_client*, struct wl_resource* resource) | 1511 | static void release_thunk(struct wl_client*, struct wl_resource* resource) |
1129 | 982 | { | 1512 | { |
1130 | 983 | auto me = static_cast<Touch*>(wl_resource_get_user_data(resource)); | 1513 | auto me = static_cast<Touch*>(wl_resource_get_user_data(resource)); |
1132 | 984 | me->release(); | 1514 | try |
1133 | 1515 | { | ||
1134 | 1516 | me->release(); | ||
1135 | 1517 | } | ||
1136 | 1518 | catch(...) | ||
1137 | 1519 | { | ||
1138 | 1520 | ::mir::log( | ||
1139 | 1521 | ::mir::logging::Severity::critical, | ||
1140 | 1522 | "frontend:Wayland", | ||
1141 | 1523 | std::current_exception(), | ||
1142 | 1524 | "Exception processing Touch::release() request"); | ||
1143 | 1525 | } | ||
1144 | 985 | } | 1526 | } |
1145 | 986 | 1527 | ||
1146 | 987 | static void resource_destroyed_thunk(wl_resource* us) | 1528 | static void resource_destroyed_thunk(wl_resource* us) |
1147 | @@ -1017,7 +1558,18 @@ | |||
1148 | 1017 | static void release_thunk(struct wl_client* client, struct wl_resource* resource) | 1558 | static void release_thunk(struct wl_client* client, struct wl_resource* resource) |
1149 | 1018 | { | 1559 | { |
1150 | 1019 | auto me = static_cast<Output*>(wl_resource_get_user_data(resource)); | 1560 | auto me = static_cast<Output*>(wl_resource_get_user_data(resource)); |
1152 | 1020 | me->release(client, resource); | 1561 | try |
1153 | 1562 | { | ||
1154 | 1563 | me->release(client, resource); | ||
1155 | 1564 | } | ||
1156 | 1565 | catch(...) | ||
1157 | 1566 | { | ||
1158 | 1567 | ::mir::log( | ||
1159 | 1568 | ::mir::logging::Severity::critical, | ||
1160 | 1569 | "frontend:Wayland", | ||
1161 | 1570 | std::current_exception(), | ||
1162 | 1571 | "Exception processing Output::release() request"); | ||
1163 | 1572 | } | ||
1164 | 1021 | } | 1573 | } |
1165 | 1022 | 1574 | ||
1166 | 1023 | static void bind(struct wl_client* client, void* data, uint32_t version, uint32_t id) | 1575 | static void bind(struct wl_client* client, void* data, uint32_t version, uint32_t id) |
1167 | @@ -1069,19 +1621,52 @@ | |||
1168 | 1069 | static void destroy_thunk(struct wl_client*, struct wl_resource* resource) | 1621 | static void destroy_thunk(struct wl_client*, struct wl_resource* resource) |
1169 | 1070 | { | 1622 | { |
1170 | 1071 | auto me = static_cast<Region*>(wl_resource_get_user_data(resource)); | 1623 | auto me = static_cast<Region*>(wl_resource_get_user_data(resource)); |
1172 | 1072 | me->destroy(); | 1624 | try |
1173 | 1625 | { | ||
1174 | 1626 | me->destroy(); | ||
1175 | 1627 | } | ||
1176 | 1628 | catch(...) | ||
1177 | 1629 | { | ||
1178 | 1630 | ::mir::log( | ||
1179 | 1631 | ::mir::logging::Severity::critical, | ||
1180 | 1632 | "frontend:Wayland", | ||
1181 | 1633 | std::current_exception(), | ||
1182 | 1634 | "Exception processing Region::destroy() request"); | ||
1183 | 1635 | } | ||
1184 | 1073 | } | 1636 | } |
1185 | 1074 | 1637 | ||
1186 | 1075 | static void add_thunk(struct wl_client*, struct wl_resource* resource, int32_t x, int32_t y, int32_t width, int32_t height) | 1638 | static void add_thunk(struct wl_client*, struct wl_resource* resource, int32_t x, int32_t y, int32_t width, int32_t height) |
1187 | 1076 | { | 1639 | { |
1188 | 1077 | auto me = static_cast<Region*>(wl_resource_get_user_data(resource)); | 1640 | auto me = static_cast<Region*>(wl_resource_get_user_data(resource)); |
1190 | 1078 | me->add(x, y, width, height); | 1641 | try |
1191 | 1642 | { | ||
1192 | 1643 | me->add(x, y, width, height); | ||
1193 | 1644 | } | ||
1194 | 1645 | catch(...) | ||
1195 | 1646 | { | ||
1196 | 1647 | ::mir::log( | ||
1197 | 1648 | ::mir::logging::Severity::critical, | ||
1198 | 1649 | "frontend:Wayland", | ||
1199 | 1650 | std::current_exception(), | ||
1200 | 1651 | "Exception processing Region::add() request"); | ||
1201 | 1652 | } | ||
1202 | 1079 | } | 1653 | } |
1203 | 1080 | 1654 | ||
1204 | 1081 | static void subtract_thunk(struct wl_client*, struct wl_resource* resource, int32_t x, int32_t y, int32_t width, int32_t height) | 1655 | static void subtract_thunk(struct wl_client*, struct wl_resource* resource, int32_t x, int32_t y, int32_t width, int32_t height) |
1205 | 1082 | { | 1656 | { |
1206 | 1083 | auto me = static_cast<Region*>(wl_resource_get_user_data(resource)); | 1657 | auto me = static_cast<Region*>(wl_resource_get_user_data(resource)); |
1208 | 1084 | me->subtract(x, y, width, height); | 1658 | try |
1209 | 1659 | { | ||
1210 | 1660 | me->subtract(x, y, width, height); | ||
1211 | 1661 | } | ||
1212 | 1662 | catch(...) | ||
1213 | 1663 | { | ||
1214 | 1664 | ::mir::log( | ||
1215 | 1665 | ::mir::logging::Severity::critical, | ||
1216 | 1666 | "frontend:Wayland", | ||
1217 | 1667 | std::current_exception(), | ||
1218 | 1668 | "Exception processing Region::subtract() request"); | ||
1219 | 1669 | } | ||
1220 | 1085 | } | 1670 | } |
1221 | 1086 | 1671 | ||
1222 | 1087 | static void resource_destroyed_thunk(wl_resource* us) | 1672 | static void resource_destroyed_thunk(wl_resource* us) |
1223 | @@ -1120,13 +1705,35 @@ | |||
1224 | 1120 | static void destroy_thunk(struct wl_client* client, struct wl_resource* resource) | 1705 | static void destroy_thunk(struct wl_client* client, struct wl_resource* resource) |
1225 | 1121 | { | 1706 | { |
1226 | 1122 | auto me = static_cast<Subcompositor*>(wl_resource_get_user_data(resource)); | 1707 | auto me = static_cast<Subcompositor*>(wl_resource_get_user_data(resource)); |
1228 | 1123 | me->destroy(client, resource); | 1708 | try |
1229 | 1709 | { | ||
1230 | 1710 | me->destroy(client, resource); | ||
1231 | 1711 | } | ||
1232 | 1712 | catch(...) | ||
1233 | 1713 | { | ||
1234 | 1714 | ::mir::log( | ||
1235 | 1715 | ::mir::logging::Severity::critical, | ||
1236 | 1716 | "frontend:Wayland", | ||
1237 | 1717 | std::current_exception(), | ||
1238 | 1718 | "Exception processing Subcompositor::destroy() request"); | ||
1239 | 1719 | } | ||
1240 | 1124 | } | 1720 | } |
1241 | 1125 | 1721 | ||
1242 | 1126 | static void get_subsurface_thunk(struct wl_client* client, struct wl_resource* resource, uint32_t id, struct wl_resource* surface, struct wl_resource* parent) | 1722 | static void get_subsurface_thunk(struct wl_client* client, struct wl_resource* resource, uint32_t id, struct wl_resource* surface, struct wl_resource* parent) |
1243 | 1127 | { | 1723 | { |
1244 | 1128 | auto me = static_cast<Subcompositor*>(wl_resource_get_user_data(resource)); | 1724 | auto me = static_cast<Subcompositor*>(wl_resource_get_user_data(resource)); |
1246 | 1129 | me->get_subsurface(client, resource, id, surface, parent); | 1725 | try |
1247 | 1726 | { | ||
1248 | 1727 | me->get_subsurface(client, resource, id, surface, parent); | ||
1249 | 1728 | } | ||
1250 | 1729 | catch(...) | ||
1251 | 1730 | { | ||
1252 | 1731 | ::mir::log( | ||
1253 | 1732 | ::mir::logging::Severity::critical, | ||
1254 | 1733 | "frontend:Wayland", | ||
1255 | 1734 | std::current_exception(), | ||
1256 | 1735 | "Exception processing Subcompositor::get_subsurface() request"); | ||
1257 | 1736 | } | ||
1258 | 1130 | } | 1737 | } |
1259 | 1131 | 1738 | ||
1260 | 1132 | static void bind(struct wl_client* client, void* data, uint32_t version, uint32_t id) | 1739 | static void bind(struct wl_client* client, void* data, uint32_t version, uint32_t id) |
1261 | @@ -1182,37 +1789,103 @@ | |||
1262 | 1182 | static void destroy_thunk(struct wl_client*, struct wl_resource* resource) | 1789 | static void destroy_thunk(struct wl_client*, struct wl_resource* resource) |
1263 | 1183 | { | 1790 | { |
1264 | 1184 | auto me = static_cast<Subsurface*>(wl_resource_get_user_data(resource)); | 1791 | auto me = static_cast<Subsurface*>(wl_resource_get_user_data(resource)); |
1266 | 1185 | me->destroy(); | 1792 | try |
1267 | 1793 | { | ||
1268 | 1794 | me->destroy(); | ||
1269 | 1795 | } | ||
1270 | 1796 | catch(...) | ||
1271 | 1797 | { | ||
1272 | 1798 | ::mir::log( | ||
1273 | 1799 | ::mir::logging::Severity::critical, | ||
1274 | 1800 | "frontend:Wayland", | ||
1275 | 1801 | std::current_exception(), | ||
1276 | 1802 | "Exception processing Subsurface::destroy() request"); | ||
1277 | 1803 | } | ||
1278 | 1186 | } | 1804 | } |
1279 | 1187 | 1805 | ||
1280 | 1188 | static void set_position_thunk(struct wl_client*, struct wl_resource* resource, int32_t x, int32_t y) | 1806 | static void set_position_thunk(struct wl_client*, struct wl_resource* resource, int32_t x, int32_t y) |
1281 | 1189 | { | 1807 | { |
1282 | 1190 | auto me = static_cast<Subsurface*>(wl_resource_get_user_data(resource)); | 1808 | auto me = static_cast<Subsurface*>(wl_resource_get_user_data(resource)); |
1284 | 1191 | me->set_position(x, y); | 1809 | try |
1285 | 1810 | { | ||
1286 | 1811 | me->set_position(x, y); | ||
1287 | 1812 | } | ||
1288 | 1813 | catch(...) | ||
1289 | 1814 | { | ||
1290 | 1815 | ::mir::log( | ||
1291 | 1816 | ::mir::logging::Severity::critical, | ||
1292 | 1817 | "frontend:Wayland", | ||
1293 | 1818 | std::current_exception(), | ||
1294 | 1819 | "Exception processing Subsurface::set_position() request"); | ||
1295 | 1820 | } | ||
1296 | 1192 | } | 1821 | } |
1297 | 1193 | 1822 | ||
1298 | 1194 | static void place_above_thunk(struct wl_client*, struct wl_resource* resource, struct wl_resource* sibling) | 1823 | static void place_above_thunk(struct wl_client*, struct wl_resource* resource, struct wl_resource* sibling) |
1299 | 1195 | { | 1824 | { |
1300 | 1196 | auto me = static_cast<Subsurface*>(wl_resource_get_user_data(resource)); | 1825 | auto me = static_cast<Subsurface*>(wl_resource_get_user_data(resource)); |
1302 | 1197 | me->place_above(sibling); | 1826 | try |
1303 | 1827 | { | ||
1304 | 1828 | me->place_above(sibling); | ||
1305 | 1829 | } | ||
1306 | 1830 | catch(...) | ||
1307 | 1831 | { | ||
1308 | 1832 | ::mir::log( | ||
1309 | 1833 | ::mir::logging::Severity::critical, | ||
1310 | 1834 | "frontend:Wayland", | ||
1311 | 1835 | std::current_exception(), | ||
1312 | 1836 | "Exception processing Subsurface::place_above() request"); | ||
1313 | 1837 | } | ||
1314 | 1198 | } | 1838 | } |
1315 | 1199 | 1839 | ||
1316 | 1200 | static void place_below_thunk(struct wl_client*, struct wl_resource* resource, struct wl_resource* sibling) | 1840 | static void place_below_thunk(struct wl_client*, struct wl_resource* resource, struct wl_resource* sibling) |
1317 | 1201 | { | 1841 | { |
1318 | 1202 | auto me = static_cast<Subsurface*>(wl_resource_get_user_data(resource)); | 1842 | auto me = static_cast<Subsurface*>(wl_resource_get_user_data(resource)); |
1320 | 1203 | me->place_below(sibling); | 1843 | try |
1321 | 1844 | { | ||
1322 | 1845 | me->place_below(sibling); | ||
1323 | 1846 | } | ||
1324 | 1847 | catch(...) | ||
1325 | 1848 | { | ||
1326 | 1849 | ::mir::log( | ||
1327 | 1850 | ::mir::logging::Severity::critical, | ||
1328 | 1851 | "frontend:Wayland", | ||
1329 | 1852 | std::current_exception(), | ||
1330 | 1853 | "Exception processing Subsurface::place_below() request"); | ||
1331 | 1854 | } | ||
1332 | 1204 | } | 1855 | } |
1333 | 1205 | 1856 | ||
1334 | 1206 | static void set_sync_thunk(struct wl_client*, struct wl_resource* resource) | 1857 | static void set_sync_thunk(struct wl_client*, struct wl_resource* resource) |
1335 | 1207 | { | 1858 | { |
1336 | 1208 | auto me = static_cast<Subsurface*>(wl_resource_get_user_data(resource)); | 1859 | auto me = static_cast<Subsurface*>(wl_resource_get_user_data(resource)); |
1338 | 1209 | me->set_sync(); | 1860 | try |
1339 | 1861 | { | ||
1340 | 1862 | me->set_sync(); | ||
1341 | 1863 | } | ||
1342 | 1864 | catch(...) | ||
1343 | 1865 | { | ||
1344 | 1866 | ::mir::log( | ||
1345 | 1867 | ::mir::logging::Severity::critical, | ||
1346 | 1868 | "frontend:Wayland", | ||
1347 | 1869 | std::current_exception(), | ||
1348 | 1870 | "Exception processing Subsurface::set_sync() request"); | ||
1349 | 1871 | } | ||
1350 | 1210 | } | 1872 | } |
1351 | 1211 | 1873 | ||
1352 | 1212 | static void set_desync_thunk(struct wl_client*, struct wl_resource* resource) | 1874 | static void set_desync_thunk(struct wl_client*, struct wl_resource* resource) |
1353 | 1213 | { | 1875 | { |
1354 | 1214 | auto me = static_cast<Subsurface*>(wl_resource_get_user_data(resource)); | 1876 | auto me = static_cast<Subsurface*>(wl_resource_get_user_data(resource)); |
1356 | 1215 | me->set_desync(); | 1877 | try |
1357 | 1878 | { | ||
1358 | 1879 | me->set_desync(); | ||
1359 | 1880 | } | ||
1360 | 1881 | catch(...) | ||
1361 | 1882 | { | ||
1362 | 1883 | ::mir::log( | ||
1363 | 1884 | ::mir::logging::Severity::critical, | ||
1364 | 1885 | "frontend:Wayland", | ||
1365 | 1886 | std::current_exception(), | ||
1366 | 1887 | "Exception processing Subsurface::set_desync() request"); | ||
1367 | 1888 | } | ||
1368 | 1216 | } | 1889 | } |
1369 | 1217 | 1890 | ||
1370 | 1218 | static void resource_destroyed_thunk(wl_resource* us) | 1891 | static void resource_destroyed_thunk(wl_resource* us) |
1371 | 1219 | 1892 | ||
1372 | === modified file 'src/server/frontend/wayland/wayland_connector.cpp' | |||
1373 | --- src/server/frontend/wayland/wayland_connector.cpp 2017-09-26 21:47:42 +0000 | |||
1374 | +++ src/server/frontend/wayland/wayland_connector.cpp 2017-09-27 16:01:58 +0000 | |||
1375 | @@ -1875,7 +1875,19 @@ | |||
1376 | 1875 | while (!executor->workqueue.empty()) | 1875 | while (!executor->workqueue.empty()) |
1377 | 1876 | { | 1876 | { |
1378 | 1877 | auto work = std::move(executor->workqueue.front()); | 1877 | auto work = std::move(executor->workqueue.front()); |
1380 | 1878 | work(); | 1878 | try |
1381 | 1879 | { | ||
1382 | 1880 | work(); | ||
1383 | 1881 | } | ||
1384 | 1882 | catch(...) | ||
1385 | 1883 | { | ||
1386 | 1884 | mir::log( | ||
1387 | 1885 | mir::logging::Severity::critical, | ||
1388 | 1886 | MIR_LOG_COMPONENT, | ||
1389 | 1887 | std::current_exception(), | ||
1390 | 1888 | "Exception processing Wayland event loop work item"); | ||
1391 | 1889 | } | ||
1392 | 1890 | |||
1393 | 1879 | executor->workqueue.pop_front(); | 1891 | executor->workqueue.pop_front(); |
1394 | 1880 | } | 1892 | } |
1395 | 1881 | 1893 |
FAILED: Continuous integration, rev:4283 /mir-jenkins. ubuntu. com/job/ mir-ci/ 3695/ /mir-jenkins. ubuntu. com/job/ build-mir/ 5067/console /mir-jenkins. ubuntu. com/job/ build-0- fetch/5303 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= artful/ 5291 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= xenial/ 5291 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= zesty/5291 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= clang,platform= mesa,release= artful/ 5111/console /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= clang,platform= mesa,release= zesty/5111/ console /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= mesa,release= xenial/ 5111/console
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
ABORTED: https:/
ABORTED: https:/
ABORTED: https:/
Click here to trigger a rebuild: /mir-jenkins. ubuntu. com/job/ mir-ci/ 3695/rebuild
https:/