gpui-component/crates/wef/cpp/external_pump.h
Sunli b70b229370
wef: Added a new WebView component named "Wef" based on CEF. (#877)
Wef is a Rust library for embedding WebView functionality using Chromium
Embedded Framework (CEF3) with offscreen rendering support.
2025-06-17 18:57:44 +08:00

29 lines
572 B
C++

#pragma once
#include <stdint.h>
#include <memory>
class ExternalPump {
public:
ExternalPump() {}
virtual ~ExternalPump() {}
static std::unique_ptr<ExternalPump> Create();
virtual void OnScheduleMessagePumpWork(int64_t delay_ms) = 0;
protected:
void OnScheduleWork(int64_t delay_ms);
void OnTimerTimeout();
virtual void SetTimer(int64_t delay_ms) = 0;
virtual void KillTimer() = 0;
virtual bool IsTimerPending() = 0;
private:
void DoWork();
bool PerformMessageLoopWork();
bool is_active_ = false;
bool reentrancy_detected_ = false;
};