mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-02-06 13:17:02 +00:00
use debug_cell
This commit is contained in:
parent
ede0c8ebe8
commit
58dbfc6d75
19
Cargo.lock
generated
19
Cargo.lock
generated
@ -1394,7 +1394,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c"
|
||||
dependencies = [
|
||||
"lazy_static",
|
||||
"windows-sys 0.48.0",
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2046,6 +2046,12 @@ dependencies = [
|
||||
"subtle",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dioxus-debug-cell"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2ea539174bb236e0e7dc9c12b19b88eae3cb574dedbd0252a2d43ea7e6de13e2"
|
||||
|
||||
[[package]]
|
||||
name = "dirs"
|
||||
version = "5.0.1"
|
||||
@ -2085,7 +2091,7 @@ dependencies = [
|
||||
"libc",
|
||||
"option-ext",
|
||||
"redox_users 0.5.0",
|
||||
"windows-sys 0.60.2",
|
||||
"windows-sys 0.61.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -4480,7 +4486,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"windows-targets 0.48.5",
|
||||
"windows-targets 0.52.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -6007,7 +6013,7 @@ dependencies = [
|
||||
"aes-gcm",
|
||||
"aes-kw",
|
||||
"argon2",
|
||||
"base64 0.21.7",
|
||||
"base64 0.22.1",
|
||||
"bitfield",
|
||||
"block-padding",
|
||||
"blowfish",
|
||||
@ -7392,7 +7398,7 @@ dependencies = [
|
||||
"security-framework 3.5.1",
|
||||
"security-framework-sys",
|
||||
"webpki-root-certs",
|
||||
"windows-sys 0.60.2",
|
||||
"windows-sys 0.61.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -9078,6 +9084,7 @@ dependencies = [
|
||||
"base64 0.22.1",
|
||||
"cef",
|
||||
"cef-dll-sys",
|
||||
"dioxus-debug-cell",
|
||||
"dirs 6.0.0",
|
||||
"gtk",
|
||||
"html5ever",
|
||||
@ -10552,7 +10559,7 @@ version = "0.1.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb"
|
||||
dependencies = [
|
||||
"windows-sys 0.48.0",
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
@ -10,6 +10,7 @@ edition.workspace = true
|
||||
rust-version.workspace = true
|
||||
|
||||
[dependencies]
|
||||
dioxus-debug-cell = "0.1"
|
||||
tauri-runtime = { version = "2.9.2", path = "../tauri-runtime" }
|
||||
tauri-utils = { version = "2.8.0", path = "../tauri-utils", features = [
|
||||
"html-manipulation",
|
||||
|
||||
@ -4,9 +4,9 @@
|
||||
|
||||
use base64::Engine;
|
||||
use cef::{rc::*, *};
|
||||
use dioxus_debug_cell::RefCell;
|
||||
use sha2::{Digest, Sha256};
|
||||
use std::{
|
||||
cell::RefCell,
|
||||
collections::HashMap,
|
||||
sync::{
|
||||
atomic::{AtomicBool, AtomicU32, Ordering},
|
||||
@ -831,7 +831,7 @@ wrap_browser_view_delegate! {
|
||||
impl BrowserViewDelegate {
|
||||
fn on_browser_created(&self, _browser_view: Option<&mut BrowserView>, browser: Option<&mut Browser>) {
|
||||
if let Some(browser) = browser {
|
||||
self.browser_id.replace(browser.identifier());
|
||||
let _ = std::mem::replace(&mut *self.browser_id.borrow_mut(), browser.identifier());
|
||||
}
|
||||
}
|
||||
|
||||
@ -2586,7 +2586,7 @@ wrap_task! {
|
||||
|
||||
impl Task {
|
||||
fn execute(&self) {
|
||||
handle_message(&self.context, self.message.replace(Message::Noop));
|
||||
handle_message(&self.context, std::mem::replace(&mut self.message.borrow_mut(), Message::Noop));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,12 +4,12 @@
|
||||
|
||||
use std::{
|
||||
borrow::Cow,
|
||||
cell::RefCell,
|
||||
io::{Cursor, Read},
|
||||
sync::Arc,
|
||||
};
|
||||
|
||||
use cef::{rc::*, *};
|
||||
use dioxus_debug_cell::RefCell;
|
||||
use html5ever::{interface::QualName, namespace_url, ns, LocalName};
|
||||
use http::{
|
||||
header::{CONTENT_SECURITY_POLICY, CONTENT_TYPE},
|
||||
|
||||
@ -27,8 +27,8 @@ use url::Url;
|
||||
#[cfg(windows)]
|
||||
use windows::Win32::Foundation::HWND;
|
||||
|
||||
use dioxus_debug_cell::RefCell;
|
||||
use std::{
|
||||
cell::RefCell,
|
||||
collections::HashMap,
|
||||
fmt,
|
||||
fs::create_dir_all,
|
||||
@ -2210,11 +2210,9 @@ impl<T: UserEvent> Runtime<T> for CefRuntime<T> {
|
||||
let callback = Arc::new(RefCell::new(callback));
|
||||
let callback_ = callback.clone();
|
||||
let event_tx_ = self.event_tx.clone();
|
||||
let _ = self
|
||||
.context
|
||||
.cef_context
|
||||
.callback
|
||||
.replace(Box::new(move |event| {
|
||||
let _ = std::mem::replace(
|
||||
&mut *self.context.cef_context.callback.borrow_mut(),
|
||||
Box::new(move |event| {
|
||||
if let RunEvent::Exit = event {
|
||||
// notify the event loop to exit
|
||||
let _ = event_tx_.send(RunEvent::Exit);
|
||||
@ -2226,7 +2224,8 @@ impl<T: UserEvent> Runtime<T> for CefRuntime<T> {
|
||||
let _ = event_tx_.send(event);
|
||||
}
|
||||
}
|
||||
}));
|
||||
}),
|
||||
);
|
||||
|
||||
'main_loop: loop {
|
||||
while let Ok(event) = self.event_rx.try_recv() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user