core,web: Replace `instant` with `web-time`

This commit is contained in:
TÖRÖK Attila 2023-10-28 01:30:29 +02:00
parent ac93947c22
commit 0c0b86c008
11 changed files with 13 additions and 14 deletions

6
Cargo.lock generated
View File

@ -4039,7 +4039,6 @@ dependencies = [
"hashbrown 0.14.2", "hashbrown 0.14.2",
"image", "image",
"indexmap 2.0.2", "indexmap 2.0.2",
"instant",
"jpegxr", "jpegxr",
"linkme", "linkme",
"lzma-rs", "lzma-rs",
@ -4068,6 +4067,7 @@ dependencies = [
"url", "url",
"wasm-bindgen-futures", "wasm-bindgen-futures",
"weak-table", "weak-table",
"web-time",
] ]
[[package]] [[package]]
@ -5608,9 +5608,9 @@ dependencies = [
[[package]] [[package]]
name = "web-time" name = "web-time"
version = "0.2.2" version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8208e3fdbc243c8fd30805721869242a7f6de3e2e9f3b057652ab36e52ae1e87" checksum = "57099a701fb3a8043f993e8228dc24229c7b942e2b009a1b962e54489ba1d3bf"
dependencies = [ dependencies = [
"js-sys", "js-sys",
"wasm-bindgen", "wasm-bindgen",

View File

@ -388,7 +388,6 @@ Ruffle depends on third-party libraries with compatible licenses.
| [indexmap](https://github.com/bluss/indexmap) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2016--2017 | | [indexmap](https://github.com/bluss/indexmap) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2016--2017 |
| [indicatif](https://github.com/mitsuhiko/indicatif) | [MIT](#MIT) | Copyright (c) 2017 Armin Ronacher <armin.ronacher@active-4.com> | | [indicatif](https://github.com/mitsuhiko/indicatif) | [MIT](#MIT) | Copyright (c) 2017 Armin Ronacher <armin.ronacher@active-4.com> |
| [inplace_it](https://github.com/NotIntMan/inplace_it) | [MIT](#MIT) | Copyright (c) 2018 Dmitry Demin <shepardiwe@gmail.com> | | [inplace_it](https://github.com/NotIntMan/inplace_it) | [MIT](#MIT) | Copyright (c) 2018 Dmitry Demin <shepardiwe@gmail.com> |
| [instant](https://github.com/sebcrozet/instant) | [BSD-3-Clause](#BSD-3-Clause) | Copyright (c) 2019, Sébastien Crozet |
| [iovec](https://github.com/carllerche/iovec) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2017 Carl Lerche | | [iovec](https://github.com/carllerche/iovec) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2017 Carl Lerche |
| [isahc](https://github.com/sagebind/isahc) | [MIT](#MIT) | Copyright (c) 2019 Stephen M. Coakley | | [isahc](https://github.com/sagebind/isahc) | [MIT](#MIT) | Copyright (c) 2019 Stephen M. Coakley |
| [itoa](https://github.com/dtolnay/itoa) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) David Tolnay <dtolnay@gmail.com> | | [itoa](https://github.com/dtolnay/itoa) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) David Tolnay <dtolnay@gmail.com> |
@ -609,6 +608,7 @@ Ruffle depends on third-party libraries with compatible licenses.
| [wayland-sys](https://github.com/smithay/wayland-rs) | [MIT](#MIT) | Copyright (c) 2015 Victor Berger | | [wayland-sys](https://github.com/smithay/wayland-rs) | [MIT](#MIT) | Copyright (c) 2015 Victor Berger |
| [weak-table](https://github.com/tov/weak-table-rs) | [MIT](#MIT) | Copyright (c) 2018 Jesse A. Tov | | [weak-table](https://github.com/tov/weak-table-rs) | [MIT](#MIT) | Copyright (c) 2018 Jesse A. Tov |
| [web-sys](https://github.com/rustwasm/wasm-bindgen/tree/master/crates/web-sys) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2014 Alex Crichton | | [web-sys](https://github.com/rustwasm/wasm-bindgen/tree/master/crates/web-sys) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2014 Alex Crichton |
| [web-time](https://github.com/daxpedda/web-time) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2023 dAxpeDDa <daxpedda@gmail.com> |
| [webbrowser](https://github.com/amodm/webbrowser-rs) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2015 Amod Malviya | | [webbrowser](https://github.com/amodm/webbrowser-rs) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2015 Amod Malviya |
| [webpki](https://github.com/briansmith/webpki) | Custom ISC-style | Copyright 2015 Brian Smith. | | [webpki](https://github.com/briansmith/webpki) | Custom ISC-style | Copyright 2015 Brian Smith. |
| [webpki-roots](https://github.com/ctz/webpki-roots) | [MPL-2.0](#MPL-20) | Copyright (c) Joseph Birr-Pixton <jpixton@gmail.com> | | [webpki-roots](https://github.com/ctz/webpki-roots) | [MPL-2.0](#MPL-20) | Copyright (c) Joseph Birr-Pixton <jpixton@gmail.com> |

View File

@ -33,7 +33,7 @@ weak-table = "0.3.2"
percent-encoding = "2.3.0" percent-encoding = "2.3.0"
thiserror = "1.0" thiserror = "1.0"
chrono = { version = "0.4", default-features = false, features = ["clock"] } chrono = { version = "0.4", default-features = false, features = ["clock"] }
instant = "0.1" web-time = "0.2.3"
encoding_rs = "0.8.33" encoding_rs = "0.8.33"
rand = { version = "0.8.5", features = ["std", "small_rng"], default-features = false } rand = { version = "0.8.5", features = ["std", "small_rng"], default-features = false }
serde = { version = "1.0.189", features = ["derive"] } serde = { version = "1.0.189", features = ["derive"] }
@ -68,7 +68,6 @@ version = "0.4.37"
[features] [features]
default = [] default = []
lzma = ["lzma-rs", "swf/lzma"] lzma = ["lzma-rs", "swf/lzma"]
wasm-bindgen = ["instant/wasm-bindgen"]
avm_debug = [] avm_debug = []
deterministic = [] deterministic = []
timeline_debug = [] timeline_debug = []

View File

@ -17,7 +17,6 @@ use crate::vminterface::Instantiator;
use crate::{avm_error, avm_warn}; use crate::{avm_error, avm_warn};
use gc_arena::{Gc, GcCell, Mutation}; use gc_arena::{Gc, GcCell, Mutation};
use indexmap::IndexMap; use indexmap::IndexMap;
use instant::Instant;
use rand::Rng; use rand::Rng;
use smallvec::SmallVec; use smallvec::SmallVec;
use std::borrow::Cow; use std::borrow::Cow;
@ -26,6 +25,7 @@ use std::fmt;
use swf::avm1::read::Reader; use swf::avm1::read::Reader;
use swf::avm1::types::*; use swf::avm1::types::*;
use url::form_urlencoded; use url::form_urlencoded;
use web_time::Instant;
use super::object_reference::MovieClipReference; use super::object_reference::MovieClipReference;

View File

@ -5,8 +5,8 @@ use crate::avm2::object::TObject;
use crate::avm2::{Activation, Error, Object, Value}; use crate::avm2::{Activation, Error, Object, Value};
use crate::string::AvmString; use crate::string::AvmString;
use crate::string::WString; use crate::string::WString;
use instant::Instant;
use std::fmt::Write; use std::fmt::Write;
use web_time::Instant;
pub mod byte_array; pub mod byte_array;
pub mod dictionary; pub mod dictionary;

View File

@ -32,8 +32,8 @@ mod decoders {
} }
} }
use instant::Duration;
use thiserror::Error; use thiserror::Error;
use web_time::Duration;
pub type SoundHandle = Index; pub type SoundHandle = Index;
pub type SoundInstanceHandle = Index; pub type SoundInstanceHandle = Index;

View File

@ -28,7 +28,6 @@ use crate::tag_utils::{SwfMovie, SwfSlice};
use crate::timer::Timers; use crate::timer::Timers;
use core::fmt; use core::fmt;
use gc_arena::{Collect, Mutation}; use gc_arena::{Collect, Mutation};
use instant::Instant;
use rand::rngs::SmallRng; use rand::rngs::SmallRng;
use ruffle_render::backend::{BitmapCacheEntry, RenderBackend}; use ruffle_render::backend::{BitmapCacheEntry, RenderBackend};
use ruffle_render::commands::CommandList; use ruffle_render::commands::CommandList;
@ -37,6 +36,7 @@ use ruffle_video::backend::VideoBackend;
use std::collections::{HashMap, VecDeque}; use std::collections::{HashMap, VecDeque};
use std::sync::{Arc, Mutex, Weak}; use std::sync::{Arc, Mutex, Weak};
use std::time::Duration; use std::time::Duration;
use web_time::Instant;
/// Minimal context, useful for manipulating the GC heap. /// Minimal context, useful for manipulating the GC heap.
pub struct GcContext<'a, 'gc> { pub struct GcContext<'a, 'gc> {

View File

@ -17,12 +17,12 @@ use crate::display_object::{
use crate::events::{ClipEvent, ClipEventResult}; use crate::events::{ClipEvent, ClipEventResult};
use bitflags::bitflags; use bitflags::bitflags;
use gc_arena::{Collect, Mutation}; use gc_arena::{Collect, Mutation};
use instant::Instant;
use ruffle_macros::enum_trait_object; use ruffle_macros::enum_trait_object;
use std::cell::{Ref, RefMut}; use std::cell::{Ref, RefMut};
use std::fmt::Debug; use std::fmt::Debug;
use std::time::Duration; use std::time::Duration;
use swf::{Point, Twips}; use swf::{Point, Twips};
use web_time::Instant;
/// Find the lowest common ancestor between the display objects in `from` and /// Find the lowest common ancestor between the display objects in `from` and
/// `to`. /// `to`.

View File

@ -49,7 +49,6 @@ use crate::timer::Timers;
use crate::vminterface::Instantiator; use crate::vminterface::Instantiator;
use crate::DefaultFont; use crate::DefaultFont;
use gc_arena::{Collect, DynamicRootSet, GcCell, Rootable}; use gc_arena::{Collect, DynamicRootSet, GcCell, Rootable};
use instant::Instant;
use rand::{rngs::SmallRng, SeedableRng}; use rand::{rngs::SmallRng, SeedableRng};
use ruffle_render::backend::{null::NullRenderer, RenderBackend, ViewportDimensions}; use ruffle_render::backend::{null::NullRenderer, RenderBackend, ViewportDimensions};
use ruffle_render::commands::CommandList; use ruffle_render::commands::CommandList;
@ -64,6 +63,7 @@ use std::str::FromStr;
use std::sync::{Arc, Mutex, Weak}; use std::sync::{Arc, Mutex, Weak};
use std::time::Duration; use std::time::Duration;
use tracing::{info, instrument}; use tracing::{info, instrument};
use web_time::Instant;
/// The newest known Flash Player version, serves as a default to /// The newest known Flash Player version, serves as a default to
/// `player_version`. /// `player_version`.

View File

@ -56,7 +56,7 @@ gloo-net = { version = "0.4.0", default-features = false, features = ["websocke
[dependencies.ruffle_core] [dependencies.ruffle_core]
path = "../core" path = "../core"
features = ["audio", "mp3", "nellymoser", "wasm-bindgen", "default_compatibility_rules", "default_font"] features = ["audio", "mp3", "nellymoser", "default_compatibility_rules", "default_font"]
[dependencies.web-sys] [dependencies.web-sys]
version = "0.3.64" version = "0.3.64"

View File

@ -388,7 +388,6 @@ Ruffle depends on third-party libraries with compatible licenses.
| [indexmap](https://github.com/bluss/indexmap) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2016--2017 | | [indexmap](https://github.com/bluss/indexmap) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2016--2017 |
| [indicatif](https://github.com/mitsuhiko/indicatif) | [MIT](#MIT) | Copyright (c) 2017 Armin Ronacher <armin.ronacher@active-4.com> | | [indicatif](https://github.com/mitsuhiko/indicatif) | [MIT](#MIT) | Copyright (c) 2017 Armin Ronacher <armin.ronacher@active-4.com> |
| [inplace_it](https://github.com/NotIntMan/inplace_it) | [MIT](#MIT) | Copyright (c) 2018 Dmitry Demin <shepardiwe@gmail.com> | | [inplace_it](https://github.com/NotIntMan/inplace_it) | [MIT](#MIT) | Copyright (c) 2018 Dmitry Demin <shepardiwe@gmail.com> |
| [instant](https://github.com/sebcrozet/instant) | [BSD-3-Clause](#BSD-3-Clause) | Copyright (c) 2019, Sébastien Crozet |
| [iovec](https://github.com/carllerche/iovec) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2017 Carl Lerche | | [iovec](https://github.com/carllerche/iovec) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2017 Carl Lerche |
| [isahc](https://github.com/sagebind/isahc) | [MIT](#MIT) | Copyright (c) 2019 Stephen M. Coakley | | [isahc](https://github.com/sagebind/isahc) | [MIT](#MIT) | Copyright (c) 2019 Stephen M. Coakley |
| [itoa](https://github.com/dtolnay/itoa) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) David Tolnay <dtolnay@gmail.com> | | [itoa](https://github.com/dtolnay/itoa) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) David Tolnay <dtolnay@gmail.com> |
@ -607,6 +606,7 @@ Ruffle depends on third-party libraries with compatible licenses.
| [wayland-sys](https://github.com/smithay/wayland-rs) | [MIT](#MIT) | Copyright (c) 2015 Victor Berger | | [wayland-sys](https://github.com/smithay/wayland-rs) | [MIT](#MIT) | Copyright (c) 2015 Victor Berger |
| [weak-table](https://github.com/tov/weak-table-rs) | [MIT](#MIT) | Copyright (c) 2018 Jesse A. Tov | | [weak-table](https://github.com/tov/weak-table-rs) | [MIT](#MIT) | Copyright (c) 2018 Jesse A. Tov |
| [web-sys](https://github.com/rustwasm/wasm-bindgen/tree/master/crates/web-sys) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2014 Alex Crichton | | [web-sys](https://github.com/rustwasm/wasm-bindgen/tree/master/crates/web-sys) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2014 Alex Crichton |
| [web-time](https://github.com/daxpedda/web-time) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2023 dAxpeDDa <daxpedda@gmail.com> |
| [webbrowser](https://github.com/amodm/webbrowser-rs) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2015 Amod Malviya | | [webbrowser](https://github.com/amodm/webbrowser-rs) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2015 Amod Malviya |
| [webpki](https://github.com/briansmith/webpki) | Custom ISC-style | Copyright 2015 Brian Smith. | | [webpki](https://github.com/briansmith/webpki) | Custom ISC-style | Copyright 2015 Brian Smith. |
| [webpki-roots](https://github.com/ctz/webpki-roots) | [MPL-2.0](#MPL-20) | Copyright (c) Joseph Birr-Pixton <jpixton@gmail.com> | | [webpki-roots](https://github.com/ctz/webpki-roots) | [MPL-2.0](#MPL-20) | Copyright (c) Joseph Birr-Pixton <jpixton@gmail.com> |