-
-
Notifications
You must be signed in to change notification settings - Fork 455
fix(android): Speed up async dev assets loading #1715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "wry": minor | ||
| --- | ||
|
|
||
| On Android, release REQUEST_HANDLER mutex sooner by cloning the underlying Send + Sync handler. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -644,7 +644,7 @@ struct WebViewAttributes<'a> { | |
| /// locate your files in those directories. For more information, see [Loading in-app content](https://developer.android.com/guide/webapps/load-local-content) page. | ||
| /// - iOS: To get the path of your assets, you can call [`CFBundle::resources_path`](https://docs.rs/core-foundation/latest/core_foundation/bundle/struct.CFBundle.html#method.resources_path). So url like `wry://assets/index.html` could get the html file in assets directory. | ||
| pub custom_protocols: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lucasfernog We do require
Alternatively, we could send the request to main thread and handle things there |
||
| HashMap<String, Box<dyn Fn(WebViewId, Request<Vec<u8>>, RequestAsyncResponder)>>, | ||
| HashMap<String, Box<dyn Fn(WebViewId, Request<Vec<u8>>, RequestAsyncResponder) + Send + Sync>>, | ||
|
|
||
| /// The IPC handler to receive the message from Javascript on webview | ||
| /// using `window.ipc.postMessage("insert_message_here")` to host Rust code. | ||
|
|
@@ -1037,7 +1037,7 @@ impl<'a> WebViewBuilder<'a> { | |
| #[cfg(feature = "protocol")] | ||
| pub fn with_custom_protocol<F>(mut self, name: String, handler: F) -> Self | ||
| where | ||
| F: Fn(WebViewId, Request<Vec<u8>>) -> Response<Cow<'static, [u8]>> + 'static, | ||
| F: Fn(WebViewId, Request<Vec<u8>>) -> Response<Cow<'static, [u8]>> + Send + Sync + 'static, | ||
| { | ||
| #[cfg(any( | ||
| target_os = "linux", | ||
|
|
@@ -1102,7 +1102,7 @@ impl<'a> WebViewBuilder<'a> { | |
| #[cfg(feature = "protocol")] | ||
| pub fn with_asynchronous_custom_protocol<F>(mut self, name: String, handler: F) -> Self | ||
| where | ||
| F: Fn(WebViewId, Request<Vec<u8>>, RequestAsyncResponder) + 'static, | ||
| F: Fn(WebViewId, Request<Vec<u8>>, RequestAsyncResponder) + Send + Sync + 'static, | ||
| { | ||
| #[cfg(any( | ||
| target_os = "linux", | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.