mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-29 23:08: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
@@ -0,0 +1,6 @@
|
||||
pub unsafe fn pointer_to_string(pointer: *mut cef::sys::_cef_string_utf16_t) -> String {
|
||||
let str = unsafe { (*pointer).str_ };
|
||||
let len = unsafe { (*pointer).length };
|
||||
let slice = unsafe { std::slice::from_raw_parts(str, len) };
|
||||
String::from_utf16(slice).unwrap()
|
||||
}
|
||||
Reference in New Issue
Block a user