Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
mock_signal_handler.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "flutter/shell/platform/linux/testing/mock_signal_handler.h"
6
7namespace flutter {
8namespace testing {
9
11 const gchar* name,
12 GCallback callback)
13 : instance_(instance) {
14 id_ = g_signal_connect_data(instance, name, callback, this, nullptr,
15 G_CONNECT_SWAPPED);
16 g_object_add_weak_pointer(G_OBJECT(instance), &instance_);
17}
18
20 if (instance_) {
21 g_signal_handler_disconnect(instance_, id_);
22 g_object_remove_weak_pointer(G_OBJECT(instance_), &instance_);
23 }
24}
25
26} // namespace testing
27} // namespace flutter
SignalHandler(gpointer instance, const gchar *name, GCallback callback)
VkInstance instance
Definition main.cc:48
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
g_object_add_weak_pointer(G_OBJECT(self), reinterpret_cast< gpointer * >(&self->engine))
DEF_SWITCHES_START aot vmservice shared library name
Definition switches.h:32