chromium/ui/base/glib/scoped_gsignal.h

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef UI_BASE_GLIB_SCOPED_GSIGNAL_H_
#define UI_BASE_GLIB_SCOPED_GSIGNAL_H_

#include <glib-object.h>
#include <glib.h>

#include <memory>
#include <utility>

#include "base/component_export.h"
#include "base/functional/callback.h"
#include "base/logging.h"
#include "base/memory/raw_ptr.h"
#include "base/sequence_checker.h"
#include "ui/base/glib/scoped_gobject.h"

// ScopedGSignal manages the lifecycle of a GLib signal connection.
// It disconnects the signal when this object is destroyed or goes out of scope.
// This class should be used on a single sequence.
class COMPONENT_EXPORT(UI_BASE) ScopedGSignal {};

#endif  // UI_BASE_GLIB_SCOPED_GSIGNAL_H_