mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:57:45 +00:00
Everywhere: Rename {Deprecated => Byte}String
This commit un-deprecates DeprecatedString, and repurposes it as a byte string. As the null state has already been removed, there are no other particularly hairy blockers in repurposing this type as a byte string (what it _really_ is). This commit is auto-generated: $ xs=$(ack -l \bDeprecatedString\b\|deprecated_string AK Userland \ Meta Ports Ladybird Tests Kernel) $ perl -pie 's/\bDeprecatedString\b/ByteString/g; s/deprecated_string/byte_string/g' $xs $ clang-format --style=file -i \ $(git diff --name-only | grep \.cpp\|\.h) $ gn format $(git ls-files '*.gn' '*.gni')
This commit is contained in:
parent
38d62563b3
commit
5e1499d104
1615 changed files with 10257 additions and 10257 deletions
|
@ -7,7 +7,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/ByteString.h>
|
||||
#include <AK/URL.h>
|
||||
#include <AK/URLParser.h>
|
||||
|
||||
|
@ -16,7 +16,7 @@ namespace Web::HTML {
|
|||
class Origin {
|
||||
public:
|
||||
Origin() = default;
|
||||
Origin(Optional<DeprecatedString> const& scheme, AK::URL::Host const& host, u16 port)
|
||||
Origin(Optional<ByteString> const& scheme, AK::URL::Host const& host, u16 port)
|
||||
: m_scheme(scheme)
|
||||
, m_host(host)
|
||||
, m_port(port)
|
||||
|
@ -72,7 +72,7 @@ public:
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/origin.html#ascii-serialisation-of-an-origin
|
||||
DeprecatedString serialize() const
|
||||
ByteString serialize() const
|
||||
{
|
||||
// 1. If origin is an opaque origin, then return "null"
|
||||
if (is_opaque())
|
||||
|
@ -86,15 +86,15 @@ public:
|
|||
result.append("://"sv);
|
||||
|
||||
// 4. Append origin's host, serialized, to result.
|
||||
result.append(URLParser::serialize_host(host()).release_value_but_fixme_should_propagate_errors().to_deprecated_string());
|
||||
result.append(URLParser::serialize_host(host()).release_value_but_fixme_should_propagate_errors().to_byte_string());
|
||||
|
||||
// 5. If origin's port is non-null, append a U+003A COLON character (:), and origin's port, serialized, to result.
|
||||
if (port() != 0) {
|
||||
result.append(':');
|
||||
result.append(DeprecatedString::number(port()));
|
||||
result.append(ByteString::number(port()));
|
||||
}
|
||||
// 6. Return result
|
||||
return result.to_deprecated_string();
|
||||
return result.to_byte_string();
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/origin.html#concept-origin-effective-domain
|
||||
|
@ -113,7 +113,7 @@ public:
|
|||
bool operator==(Origin const& other) const { return is_same_origin(other); }
|
||||
|
||||
private:
|
||||
Optional<DeprecatedString> m_scheme;
|
||||
Optional<ByteString> m_scheme;
|
||||
AK::URL::Host m_host;
|
||||
u16 m_port { 0 };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue