diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-10-26 13:57:00 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-11-02 11:31:01 +0000 |
commit | 1943b3c2a1dcee36c233724fc4ee7613d71b9cf6 (patch) | |
tree | 8c1b5f12357025c197da5427ae02cfdc2f3570d6 /chromium/third_party/blink/renderer/core/frame/navigator_ua_data.cc | |
parent | 21ba0c5d4bf8fba15dddd97cd693bad2358b77fd (diff) | |
download | qtwebengine-chromium-1943b3c2a1dcee36c233724fc4ee7613d71b9cf6.tar.gz |
BASELINE: Update Chromium to 94.0.4606.111
Change-Id: I924781584def20fc800bedf6ff41fdb96c438193
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/third_party/blink/renderer/core/frame/navigator_ua_data.cc')
-rw-r--r-- | chromium/third_party/blink/renderer/core/frame/navigator_ua_data.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/chromium/third_party/blink/renderer/core/frame/navigator_ua_data.cc b/chromium/third_party/blink/renderer/core/frame/navigator_ua_data.cc index a696f0c804a..aad450b37ff 100644 --- a/chromium/third_party/blink/renderer/core/frame/navigator_ua_data.cc +++ b/chromium/third_party/blink/renderer/core/frame/navigator_ua_data.cc @@ -84,6 +84,10 @@ void NavigatorUAData::SetUAFullVersion(const String& ua_full_version) { ua_full_version_ = ua_full_version; } +void NavigatorUAData::SetBitness(const String& bitness) { + bitness_ = bitness; +} + bool NavigatorUAData::mobile() const { if (GetExecutionContext()) { return is_mobile_; @@ -99,6 +103,13 @@ const HeapVector<Member<NavigatorUABrandVersion>>& NavigatorUAData::brands() return empty_brand_set_; } +const String& NavigatorUAData::platform() const { + if (GetExecutionContext()) { + return platform_; + } + return WTF::g_empty_string; +} + ScriptPromise NavigatorUAData::getHighEntropyValues( ScriptState* script_state, Vector<String>& hints) const { @@ -113,6 +124,8 @@ ScriptPromise NavigatorUAData::getHighEntropyValues( IdentifiableSurface::Type::kNavigatorUAData_GetHighEntropyValues); UADataValues* values = MakeGarbageCollected<UADataValues>(); for (const String& hint : hints) { + values->setBrands(brand_set_); + values->setMobile(is_mobile_); if (hint == "platform") { values->setPlatform(platform_); MaybeRecordMetric(record_identifiability, hint, platform_, @@ -133,6 +146,10 @@ ScriptPromise NavigatorUAData::getHighEntropyValues( values->setUaFullVersion(ua_full_version_); MaybeRecordMetric(record_identifiability, hint, ua_full_version_, execution_context); + } else if (hint == "bitness") { + values->setBitness(bitness_); + MaybeRecordMetric(record_identifiability, hint, bitness_, + execution_context); } } @@ -146,6 +163,13 @@ ScriptPromise NavigatorUAData::getHighEntropyValues( return promise; } +ScriptValue NavigatorUAData::toJSON(ScriptState* script_state) const { + V8ObjectBuilder builder(script_state); + builder.Add("brands", brands()); + builder.Add("mobile", mobile()); + return builder.GetScriptValue(); +} + void NavigatorUAData::Trace(Visitor* visitor) const { visitor->Trace(brand_set_); visitor->Trace(empty_brand_set_); |