mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-27 04:37:22 +00:00
LibURL: Migrate Origin scheme from ByteString to String
This commit is contained in:
parent
7f7f6e490b
commit
2e64e0b836
Notes:
github-actions[bot]
2024-11-30 11:23:49 +00:00
Author: https://github.com/AtkinsSJ
Commit: 2e64e0b836
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2610
Reviewed-by: https://github.com/shannonbooth ✅
6 changed files with 10 additions and 13 deletions
|
@ -15,7 +15,7 @@ namespace URL {
|
|||
class Origin {
|
||||
public:
|
||||
Origin() = default;
|
||||
Origin(Optional<ByteString> const& scheme, Host const& host, Optional<u16> port)
|
||||
Origin(Optional<String> const& scheme, Host const& host, Optional<u16> port)
|
||||
: m_state(State {
|
||||
.scheme = scheme,
|
||||
.host = host,
|
||||
|
@ -27,10 +27,7 @@ public:
|
|||
// https://html.spec.whatwg.org/multipage/origin.html#concept-origin-opaque
|
||||
bool is_opaque() const { return !m_state.has_value(); }
|
||||
|
||||
StringView scheme() const
|
||||
{
|
||||
return m_state->scheme.map([](auto& str) { return str.view(); }).value_or(StringView {});
|
||||
}
|
||||
Optional<String> const& scheme() const { return m_state->scheme; }
|
||||
Host const& host() const { return m_state->host; }
|
||||
Optional<u16> port() const { return m_state->port; }
|
||||
|
||||
|
@ -97,7 +94,7 @@ public:
|
|||
|
||||
private:
|
||||
struct State {
|
||||
Optional<ByteString> scheme;
|
||||
Optional<String> scheme;
|
||||
Host host;
|
||||
Optional<u16> port;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue