#include "ui/events/platform/wayland/wayland_event_watcher.h"
#include <wayland-client-core.h>
#include <cstring>
#include "base/check.h"
#include "base/environment.h"
#include "base/logging.h"
#include "base/nix/xdg_util.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/synchronization/waitable_event.h"
#include "base/task/current_thread.h"
#include "base/threading/thread.h"
#include "components/crash/core/common/crash_key.h"
#include "third_party/re2/src/re2/re2.h"
namespace ui {
namespace {
void FormatErrorMessage(std::string* message) { … }
std::optional<std::string>& GetErrorLog() { … }
void wayland_log(const char* fmt, va_list argp) { … }
std::string GetWaylandProtocolError(int err, wl_display* display) { … }
void RecordCrashKeys(const std::string& error_string) { … }
}
class WaylandEventWatcherThread : public base::Thread { … };
WaylandEventWatcher::WaylandEventWatcher(wl_display* display,
wl_event_queue* event_queue,
bool use_threaded_polling)
: … { … }
WaylandEventWatcher::~WaylandEventWatcher() { … }
void WaylandEventWatcher::SetShutdownCb(
base::OnceCallback<void()> shutdown_cb) { … }
void WaylandEventWatcher::StartProcessingEvents() { … }
void WaylandEventWatcher::StartProcessingEventsInternal() { … }
void WaylandEventWatcher::StartProcessingEventsThread() { … }
void WaylandEventWatcher::RoundTripQueue() { … }
void WaylandEventWatcher::StopProcessingEvents() { … }
void WaylandEventWatcher::StopProcessingEventsInternal() { … }
void WaylandEventWatcher::Flush() { … }
bool WaylandEventWatcher::WlDisplayPrepareToRead() { … }
void WaylandEventWatcher::WlDisplayReadEvents() { … }
void WaylandEventWatcher::WlDisplayCancelRead() { … }
void WaylandEventWatcher::WlDisplayDispatchPendingQueue() { … }
void WaylandEventWatcher::WlDisplayDispatchPendingQueueInternal(
base::WaitableEvent* event) { … }
void WaylandEventWatcher::WlDisplayCheckForErrors() { … }
}