remove direct memory access

This commit is contained in:
yggverse 2025-03-14 12:51:33 +02:00
parent 33369e31ea
commit 19a07cdf1d
32 changed files with 112 additions and 111 deletions

View file

@ -9,21 +9,21 @@ use gtk::{
glib::{Uri, UriFlags},
prelude::{ActionExt, CancellableExt},
};
use std::{cell::Cell, rc::Rc};
use std::{cell::Cell, rc::Rc, sync::Arc};
/// Multi-protocol client API for tab `Item`
pub struct Client {
cancellable: Cell<Cancellable>,
driver: Rc<Driver>,
page: Rc<Page>,
profile: Rc<Profile>,
profile: Arc<Profile>,
}
impl Client {
// Constructors
/// Create new `Self`
pub fn init(profile: &Rc<Profile>, page: &Rc<Page>) -> Self {
pub fn init(profile: &Arc<Profile>, page: &Rc<Page>) -> Self {
Self {
cancellable: Cell::new(Cancellable::new()),
driver: Rc::new(Driver::build(page)),
@ -108,7 +108,7 @@ impl Client {
/// Create request using async DNS resolver (slow method)
/// * return suggestion [Uri](https://docs.gtk.org/glib/struct.Uri.html) on failure (to handle as redirect)
fn lookup(
profile: &Rc<Profile>,
profile: &Arc<Profile>,
query: &str,
cancellable: Cancellable,
callback: impl FnOnce(Rc<Feature>, Cancellable, Result<Uri, String>) + 'static,