mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
Everywhere: Slap some [[clang::lifetimebound]] where appropriate
This first pass only applies to the following two cases: - Public functions returning a view type into an object they own - Public ctors storing a view type This catches a grand total of one (1) issue, which is fixed in the previous commit.
This commit is contained in:
parent
8b3e888920
commit
4462348916
Notes:
github-actions[bot]
2025-09-01 09:12:52 +00:00
Author: https://github.com/alimpfard
Commit: 4462348916
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6028
Reviewed-by: https://github.com/gmta ✅
45 changed files with 92 additions and 83 deletions
|
|
@ -27,9 +27,9 @@ class SegmentInformation {
|
|||
public:
|
||||
u64 timestamp_scale() const { return m_timestamp_scale; }
|
||||
void set_timestamp_scale(u64 timestamp_scale) { m_timestamp_scale = timestamp_scale; }
|
||||
Utf8View muxing_app() const { return Utf8View(m_muxing_app); }
|
||||
Utf8View muxing_app() const LIFETIME_BOUND { return Utf8View(m_muxing_app); }
|
||||
void set_muxing_app(ByteString muxing_app) { m_muxing_app = move(muxing_app); }
|
||||
Utf8View writing_app() const { return Utf8View(m_writing_app); }
|
||||
Utf8View writing_app() const LIFETIME_BOUND { return Utf8View(m_writing_app); }
|
||||
void set_writing_app(ByteString writing_app) { m_writing_app = move(writing_app); }
|
||||
Optional<double> duration_unscaled() const { return m_duration_unscaled; }
|
||||
void set_duration_unscaled(double duration) { m_duration_unscaled.emplace(duration); }
|
||||
|
|
@ -120,7 +120,7 @@ public:
|
|||
void set_language(FlyString const& language) { m_language = language; }
|
||||
FlyString codec_id() const { return m_codec_id; }
|
||||
void set_codec_id(FlyString const& codec_id) { m_codec_id = codec_id; }
|
||||
ReadonlyBytes codec_private_data() const { return m_codec_private_data.span(); }
|
||||
ReadonlyBytes codec_private_data() const LIFETIME_BOUND { return m_codec_private_data.span(); }
|
||||
ErrorOr<void> set_codec_private_data(ReadonlyBytes codec_private_data)
|
||||
{
|
||||
m_codec_private_data = TRY(FixedArray<u8>::create(codec_private_data));
|
||||
|
|
|
|||
|
|
@ -63,12 +63,12 @@ public:
|
|||
}
|
||||
|
||||
DecoderErrorCategory category() const { return m_category; }
|
||||
StringView description() const
|
||||
StringView description() const LIFETIME_BOUND
|
||||
{
|
||||
return m_description.visit([](StringView x) { return x; }, [](ByteString const& x) { return x.view(); });
|
||||
}
|
||||
// For compatibility with AK::Error
|
||||
StringView string_literal() const { return description(); }
|
||||
StringView string_literal() const LIFETIME_BOUND { return description(); }
|
||||
|
||||
private:
|
||||
template<OneOf<StringView, ByteString> T>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue