Bug 1872200 - remove UniFFI `extern-rustbuffer` feature. r=janerik

Differential Revision: https://phabricator.services.mozilla.com/D197925
This commit is contained in:
Ben Dean-Kawamura 2024-01-09 14:31:54 +00:00
Родитель beab1b9637
Коммит 84731a5a80
3 изменённых файлов: 19 добавлений и 3 удалений

2
Cargo.lock сгенерированный
Просмотреть файл

@ -2239,6 +2239,7 @@ dependencies = [
"tabs",
"unic-langid",
"unic-langid-ffi",
"uniffi",
"uniffi-example-arithmetic",
"uniffi-example-custom-types",
"uniffi-example-geometry",
@ -2247,7 +2248,6 @@ dependencies = [
"uniffi-example-todolist",
"uniffi-fixture-callbacks",
"uniffi-fixture-external-types",
"uniffi_core",
"url",
"viaduct",
"webext_storage_bridge",

Просмотреть файл

@ -80,8 +80,7 @@ uniffi-fixture-external-types = { path = "../../../components/uniffi-fixture-ext
binary_http = { path = "../../../../netwerk/protocol/http/binary_http" }
oblivious_http = { path = "../../../../netwerk/protocol/http/oblivious_http" }
mime-guess-ffi = { path = "../../../../dom/fs/parent/rust/mime-guess-ffi" }
# Explicitly list the `uniffi_core` dependency so we can enable the `extern-rustbuffer` feature.
uniffi_core = { version = "0.25.2", features = ["extern-rustbuffer"] }
uniffi = { version = "0.25.2" }
# Note: `modern_sqlite` means rusqlite's bindings file be for a sqlite with
# version less than or equal to what we link to. This isn't a problem because we

Просмотреть файл

@ -171,3 +171,20 @@ pub unsafe extern "C" fn debug_log(target: *const c_char, message: *const c_char
// NOTE: The `info!` log macro is used here because we have the `release_max_level_info` feature set.
info!(target: CStr::from_ptr(target).to_str().unwrap(), "{}", CStr::from_ptr(message).to_str().unwrap());
}
// Define extern "C" versions of these UniFFI functions, so that they can be called from C++
#[no_mangle]
pub extern "C" fn uniffi_rustbuffer_alloc(
size: i32,
call_status: &mut uniffi::RustCallStatus,
) -> uniffi::RustBuffer {
uniffi::uniffi_rustbuffer_alloc(size, call_status)
}
#[no_mangle]
pub extern "C" fn uniffi_rustbuffer_free(
buf: uniffi::RustBuffer,
call_status: &mut uniffi::RustCallStatus,
) {
uniffi::uniffi_rustbuffer_free(buf, call_status)
}