1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
pub mod task;
pub use task::{Task, TaskBase, TaskImpl};
use crate::support::Delete;
use crate::support::Opaque;
use crate::support::UniquePtr;
use crate::Isolate;
extern "C" {
fn v8__platform__NewDefaultPlatform() -> *mut Platform;
fn v8__Platform__DELETE(this: &'static mut Platform) -> ();
}
pub fn new_default_platform() -> UniquePtr<Platform> {
unsafe { UniquePtr::from_raw(v8__platform__NewDefaultPlatform()) }
}
#[repr(C)]
pub struct Platform(Opaque);
impl Delete for Platform {
fn delete(&'static mut self) {
unsafe { v8__Platform__DELETE(self) }
}
}
impl Platform {
pub fn pump_message_loop(_platform: &Self, _isolate: &Isolate) -> bool {
todo!()
}
}