diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2023-02-16 17:57:29 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2023-07-06 11:40:10 +0200 |
commit | d488349ee0ecac8a2e5a87a18d249c7b5de39152 (patch) | |
tree | 95620d441c5be608127f976428f440636472d166 /src/core/renderer | |
parent | 09ab9ab74efcd0da0a310c992629bc650a5a80ec (diff) |
Adaptations for Chromium 110
Pick-to: 6.6
Change-Id: I56e1695ee4fc2b0e12da6580a5673df80bba8b6d
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Diffstat (limited to 'src/core/renderer')
-rw-r--r-- | src/core/renderer/content_renderer_client_qt.cpp | 15 | ||||
-rw-r--r-- | src/core/renderer/web_channel_ipc_transport.cpp | 17 |
2 files changed, 15 insertions, 17 deletions
diff --git a/src/core/renderer/content_renderer_client_qt.cpp b/src/core/renderer/content_renderer_client_qt.cpp index 80bbabf63..5ec4a1935 100644 --- a/src/core/renderer/content_renderer_client_qt.cpp +++ b/src/core/renderer/content_renderer_client_qt.cpp @@ -290,11 +290,12 @@ void ContentRendererClientQt::GetNavigationErrorStringsInternal(content::RenderF // TODO(elproxy): We could potentially get better diagnostics here by first calling // NetErrorHelper::GetErrorStringsForDnsProbe, but that one is harder to untangle. + base::Value::Dict error_page_params; error_page::LocalizedError::PageState errorPageState = error_page::LocalizedError::GetPageState( error.reason(), error.domain(), error.url(), isPost, false, error.stale_copy_in_cache(), false, - RenderConfiguration::is_incognito_process(), false, false, false, locale, false); + RenderConfiguration::is_incognito_process(), false, false, false, locale, false, &error_page_params); resourceId = IDR_NET_ERROR_HTML; @@ -477,7 +478,7 @@ static const char kExternalClearKeyKeySystem[] = "org.chromium.externalclearkey" // External Clear Key (used for testing). static void AddExternalClearKey(const media::mojom::KeySystemCapabilityPtr &capability, - media::KeySystemInfoVector *key_systems) + media::KeySystemInfos* key_systems) { Q_UNUSED(capability); if (!base::FeatureList::IsEnabled(media::kExternalClearKeyForTesting)) { @@ -486,7 +487,7 @@ static void AddExternalClearKey(const media::mojom::KeySystemCapabilityPtr &capa } // TODO(xhwang): Actually use `capability` to determine capabilities. - key_systems->push_back(std::make_unique<cdm::ExternalClearKeyProperties>()); + key_systems->push_back(std::make_unique<cdm::ExternalClearKeyKeySystemInfo>()); } #if BUILDFLAG(ENABLE_WIDEVINE) @@ -603,7 +604,7 @@ static media::SupportedCodecs GetSupportedCodecs(const media::CdmCapability& cap } static void AddWidevine(const media::mojom::KeySystemCapabilityPtr &capability, - media::KeySystemInfoVector *key_systems) + media::KeySystemInfos *key_systems) { // Codecs and encryption schemes. media::SupportedCodecs codecs = media::EME_CODEC_NONE; @@ -658,11 +659,11 @@ static void AddWidevine(const media::mojom::KeySystemCapabilityPtr &capability, void OnKeySystemSupportUpdated(media::GetSupportedKeySystemsCB cb, content::KeySystemCapabilityPtrMap key_system_capabilities) { - media::KeySystemInfoVector key_systems; + media::KeySystemInfos key_systems; for (const auto &entry : key_system_capabilities) { +#if BUILDFLAG(ENABLE_LIBRARY_CDMS) const auto &key_system = entry.first; const auto &capability = entry.second; -#if BUILDFLAG(ENABLE_LIBRARY_CDMS) #if BUILDFLAG(ENABLE_WIDEVINE) if (key_system == kWidevineKeySystem) { AddWidevine(capability, &key_systems); @@ -674,9 +675,9 @@ void OnKeySystemSupportUpdated(media::GetSupportedKeySystemsCB cb, AddExternalClearKey(capability, &key_systems); continue; } -#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS) DLOG(ERROR) << "Unrecognized key system: " << key_system; +#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS) } cb.Run(std::move(key_systems)); diff --git a/src/core/renderer/web_channel_ipc_transport.cpp b/src/core/renderer/web_channel_ipc_transport.cpp index 04a4ce705..89b20c7d1 100644 --- a/src/core/renderer/web_channel_ipc_transport.cpp +++ b/src/core/renderer/web_channel_ipc_transport.cpp @@ -43,8 +43,6 @@ void WebChannelTransport::Install(blink::WebLocalFrame *frame, uint worldId) { v8::Isolate *isolate = blink::MainThreadIsolate(); v8::HandleScope handleScope(isolate); - v8::MicrotasksScope microtasks_scope( - isolate, v8::MicrotasksScope::kDoNotRunMicrotasks); v8::Local<v8::Context> context; if (worldId == 0) context = frame->MainWorldScriptContext(); @@ -59,15 +57,14 @@ void WebChannelTransport::Install(blink::WebLocalFrame *frame, uint worldId) return; v8::Local<v8::Object> global = context->Global(); - v8::Local<v8::Value> qtObjectValue; v8::Local<v8::Object> qtObject; - if (!global->Get(context, gin::StringToV8(isolate, "qt")).ToLocal(&qtObjectValue) || !qtObjectValue->IsObject()) { - qtObject = v8::Object::New(isolate); - global->Set(context, gin::StringToV8(isolate, "qt"), qtObject).Check(); - } else { - qtObject = v8::Local<v8::Object>::Cast(qtObjectValue); - } - qtObject->Set(context, gin::StringToV8(isolate, "webChannelTransport"), transport.ToV8()).Check(); + qtObject = v8::Object::New(isolate); + global->CreateDataProperty(context, + gin::StringToSymbol(isolate, "qt"), + qtObject).Check(); + qtObject->CreateDataProperty(context, + gin::StringToSymbol(isolate, "webChannelTransport"), + transport.ToV8()).Check(); } void WebChannelTransport::Uninstall(blink::WebLocalFrame *frame, uint worldId) |