mirror of
https://github.com/servo/servo.git
synced 2025-07-17 04:13:42 +01:00
serious mode engaged: start of embedding crate using FFI
current status ============= [ ] Successfully crashing CEF [X] Successfully not crashing CEF
This commit is contained in:
parent
4d188e2ccd
commit
faa7f1885c
12 changed files with 504 additions and 14 deletions
29
src/components/embedding/browser.rs
Normal file
29
src/components/embedding/browser.rs
Normal file
|
@ -0,0 +1,29 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
|
||||
use libc::{calloc, size_t,c_int};
|
||||
use std::mem;
|
||||
use types::{cef_browser_settings_t, cef_browser_t, cef_client_t, cef_request_context_t, cef_string_t, cef_window_info_t};
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn cef_browser_host_create_browser(windowInfo: *cef_window_info_t,
|
||||
client: *mut cef_client_t,
|
||||
url: *cef_string_t,
|
||||
settings: *cef_browser_settings_t,
|
||||
request_context: *mut cef_request_context_t) -> c_int {
|
||||
0
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn cef_browser_host_create_browser_sync(windowInfo: *cef_window_info_t,
|
||||
client: *mut cef_client_t,
|
||||
url: *cef_string_t,
|
||||
settings: *cef_browser_settings_t,
|
||||
request_context: *mut cef_request_context_t) -> *mut cef_browser_t {
|
||||
unsafe {
|
||||
let browser = calloc(1, mem::size_of::<cef_browser_t>() as size_t) as *mut cef_browser_t;
|
||||
browser
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue