LibWeb: Make DOMException take error message as a String

There was no need to use FlyString for error messages, and it just
caused a bunch of churn since these strings typically only existed
during the lifetime of the error.
This commit is contained in:
Andreas Kling 2024-10-12 20:56:21 +02:00 committed by Andreas Kling
parent 5f9a36feac
commit 175f3febb8
Notes: github-actions[bot] 2024-10-12 19:15:13 +00:00
89 changed files with 464 additions and 462 deletions

View file

@ -395,7 +395,7 @@ WebIDL::ExceptionOr<void> HTMLMediaElement::set_volume(double volume)
// set to the new value. If the new value is outside the range 0.0 to 1.0 inclusive, then, on setting, an
// "IndexSizeError" DOMException must be thrown instead.
if (volume < 0.0 || volume > 1.0)
return WebIDL::IndexSizeError::create(realm(), "Volume must be in the range 0.0 to 1.0, inclusive"_fly_string);
return WebIDL::IndexSizeError::create(realm(), "Volume must be in the range 0.0 to 1.0, inclusive"_string);
m_volume = volume;
volume_or_muted_attribute_changed();
@ -548,7 +548,7 @@ WebIDL::ExceptionOr<void> HTMLMediaElement::load_element()
// 2. Take pending play promises and reject pending play promises with the result and an "AbortError" DOMException.
auto promises = take_pending_play_promises();
reject_pending_play_promises<WebIDL::AbortError>(promises, "Media playback was aborted"_fly_string);
reject_pending_play_promises<WebIDL::AbortError>(promises, "Media playback was aborted"_string);
}
// 7. If seeking is true, set it to false.
@ -1290,7 +1290,7 @@ WebIDL::ExceptionOr<void> HTMLMediaElement::handle_media_source_failure(Span<JS:
dispatch_event(DOM::Event::create(realm, HTML::EventNames::error));
// 6. Reject pending play promises with promises and a "NotSupportedError" DOMException.
reject_pending_play_promises<WebIDL::NotSupportedError>(promises, "Media is not supported"_fly_string);
reject_pending_play_promises<WebIDL::NotSupportedError>(promises, "Media is not supported"_string);
// 7. Set the element's delaying-the-load-event flag to false. This stops delaying the load event.
m_delaying_the_load_event.clear();
@ -1516,7 +1516,7 @@ WebIDL::ExceptionOr<void> HTMLMediaElement::pause_element()
dispatch_event(DOM::Event::create(realm, HTML::EventNames::pause));
// 3. Reject pending play promises with promises and an "AbortError" DOMException.
reject_pending_play_promises<WebIDL::AbortError>(promises, "Media playback was paused"_fly_string);
reject_pending_play_promises<WebIDL::AbortError>(promises, "Media playback was paused"_string);
});
// 4. Set the official playback position to the current playback position.
@ -1768,7 +1768,7 @@ void HTMLMediaElement::reached_end_of_media_playback()
// 3. Take pending play promises and reject pending play promises with the result and an "AbortError" DOMException.
auto promises = take_pending_play_promises();
reject_pending_play_promises<WebIDL::AbortError>(promises, "Media playback has ended"_fly_string);
reject_pending_play_promises<WebIDL::AbortError>(promises, "Media playback has ended"_string);
}
});