web: Remove unwraps from Rust glue

* Remove all unwraps from web/lib.rs.
 * Add convenience methods for grabbing the Ruffle web instance.
   These methods also avoid panics/unwraps when borrowing
   `RefCell`/`Mutex`.
 * Use `warn_on_error` to avoid unwraps from web APIs.
This commit is contained in:
Mike Welsh 2021-04-26 22:17:47 -07:00
parent f2256a661b
commit 6cf8b660d5
3 changed files with 615 additions and 577 deletions

1
Cargo.lock generated
View File

@ -3037,6 +3037,7 @@ dependencies = [
"ruffle_render_webgl",
"ruffle_web_common",
"serde",
"thiserror",
"url",
"wasm-bindgen",
"wasm-bindgen-futures",

View File

@ -37,6 +37,7 @@ wasm-bindgen-futures = "0.4.19"
chrono = { version = "0.4", features = ["wasmbind"] }
getrandom = { version = "0.2", features = ["js"] }
serde = { version = "1.0.125", features = ["derive"] }
thiserror = "1.0"
[dependencies.ruffle_core]
path = "../core"

File diff suppressed because it is too large Load Diff