mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-27 06:48:12 +08:00
Desktop: Cleaner CEF bidirectional message implementation (#2950)
* Rename CEF implementations to match the process they are called in * Rename CEF implementations to match the process they are called in * Implement ipc abstraction * Call js function `receiveNativeMessage` for all SendToJS ipc messages * Allow js to call `sendNativeMessage` for sending messages to the browser process Co-authored-by: Adam <adamgerhant@gmail.com> Co-authored-by: Dennis Kobert <dennis@kobert.dev> * Fix missing safety consideration --------- Co-authored-by: Adam <adamgerhant@gmail.com> Co-authored-by: Dennis Kobert <dennis@kobert.dev>
This commit is contained in:
co-authored by
Adam
Dennis Kobert
parent
7bdf1670b5
commit
83d39fb320
@@ -8,7 +8,9 @@ mod context;
|
||||
mod dirs;
|
||||
mod input;
|
||||
mod internal;
|
||||
mod ipc;
|
||||
mod scheme_handler;
|
||||
mod utility;
|
||||
|
||||
pub(crate) use context::{Context, InitError, Initialized, Setup, SetupError};
|
||||
use winit::event_loop::EventLoopProxy;
|
||||
@@ -19,6 +21,7 @@ pub(crate) trait CefEventHandler: Clone {
|
||||
/// Scheudule the main event loop to run the cef event loop after the timeout
|
||||
/// [`_cef_browser_process_handler_t::on_schedule_message_pump_work`] for more documentation.
|
||||
fn schedule_cef_message_loop_work(&self, scheduled_time: Instant);
|
||||
fn receive_web_message(&self, message: &[u8]);
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
@@ -116,4 +119,6 @@ impl CefEventHandler for CefHandler {
|
||||
fn schedule_cef_message_loop_work(&self, scheduled_time: std::time::Instant) {
|
||||
let _ = self.event_loop_proxy.send_event(CustomEvent::ScheduleBrowserWork(scheduled_time));
|
||||
}
|
||||
|
||||
fn receive_web_message(&self, message: &[u8]) {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user