mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-10 18:19:03 +00:00
AK+Everywhere: Store JSON strings as String
This commit is contained in:
parent
e591636419
commit
bc54c0cdfb
Notes:
github-actions[bot]
2025-02-21 00:29:21 +00:00
Author: https://github.com/trflynn89
Commit: bc54c0cdfb
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3631
Reviewed-by: https://github.com/awesomekling ✅
33 changed files with 163 additions and 152 deletions
|
@ -27,16 +27,16 @@ DeviceActor::~DeviceActor() = default;
|
|||
void DeviceActor::handle_message(StringView type, JsonObject const&)
|
||||
{
|
||||
if (type == "getDescription"sv) {
|
||||
auto build_id = Core::Version::read_long_version_string().to_byte_string();
|
||||
auto build_id = Core::Version::read_long_version_string();
|
||||
|
||||
static constexpr auto browser_name = StringView { BROWSER_NAME, __builtin_strlen(BROWSER_NAME) };
|
||||
static constexpr auto browser_version = StringView { BROWSER_VERSION, __builtin_strlen(BROWSER_VERSION) };
|
||||
static constexpr auto platform_name = StringView { OS_STRING, __builtin_strlen(OS_STRING) };
|
||||
static constexpr auto arch = StringView { CPU_STRING, __builtin_strlen(CPU_STRING) };
|
||||
static auto browser_name = String::from_utf8_without_validation({ BROWSER_NAME, __builtin_strlen(BROWSER_NAME) });
|
||||
static auto browser_version = String::from_utf8_without_validation({ BROWSER_VERSION, __builtin_strlen(BROWSER_VERSION) });
|
||||
static auto platform_name = String::from_utf8_without_validation({ OS_STRING, __builtin_strlen(OS_STRING) });
|
||||
static auto arch = String::from_utf8_without_validation({ CPU_STRING, __builtin_strlen(CPU_STRING) });
|
||||
|
||||
// https://github.com/mozilla/gecko-dev/blob/master/devtools/shared/system.js
|
||||
JsonObject value;
|
||||
value.set("apptype"sv, browser_name.to_lowercase_string());
|
||||
value.set("apptype"sv, browser_name.to_ascii_lowercase());
|
||||
value.set("name"sv, browser_name);
|
||||
value.set("brandName"sv, browser_name);
|
||||
value.set("version"sv, browser_version);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue