1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 04:47:34 +00:00

AK: Rename Time to Duration

That's what this class really is; in fact that's what the first line of
the comment says it is.

This commit does not rename the main files, since those will contain
other time-related classes in a little bit.
This commit is contained in:
kleines Filmröllchen 2023-03-13 16:30:34 +01:00 committed by Jelle Raaijmakers
parent 82ddc813d5
commit 213025f210
140 changed files with 634 additions and 628 deletions

View file

@ -1602,7 +1602,7 @@ Messages::WebDriverClient::AddCookieResponse WebDriverConnection::add_cookie(Jso
if (data.has("expiry"sv)) {
// NOTE: less than 0 or greater than safe integer are handled by the JSON parser
auto expiry = TRY(get_property<u32>(data, "expiry"sv));
cookie.expiry_time_from_expires_attribute = Time::from_seconds(expiry);
cookie.expiry_time_from_expires_attribute = Duration::from_seconds(expiry);
}
// Cookie same site
@ -1958,7 +1958,7 @@ Gfx::IntRect WebDriverConnection::iconify_the_window()
ErrorOr<JsonArray, Web::WebDriver::Error> WebDriverConnection::find(StartNodeGetter&& start_node_getter, Web::WebDriver::LocationStrategy using_, StringView value)
{
// 1. Let end time be the current time plus the session implicit wait timeout.
auto end_time = Time::now_monotonic() + Time::from_milliseconds(static_cast<i64>(m_timeouts_configuration.implicit_wait_timeout));
auto end_time = Duration::now_monotonic() + Duration::from_milliseconds(static_cast<i64>(m_timeouts_configuration.implicit_wait_timeout));
// 2. Let location strategy be equal to using.
auto location_strategy = using_;
@ -1985,7 +1985,7 @@ ErrorOr<JsonArray, Web::WebDriver::Error> WebDriverConnection::find(StartNodeGet
return true;
// 6. If elements returned is empty and the current time is less than end time return to step 4. Otherwise, continue to the next step.
return maybe_elements.value()->length() != 0 || Time::now_monotonic() >= end_time;
return maybe_elements.value()->length() != 0 || Duration::now_monotonic() >= end_time;
});
auto elements = TRY(maybe_elements);
@ -2039,7 +2039,7 @@ void WebDriverConnection::delete_cookies(Optional<StringView> const& name)
// -> name is equal to cookie name
if (!name.has_value() || name.value() == cookie.name) {
// Set the cookie expiry time to a Unix timestamp in the past.
cookie.expiry_time = Time::from_seconds(0);
cookie.expiry_time = Duration::from_seconds(0);
m_page_client.page_did_update_cookie(move(cookie));
}
// -> Otherwise