Skip to content

Commit e0f736d

Browse files
authored
Set error handler (flutter#33402)
1 parent fce741d commit e0f736d

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

shell/platform/fuchsia/flutter/pointer_delegate.cc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#include "pointer_delegate.h"
66

77
#include <lib/trace/event.h>
8+
#include <zircon/status.h>
9+
#include <zircon/types.h>
810

911
#include <limits>
1012

@@ -318,6 +320,23 @@ void InsertIntoBuffer(
318320
}
319321
} // namespace
320322

323+
PointerDelegate::PointerDelegate(
324+
fuchsia::ui::pointer::TouchSourceHandle touch_source,
325+
fuchsia::ui::pointer::MouseSourceHandle mouse_source)
326+
: touch_source_(touch_source.Bind()), mouse_source_(mouse_source.Bind()) {
327+
if (touch_source_) {
328+
touch_source_.set_error_handler([](zx_status_t status) {
329+
FML_LOG(ERROR) << "TouchSource channel error: << "
330+
<< zx_status_get_string(status);
331+
});
332+
}
333+
if (mouse_source_) {
334+
mouse_source_.set_error_handler([](zx_status_t status) {
335+
FML_LOG(ERROR) << "MouseSource channel error: << "
336+
<< zx_status_get_string(status);
337+
});
338+
}
339+
}
321340
// Core logic of this class.
322341
// Aim to keep state management in this function.
323342
void PointerDelegate::WatchLoop(

shell/platform/fuchsia/flutter/pointer_delegate.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ struct IxnHasher {
3535
class PointerDelegate {
3636
public:
3737
PointerDelegate(fuchsia::ui::pointer::TouchSourceHandle touch_source,
38-
fuchsia::ui::pointer::MouseSourceHandle mouse_source)
39-
: touch_source_(touch_source.Bind()),
40-
mouse_source_(mouse_source.Bind()) {}
38+
fuchsia::ui::pointer::MouseSourceHandle mouse_source);
4139

4240
// This function collects Fuchsia's TouchPointerSample and MousePointerSample
4341
// data and transforms them into flutter::PointerData structs. It then calls

0 commit comments

Comments
 (0)