diff options
59 files changed, 440 insertions, 363 deletions
diff --git a/src/3rdparty b/src/3rdparty -Subproject 12a57d9c943eaa80d87481712fe58f7bf6678ba +Subproject 563ed58251011ce1af0fa1e3742fc8f476755f2 diff --git a/src/buildtools/config/common.pri b/src/buildtools/config/common.pri index ae15aaa71..f2b4a854e 100644 --- a/src/buildtools/config/common.pri +++ b/src/buildtools/config/common.pri @@ -9,6 +9,7 @@ gn_args += \ is_component_build=false \ is_shared=true \ enable_debugallocation=false \ + enable_media_remoting=false \ enable_message_center=false \ enable_nacl=false \ enable_remoting=false \ @@ -127,12 +128,6 @@ optimize_size: gn_args += optimize_for_size=true sanitize_undefined: gn_args += is_ubsan=true is_ubsan_vptr=true } -qtConfig(build-qtwebengine-core):qtConfig(webengine-v8-snapshot):qtConfig(webengine-v8-snapshot-support) { - gn_args += v8_use_snapshot=true -} else { - gn_args += v8_use_snapshot=false -} - qtConfig(build-qtwebengine-core):qtConfig(webengine-kerberos) { gn_args += use_kerberos=true } else { diff --git a/src/core/api/core_api.pro b/src/core/api/core_api.pro index 5e8b8387e..6b4291cb7 100644 --- a/src/core/api/core_api.pro +++ b/src/core/api/core_api.pro @@ -67,11 +67,13 @@ SOURCES = \ ### Qt6 Remove this workaround unix:!isEmpty(QMAKE_LFLAGS_VERSION_SCRIPT):!static { - CONFIG -= warning_clean SOURCES += qtbug-60565.cpp \ qtbug-61521.cpp } +# Chromium headers included are not remotely clean +CONFIG -= warning_clean + msvc { # Create a list of object files that can be used as response file for the linker. # This is done to simulate -whole-archive on MSVC. diff --git a/src/core/browser_accessibility_qt.cpp b/src/core/browser_accessibility_qt.cpp index 816a46041..7e541d549 100644 --- a/src/core/browser_accessibility_qt.cpp +++ b/src/core/browser_accessibility_qt.cpp @@ -225,8 +225,12 @@ QAccessible::Role BrowserAccessibilityQt::role() const return QAccessible::AlertMessage; case ax::mojom::Role::kAnchor: return QAccessible::Link; - case ax::mojom::Role::kAnnotation: - return QAccessible::StaticText; + case ax::mojom::Role::kAnnotationAttribution: + case ax::mojom::Role::kAnnotationCommentary: + case ax::mojom::Role::kAnnotationPresence: + case ax::mojom::Role::kAnnotationRevision: + case ax::mojom::Role::kAnnotationSuggestion: + return QAccessible::Grouping; case ax::mojom::Role::kApplication: return QAccessible::Document; // returning Application here makes Qt return the top level app object case ax::mojom::Role::kArticle: @@ -346,6 +350,7 @@ QAccessible::Role BrowserAccessibilityQt::role() const case ax::mojom::Role::kFigure: return QAccessible::Section; case ax::mojom::Role::kFooter: + case ax::mojom::Role::kFooterAsNonLandmark: return QAccessible::Footer; case ax::mojom::Role::kForm: return QAccessible::Form; @@ -359,6 +364,9 @@ QAccessible::Role BrowserAccessibilityQt::role() const return QAccessible::Table; case ax::mojom::Role::kGroup: return QAccessible::Grouping; + case ax::mojom::Role::kHeader: + return QAccessible::Section; + case ax::mojom::Role::kHeaderAsNonLandmark: case ax::mojom::Role::kHeading: return QAccessible::Heading; case ax::mojom::Role::kIframe: @@ -458,6 +466,7 @@ QAccessible::Role BrowserAccessibilityQt::role() const case ax::mojom::Role::kRowHeader: return QAccessible::RowHeader; case ax::mojom::Role::kRuby: + case ax::mojom::Role::kRubyAnnotation: return QAccessible::StaticText; case ax::mojom::Role::kScrollBar: return QAccessible::ScrollBar; @@ -467,6 +476,8 @@ QAccessible::Role BrowserAccessibilityQt::role() const return QAccessible::Section; case ax::mojom::Role::kSearchBox: return QAccessible::EditableText; + case ax::mojom::Role::kSection: + return QAccessible::Section; case ax::mojom::Role::kSlider: return QAccessible::Slider; case ax::mojom::Role::kSliderThumb: diff --git a/src/core/chromium_overrides.cpp b/src/core/chromium_overrides.cpp index 9d3e3f08a..01937d3e7 100644 --- a/src/core/chromium_overrides.cpp +++ b/src/core/chromium_overrides.cpp @@ -170,26 +170,26 @@ bool GrabViewSnapshot(gfx::NativeView view, void GrabWindowSnapshotAndScaleAsync(gfx::NativeWindow window, const gfx::Rect& source_rect, const gfx::Size& target_size, - const GrabWindowSnapshotAsyncCallback& callback) + GrabWindowSnapshotAsyncCallback callback) { NOTIMPLEMENTED(); - callback.Run(gfx::Image()); + std::move(callback).Run(gfx::Image()); } void GrabWindowSnapshotAsync(gfx::NativeWindow window, const gfx::Rect& source_rect, - const GrabWindowSnapshotAsyncCallback& callback) + GrabWindowSnapshotAsyncCallback callback) { NOTIMPLEMENTED(); - callback.Run(gfx::Image()); + std::move(callback).Run(gfx::Image()); } void GrabViewSnapshotAsync(gfx::NativeView view, const gfx::Rect& source_rect, - const GrabWindowSnapshotAsyncCallback& callback) + GrabWindowSnapshotAsyncCallback callback) { NOTIMPLEMENTED(); - callback.Run(gfx::Image()); + std::move(callback).Run(gfx::Image()); } } // namespace ui diff --git a/src/core/clipboard_qt.cpp b/src/core/clipboard_qt.cpp index 44dd84f37..ef7a05299 100644 --- a/src/core/clipboard_qt.cpp +++ b/src/core/clipboard_qt.cpp @@ -105,13 +105,13 @@ Clipboard *Clipboard::Create() namespace QtWebEngineCore { -void ClipboardQt::WriteObjects(ui::ClipboardBuffer type, const ObjectMap &objects) +void ClipboardQt::WritePortableRepresentations(ui::ClipboardBuffer type, const ObjectMap &objects) { DCHECK(CalledOnValidThread()); DCHECK(IsSupportedClipboardBuffer(type)); - for (ObjectMap::const_iterator iter = objects.begin(); iter != objects.end(); ++iter) - DispatchObject(static_cast<ObjectType>(iter->first), iter->second); + for (const auto &object : objects) + DispatchPortableRepresentation(object.first, object.second); // Commit the accumulated data. if (uncommittedData) @@ -120,15 +120,22 @@ void ClipboardQt::WriteObjects(ui::ClipboardBuffer type, const ObjectMap &object : QClipboard::Selection); if (type == ui::ClipboardBuffer::kCopyPaste && IsSupportedClipboardBuffer(ui::ClipboardBuffer::kSelection)) { - ObjectMap::const_iterator text_iter = objects.find(ObjectType::kText); + ObjectMap::const_iterator text_iter = objects.find(PortableFormat::kText); if (text_iter != objects.end()) { // Copy text and SourceTag to the selection clipboard. - ObjectMap::const_iterator next_iter = text_iter; - WriteObjects(ui::ClipboardBuffer::kSelection, ObjectMap(text_iter, ++next_iter, base::KEEP_FIRST_OF_DUPES)); + WritePortableRepresentations(ui::ClipboardBuffer::kSelection, + ObjectMap(text_iter, text_iter + 1)); } } } +void ClipboardQt::WritePlatformRepresentations(ui::ClipboardBuffer buffer, std::vector<ui::Clipboard::PlatformRepresentation> platform_representations) +{ + DCHECK(CalledOnValidThread()); + DCHECK(IsSupportedClipboardBuffer(buffer)); + DispatchPlatformRepresentations(std::move(platform_representations)); +} + void ClipboardQt::WriteText(const char *text_data, size_t text_len) { getUncommittedData()->setText(QString::fromUtf8(text_data, text_len)); diff --git a/src/core/clipboard_qt.h b/src/core/clipboard_qt.h index 9dde1f977..6d86e8f6c 100644 --- a/src/core/clipboard_qt.h +++ b/src/core/clipboard_qt.h @@ -64,7 +64,9 @@ public: void OnPreShutdown() override {} protected: - void WriteObjects(ui::ClipboardBuffer type, const ObjectMap &objects) override; + void WritePortableRepresentations(ui::ClipboardBuffer type, const ObjectMap &objects) override; + void WritePlatformRepresentations(ui::ClipboardBuffer type, + std::vector<ui::Clipboard::PlatformRepresentation> platform_representations) override; void WriteText(const char *text_data, size_t text_len) override; void WriteHTML(const char *markup_data, size_t markup_len, const char *url_data, size_t url_len) override; void WriteRTF(const char *rtf_data, size_t data_len) override; diff --git a/src/core/compositor/compositor.cpp b/src/core/compositor/compositor.cpp index 801a25b80..82a9f7ee4 100644 --- a/src/core/compositor/compositor.cpp +++ b/src/core/compositor/compositor.cpp @@ -127,8 +127,7 @@ QSGNode *Compositor::updatePaintNode(QSGNode *oldNode, RenderWidgetHostViewQtDel } m_updatePaintNodeShouldCommit = false; - gfx::PresentationFeedback dummyFeedback(base::TimeTicks::Now(), base::TimeDelta(), gfx::PresentationFeedback::Flags::kVSync); - m_presentations.emplace(m_committedFrame.metadata.frame_token, viz::FrameTimingDetails{dummyFeedback}); + m_presentations.emplace(m_committedFrame.metadata.frame_token, viz::FrameTimingDetails{base::TimeTicks::Now()}); m_resourceTracker->commitResources(); frameNode->commit(m_pendingFrame, m_committedFrame, m_resourceTracker.get(), viewDelegate); @@ -160,8 +159,7 @@ void Compositor::notifyFrameCommitted() void Compositor::sendPresentationFeedback(uint frame_token) { - gfx::PresentationFeedback dummyFeedback(base::TimeTicks::Now(), base::TimeDelta(), gfx::PresentationFeedback::Flags::kVSync); - viz::FrameTimingDetails dummyDetails = {dummyFeedback}; + viz::FrameTimingDetails dummyDetails = {base::TimeTicks::Now()}; m_presentations.emplace(frame_token, dummyDetails); } diff --git a/src/core/configure.json b/src/core/configure.json index 9f05409ba..55e68ab04 100644 --- a/src/core/configure.json +++ b/src/core/configure.json @@ -26,7 +26,6 @@ "webengine-extensions": "boolean", "webengine-webrtc": "boolean", "webengine-geolocation": "boolean", - "webengine-v8-snapshot": "boolean", "webengine-webchannel": "boolean", "webengine-kerberos": "boolean", "alsa": { "type": "boolean", "name": "webengine-alsa" }, @@ -113,14 +112,8 @@ "condition": "config.unix && libs.webengine-alsa", "output": [ "privateFeature" ] }, - "webengine-v8-snapshot": { - "label" : "Use v8 snapshot", - "purpose": "Enables the v8 snapshot, for fast v8 context creation", - "output": [ "privateFeature" ] - }, "webengine-v8-snapshot-support": { "label" : "Building v8 snapshot supported", - "autoDetect": "features.webengine-v8-snapshot", "condition": "!config.unix || !features.cross_compile || arch.arm64 || tests.webengine-host-compiler", "output": [ "privateFeature" ] }, @@ -257,7 +250,7 @@ }, { "type": "warning", - "condition": "config.linux && features.webengine-v8-snapshot && !features.webengine-v8-snapshot-support", + "condition": "config.unix && config.cross_compile && !features.webengine-v8-snapshot-support", "message": "V8 snapshot cannot be built. Most likely, the 32-bit host compiler does not work. Please make sure you have 32-bit devel environment installed." } ], @@ -277,7 +270,6 @@ "webengine-webrtc", "webengine-geolocation", "webengine-webchannel", - "webengine-v8-snapshot", "webengine-kerberos", "webengine-extensions", { @@ -288,7 +280,7 @@ { "type": "feature", "args": "webengine-v8-snapshot-support", - "condition": "config.unix && config.cross_compile && features.webengine-v8-snapshot" + "condition": "config.unix && config.cross_compile" }, { "type": "feature", diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp index e6822fd8f..a8d9e6ddc 100644 --- a/src/core/content_browser_client_qt.cpp +++ b/src/core/content_browser_client_qt.cpp @@ -89,8 +89,6 @@ #include "printing/buildflags/buildflags.h" #include "qtwebengine/browser/qtwebengine_content_browser_overlay_manifest.h" #include "qtwebengine/browser/qtwebengine_content_renderer_overlay_manifest.h" -#include "qtwebengine/browser/qtwebengine_packaged_service_manifest.h" -#include "qtwebengine/browser/qtwebengine_renderer_manifest.h" #include "net/ssl/client_cert_identity.h" #include "net/ssl/client_cert_store.h" #include "services/network/network_service.h" @@ -98,6 +96,7 @@ #include "services/service_manager/public/cpp/connector.h" #include "services/service_manager/public/cpp/service.h" #include "services/service_manager/sandbox/switches.h" +#include "storage/browser/quota/quota_settings.h" #include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h" #include "third_party/blink/public/common/loader/url_loader_throttle.h" #include "third_party/blink/public/mojom/insecure_input/insecure_input_service.mojom.h" @@ -142,6 +141,7 @@ #include "web_engine_library_info.h" #include "api/qwebenginecookiestore.h" #include "api/qwebenginecookiestore_p.h" +#include "api/qwebengineurlscheme.h" #if defined(Q_OS_LINUX) #include "global_descriptors_qt.h" @@ -360,9 +360,10 @@ scoped_refptr<content::QuotaPermissionContext> ContentBrowserClientQt::CreateQuo void ContentBrowserClientQt::GetQuotaSettings(content::BrowserContext* context, content::StoragePartition* partition, - storage::OptionalQuotaSettingsCallback callback) + base::OnceCallback<void(base::Optional<storage::QuotaSettings>)> callback) { - storage::GetNominalDynamicSettings(partition->GetPath(), context->IsOffTheRecord(), storage::GetDefaultDiskInfoHelper(), std::move(callback)); + storage::GetNominalDynamicSettings(partition->GetPath(), context->IsOffTheRecord(), + storage::GetDefaultDiskInfoHelper(), std::move(callback)); } // Copied from chrome/browser/ssl/ssl_error_handler.cc: @@ -685,7 +686,9 @@ bool ContentBrowserClientQt::ShouldEnableStrictSiteIsolation() bool ContentBrowserClientQt::WillCreateRestrictedCookieManager( network::mojom::RestrictedCookieManagerRole role, content::BrowserContext *browser_context, - const url::Origin &origin, + const url::Origin & /*origin*/, + const GURL & /*site_for_cookies*/, + const url::Origin & /*top_frame_origin*/, bool is_service_worker, int process_id, int routing_id, @@ -714,7 +717,8 @@ bool ContentBrowserClientQt::AllowAppCache(const GURL &manifest_url, } bool ContentBrowserClientQt::AllowServiceWorkerOnIO(const GURL &scope, - const GURL &first_party, + const GURL &site_for_cookies, + const base::Optional<url::Origin> & /*top_frame_origin*/, const GURL & /*script_url*/, content::ResourceContext *context, base::RepeatingCallback<content::WebContents*()> wc_getter) @@ -722,11 +726,12 @@ bool ContentBrowserClientQt::AllowServiceWorkerOnIO(const GURL &scope, DCHECK_CURRENTLY_ON(content::BrowserThread::IO); // FIXME: Chrome also checks if javascript is enabled here to check if has been disabled since the service worker // was started. - return ProfileIODataQt::FromResourceContext(context)->canGetCookies(toQt(first_party), toQt(scope)); + return ProfileIODataQt::FromResourceContext(context)->canGetCookies(toQt(site_for_cookies), toQt(scope)); } bool ContentBrowserClientQt::AllowServiceWorkerOnUI(const GURL &scope, - const GURL &first_party, + const GURL &site_for_cookies, + const base::Optional<url::Origin> & /*top_frame_origin*/, const GURL & /*script_url*/, content::BrowserContext *context, base::RepeatingCallback<content::WebContents*()> wc_getter) @@ -734,7 +739,7 @@ bool ContentBrowserClientQt::AllowServiceWorkerOnUI(const GURL &scope, DCHECK_CURRENTLY_ON(content::BrowserThread::UI); // FIXME: Chrome also checks if javascript is enabled here to check if has been disabled since the service worker // was started. - return static_cast<ProfileQt *>(context)->profileAdapter()->cookieStore()->d_func()->canAccessCookies(toQt(first_party), toQt(scope)); + return static_cast<ProfileQt *>(context)->profileAdapter()->cookieStore()->d_func()->canAccessCookies(toQt(site_for_cookies), toQt(scope)); } // We control worker access to FS and indexed-db using cookie permissions, this is mirroring Chromium's logic. @@ -786,6 +791,7 @@ bool ContentBrowserClientQt::HandleExternalProtocol( bool is_main_frame, ui::PageTransition page_transition, bool has_user_gesture, + const base::Optional<url::Origin> &initiating_origin, network::mojom::URLLoaderFactoryPtr *out_factory) { // Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); @@ -1041,17 +1047,16 @@ void ContentBrowserClientQt::OnNetworkServiceCreated(network::mojom::NetworkServ SystemNetworkContextManager::GetInstance()->OnNetworkServiceCreated(network_service); } -network::mojom::NetworkContextPtr ContentBrowserClientQt::CreateNetworkContext(content::BrowserContext *context, - bool in_memory, - const base::FilePath &relative_partition_path) +mojo::Remote<network::mojom::NetworkContext> ContentBrowserClientQt::CreateNetworkContext( + content::BrowserContext *context, + bool in_memory, + const base::FilePath &relative_partition_path) { - if (!base::FeatureList::IsEnabled(network::features::kNetworkService)) - return nullptr; - - network::mojom::NetworkContextPtr network_context; + mojo::Remote<network::mojom::NetworkContext> network_context; // ### do we need to pass in_memory and relative_partition_path to ProfileIODataQt::CreateNetworkContextParams() ? network::mojom::NetworkContextParamsPtr context_params = ProfileIODataQt::FromBrowserContext(context)->CreateNetworkContextParams(); - content::GetNetworkService()->CreateNetworkContext(mojo::MakeRequest(&network_context), std::move(context_params)); + content::GetNetworkService()->CreateNetworkContext( + network_context.BindNewPipeAndPassReceiver(), std::move(context_params)); network::mojom::CookieManagerPtrInfo cookie_manager_info; network_context->GetCookieManager(mojo::MakeRequest(&cookie_manager_info)); @@ -1086,6 +1091,17 @@ void ContentBrowserClientQt::RegisterNonNetworkNavigationURLLoaderFactories(int #endif } +void ContentBrowserClientQt::RegisterNonNetworkWorkerMainResourceURLLoaderFactories(content::BrowserContext *browser_context, + NonNetworkURLLoaderFactoryMap *factories) +{ + DCHECK(base::FeatureList::IsEnabled(network::features::kNetworkService)); + Profile *profile = Profile::FromBrowserContext(browser_context); + ProfileAdapter *profileAdapter = static_cast<ProfileQt *>(profile)->profileAdapter(); + + for (const QByteArray &scheme : profileAdapter->customUrlSchemes()) + factories->emplace(scheme.toStdString(), CreateCustomURLLoaderFactory(profileAdapter)); +} + void ContentBrowserClientQt::RegisterNonNetworkSubresourceURLLoaderFactories(int render_process_id, int render_frame_id, NonNetworkURLLoaderFactoryMap *factories) { @@ -1111,7 +1127,7 @@ void ContentBrowserClientQt::RegisterNonNetworkSubresourceURLLoaderFactories(int #if BUILDFLAG(ENABLE_EXTENSIONS) install_file_scheme = install_file_scheme || url.SchemeIs(extensions::kExtensionScheme); #endif - if (!install_file_scheme && web_contents && !url.SchemeIsFile()) { + if (!install_file_scheme && web_contents) { const auto *settings = static_cast<WebContentsDelegateQt *>(web_contents->GetDelegate())->webEngineSettings(); if (settings->testAttribute(WebEngineSettings::LocalContentCanAccessFileUrls)) { for (const auto &local_scheme : url::GetLocalSchemes()) { @@ -1123,7 +1139,7 @@ void ContentBrowserClientQt::RegisterNonNetworkSubresourceURLLoaderFactories(int } } - if (install_file_scheme) { + if (install_file_scheme && factories->find(url::kFileScheme) == factories->end()) { auto file_factory = content::CreateFileURLLoaderFactory(profile->GetPath(), profile->GetSharedCorsOriginAccessList()); factories->emplace(url::kFileScheme, std::move(file_factory)); @@ -1184,6 +1200,7 @@ bool ContentBrowserClientQt::WillCreateURLLoaderFactory( base::PostTask(FROM_HERE, { content::BrowserThread::IO }, base::BindOnce(&ProxyingURLLoaderFactoryQt::CreateProxy, process_id, browser_context->GetResourceContext(), + static_cast<content::RenderFrameHostImpl*>(frame), std::move(proxied_receiver), std::move(target_factory_info))); return true; diff --git a/src/core/content_browser_client_qt.h b/src/core/content_browser_client_qt.h index 18478186d..d828d44b6 100644 --- a/src/core/content_browser_client_qt.h +++ b/src/core/content_browser_client_qt.h @@ -89,8 +89,8 @@ public: content::MediaObserver* GetMediaObserver() override; scoped_refptr<content::QuotaPermissionContext> CreateQuotaPermissionContext() override; void GetQuotaSettings(content::BrowserContext *context, - content::StoragePartition *partition, - storage::OptionalQuotaSettingsCallback callback) override; + content::StoragePartition *partition, + base::OnceCallback<void(base::Optional<storage::QuotaSettings>)> callback) override; void OverrideWebkitPrefs(content::RenderViewHost *, content::WebPreferences *) override; void AllowCertificateError(content::WebContents *web_contents, int cert_error, @@ -144,6 +144,8 @@ public: network::mojom::RestrictedCookieManagerRole role, content::BrowserContext *browser_context, const url::Origin &origin, + const GURL &site_for_cookies, + const url::Origin &top_frame_origin, bool is_service_worker, int process_id, int routing_id, @@ -154,13 +156,15 @@ public: content::BrowserContext *context) override; bool AllowServiceWorkerOnIO(const GURL &scope, - const GURL &first_party, + const GURL &site_for_cookies, + const base::Optional<url::Origin> &top_frame_origin, const GURL &script_url, content::ResourceContext *context, base::RepeatingCallback<content::WebContents*()> wc_getter) override; bool AllowServiceWorkerOnUI(const GURL &scope, - const GURL &first_party, + const GURL &site_for_cookies, + const base::Optional<url::Origin> &top_frame_origin, const GURL &script_url, content::BrowserContext *context, base::RepeatingCallback<content::WebContents*()> wc_getter) override; @@ -204,12 +208,13 @@ public: bool HandleExternalProtocol( const GURL &url, - content::WebContents::Getter web_contents_getter, + base::Callback<content::WebContents*(void)> web_contents_getter, int child_id, content::NavigationUIData *navigation_data, bool is_main_frame, ui::PageTransition page_transition, bool has_user_gesture, + const base::Optional<url::Origin> &initiating_origin, network::mojom::URLLoaderFactoryPtr *out_factory) override; std::vector<std::unique_ptr<blink::URLLoaderThrottle>> CreateURLLoaderThrottles( @@ -233,13 +238,15 @@ public: scoped_refptr<network::SharedURLLoaderFactory> GetSystemSharedURLLoaderFactory() override; network::mojom::NetworkContext *GetSystemNetworkContext() override; void OnNetworkServiceCreated(network::mojom::NetworkService *network_service) override; - network::mojom::NetworkContextPtr CreateNetworkContext(content::BrowserContext *context, - bool in_memory, - const base::FilePath &relative_partition_path) override; + mojo::Remote<network::mojom::NetworkContext> CreateNetworkContext(content::BrowserContext *context, + bool in_memory, + const base::FilePath &relative_partition_path) override; std::vector<base::FilePath> GetNetworkContextsParentDirectory() override; void RegisterNonNetworkNavigationURLLoaderFactories(int frame_tree_node_id, NonNetworkURLLoaderFactoryMap *factories) override; void RegisterNonNetworkSubresourceURLLoaderFactories(int render_process_id, int render_frame_id, NonNetworkURLLoaderFactoryMap* factories) override; + void RegisterNonNetworkWorkerMainResourceURLLoaderFactories(content::BrowserContext* browser_context, + NonNetworkURLLoaderFactoryMap* factories) override; static std::string getUserAgent(); diff --git a/src/core/content_main_delegate_qt.cpp b/src/core/content_main_delegate_qt.cpp index cb23a5287..ff6bf4366 100644 --- a/src/core/content_main_delegate_qt.cpp +++ b/src/core/content_main_delegate_qt.cpp @@ -79,36 +79,52 @@ ContentClient *GetContentClient(); namespace QtWebEngineCore { +namespace { + // The logic of this function is based on chrome/common/net/net_resource_provider.cc // Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE.Chromium file. -static std::string constructDirHeaderHTML() -{ - base::DictionaryValue dict; - dict.SetString("header", l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_HEADER)); - dict.SetString("parentDirText", l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_PARENT)); - dict.SetString("headerName", l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_NAME)); - dict.SetString("headerSize", l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_SIZE)); - dict.SetString("headerDateModified", - l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_DATE_MODIFIED)); - dict.SetString("language", l10n_util::GetLanguage(base::i18n::GetConfiguredLocale())); - dict.SetString("listingParsingErrorBoxText", - l10n_util::GetStringFUTF16(IDS_DIRECTORY_LISTING_PARSING_ERROR_BOX_TEXT, - toString16(QCoreApplication::applicationName()))); - dict.SetString("textdirection", base::i18n::IsRTL() ? "rtl" : "ltr"); - std::string html = webui::GetI18nTemplateHtml( - ui::ResourceBundle::GetSharedInstance().GetRawDataResource(IDR_DIR_HEADER_HTML), - &dict); - return html; -} -static base::StringPiece PlatformResourceProvider(int key) { - if (key == IDR_DIR_HEADER_HTML) { - static std::string html_data = constructDirHeaderHTML(); - return base::StringPiece(html_data); +// The net module doesn't have access to this HTML or the strings that need to +// be localized. The Chrome locale will never change while we're running, so +// it's safe to have a static string that we always return a pointer into. +struct LazyDirectoryListerCacher +{ + LazyDirectoryListerCacher() + { + base::DictionaryValue dict; + dict.SetString("header", l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_HEADER)); + dict.SetString("parentDirText", l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_PARENT)); + dict.SetString("headerName", l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_NAME)); + dict.SetString("headerSize", l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_SIZE)); + dict.SetString("headerDateModified", + l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_DATE_MODIFIED)); + dict.SetString("language", l10n_util::GetLanguage(base::i18n::GetConfiguredLocale())); + dict.SetString("listingParsingErrorBoxText", + l10n_util::GetStringFUTF16(IDS_DIRECTORY_LISTING_PARSING_ERROR_BOX_TEXT, + toString16(QCoreApplication::applicationName()))); + dict.SetString("textdirection", base::i18n::IsRTL() ? "rtl" : "ltr"); + std::string html = + webui::GetI18nTemplateHtml( + ui::ResourceBundle::GetSharedInstance().DecompressDataResource(IDR_DIR_HEADER_HTML), + &dict); + html_data = base::RefCountedString::TakeString(&html); } - return base::StringPiece(); + + scoped_refptr<base::RefCountedMemory> html_data; +}; + +} // namespace + +static scoped_refptr<base::RefCountedMemory> PlatformResourceProvider(int key) +{ + static base::NoDestructor<LazyDirectoryListerCacher> lazy_dir_lister; + + if (IDR_DIR_HEADER_HTML == key) + return lazy_dir_lister->html_data; + + return ui::ResourceBundle::GetSharedInstance().LoadDataResourceBytes(key); } // Logging logic is based on chrome/common/logging_chrome.cc: diff --git a/src/core/devtools_frontend_qt.cpp b/src/core/devtools_frontend_qt.cpp index 1dcbd1e9d..8d325eca6 100644 --- a/src/core/devtools_frontend_qt.cpp +++ b/src/core/devtools_frontend_qt.cpp @@ -130,7 +130,7 @@ public: private: void OnResponseStarted(const GURL &final_url, - const network::ResourceResponseHead &response_head) + const network::mojom::URLResponseHead &response_head) { response_headers_ = response_head.headers; } diff --git a/src/core/download_manager_delegate_qt.cpp b/src/core/download_manager_delegate_qt.cpp index 7049b8273..fe7f7c57b 100644 --- a/src/core/download_manager_delegate_qt.cpp +++ b/src/core/download_manager_delegate_qt.cpp @@ -229,14 +229,12 @@ bool DownloadManagerDelegateQt::DetermineDownloadTarget(download::DownloadItem* } void DownloadManagerDelegateQt::GetSaveDir(content::BrowserContext* browser_context, - base::FilePath* website_save_dir, - base::FilePath* download_save_dir, - bool* skip_dir_check) + base::FilePath* website_save_dir, + base::FilePath* download_save_dir) { static base::FilePath::StringType save_dir = toFilePathString(QStandardPaths::writableLocation(QStandardPaths::DownloadLocation)); *website_save_dir = base::FilePath(save_dir); *download_save_dir = base::FilePath(save_dir); - *skip_dir_check = true; } void DownloadManagerDelegateQt::ChooseSavePath(content::WebContents *web_contents, diff --git a/src/core/download_manager_delegate_qt.h b/src/core/download_manager_delegate_qt.h index 6acfa42ce..4634790cc 100644 --- a/src/core/download_manager_delegate_qt.h +++ b/src/core/download_manager_delegate_qt.h @@ -77,8 +77,7 @@ public: void GetSaveDir(content::BrowserContext* browser_context, base::FilePath* website_save_dir, - base::FilePath* download_save_dir, - bool* skip_dir_check) override; + base::FilePath* download_save_dir) override; void ChooseSavePath(content::WebContents *web_contents, const base::FilePath &suggested_path, const base::FilePath::StringType &default_extension, diff --git a/src/core/media_capture_devices_dispatcher.cpp b/src/core/media_capture_devices_dispatcher.cpp index c7ca495a2..2293c424a 100644 --- a/src/core/media_capture_devices_dispatcher.cpp +++ b/src/core/media_capture_devices_dispatcher.cpp @@ -368,7 +368,7 @@ void MediaCaptureDevicesDispatcher::processDesktopCaptureAccessRequest(content:: // Resolve DesktopMediaID for the specified device id. mediaId = content::DesktopStreamsRegistry::GetInstance()->RequestMediaForStreamId( request.requested_video_device_id, main_frame->GetProcess()->GetID(), - main_frame->GetRoutingID(), request.security_origin, + main_frame->GetRoutingID(), url::Origin::Create(request.security_origin), &originalExtensionName, content::kRegistryStreamTypeDesktop); } diff --git a/src/core/net/cookie_monster_delegate_qt.cpp b/src/core/net/cookie_monster_delegate_qt.cpp index 3e8cced67..cf114406b 100644 --- a/src/core/net/cookie_monster_delegate_qt.cpp +++ b/src/core/net/cookie_monster_delegate_qt.cpp @@ -61,10 +61,9 @@ public: ~CookieChangeListener() override = default; // network::mojom::CookieChangeListener: - void OnCookieChange(const net::CanonicalCookie &canonical_cookie, - network::mojom::CookieChangeCause cause) override + void OnCookieChange(const net::CookieChangeInfo &change) override { - m_delegate->OnCookieChanged(canonical_cookie, net::CookieChangeCause(cause)); + m_delegate->OnCookieChanged(change); } private: @@ -93,9 +92,9 @@ CookieMonsterDelegateQt::~CookieMonsterDelegateQt() void CookieMonsterDelegateQt::AddStore(net::CookieStore *store) { std::unique_ptr<net::CookieChangeSubscription> sub = store->GetChangeDispatcher().AddCallbackForAllChanges( - base::Bind(&CookieMonsterDelegateQt::OnCookieChanged, - // this object's destruction will deregister the subscription. - base::Unretained(this))); + base::BindRepeating(&CookieMonsterDelegateQt::OnCookieChanged, + // this object's destruction will deregister the subscription. + base::Unretained(this))); m_subscriptions.push_back(std::move(sub)); } @@ -217,11 +216,11 @@ bool CookieMonsterDelegateQt::canGetCookies(const QUrl &firstPartyUrl, const QUr return m_client->d_func()->canAccessCookies(firstPartyUrl, url); } -void CookieMonsterDelegateQt::OnCookieChanged(const net::CanonicalCookie &cookie, net::CookieChangeCause cause) +void CookieMonsterDelegateQt::OnCookieChanged(const net::CookieChangeInfo &change) { if (!m_client) return; - m_client->d_func()->onCookieChanged(toQt(cookie), cause != net::CookieChangeCause::INSERTED); + m_client->d_func()->onCookieChanged(toQt(change.cookie), change.cause != net::CookieChangeCause::INSERTED); } void CookieMonsterDelegateQt::GetAllCookiesCallbackOnUIThread(qint64 callbackId, const std::vector<net::CanonicalCookie> &cookies) diff --git a/src/core/net/cookie_monster_delegate_qt.h b/src/core/net/cookie_monster_delegate_qt.h index 8b04fe26f..6caaeea94 100644 --- a/src/core/net/cookie_monster_delegate_qt.h +++ b/src/core/net/cookie_monster_delegate_qt.h @@ -112,7 +112,7 @@ public: bool canGetCookies(const QUrl &firstPartyUrl, const QUrl &url) const; void AddStore(net::CookieStore *store); - void OnCookieChanged(const net::CanonicalCookie &cookie, net::CookieChangeCause cause); + void OnCookieChanged(const net::CookieChangeInfo &change); private: void GetAllCookiesCallbackOnUIThread(qint64 callbackId, const std::vector<net::CanonicalCookie> &cookies); diff --git a/src/core/net/custom_url_loader_factory.cpp b/src/core/net/custom_url_loader_factory.cpp index 261630cc4..e0ae22bb1 100644 --- a/src/core/net/custom_url_loader_factory.cpp +++ b/src/core/net/custom_url_loader_factory.cpp @@ -43,7 +43,9 @@ #include "base/task/post_task.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" -#include "mojo/public/cpp/bindings/binding_set.h" +#include "mojo/public/cpp/bindings/binding.h" +#include "mojo/public/cpp/bindings/pending_receiver.h" +#include "mojo/public/cpp/bindings/receiver_set.h" #include "mojo/public/cpp/system/data_pipe.h" #include "mojo/public/cpp/system/simple_watcher.h" #include "net/base/net_errors.h" @@ -255,7 +257,7 @@ private: : net::URLRequest::NEVER_CHANGE_FIRST_PARTY_URL; net::RedirectInfo redirectInfo = net::RedirectInfo::ComputeRedirectInfo( m_request.method, m_request.url, - m_request.site_for_cookies, m_request.top_frame_origin, + m_request.site_for_cookies, first_party_url_policy, m_request.referrer_policy, m_request.referrer.spec(), net::HTTP_SEE_OTHER, m_redirect, base::nullopt, false /*insecure_scheme_was_upgraded*/); @@ -425,13 +427,13 @@ public: } - void Clone(network::mojom::URLLoaderFactoryRequest request) override + void Clone(mojo::PendingReceiver<network::mojom::URLLoaderFactory> receiver) override { - m_bindings.AddBinding(this, std::move(request)); + m_receivers.Add(this, std::move(receiver)); } const scoped_refptr<base::SequencedTaskRunner> m_taskRunner; - mojo::BindingSet<network::mojom::URLLoaderFactory> m_bindings; + mojo::ReceiverSet<network::mojom::URLLoaderFactory> m_receivers; QPointer<ProfileAdapter> m_profileAdapter; DISALLOW_COPY_AND_ASSIGN(CustomURLLoaderFactory); }; diff --git a/src/core/net/proxy_config_monitor.cpp b/src/core/net/proxy_config_monitor.cpp index ed1802645..a0aaf0c05 100644 --- a/src/core/net/proxy_config_monitor.cpp +++ b/src/core/net/proxy_config_monitor.cpp @@ -82,12 +82,13 @@ ProxyConfigMonitor::~ProxyConfigMonitor() void ProxyConfigMonitor::AddToNetworkContextParams( network::mojom::NetworkContextParams *network_context_params) { - network::mojom::ProxyConfigClientPtr proxy_config_client; - network_context_params->proxy_config_client_request = mojo::MakeRequest(&proxy_config_client); - proxy_config_client_set_.AddPtr(std::move(proxy_config_client)); + mojo::PendingRemote<network::mojom::ProxyConfigClient> proxy_config_client; + network_context_params->proxy_config_client_receiver = + proxy_config_client.InitWithNewPipeAndPassReceiver(); + proxy_config_client_set_.Add(std::move(proxy_config_client)); - poller_binding_set_.AddBinding( - this, mojo::MakeRequest(&network_context_params->proxy_config_poller_client)); + poller_receiver_set_.Add(this, + network_context_params->proxy_config_poller_client.InitWithNewPipeAndPassReceiver()); net::ProxyConfigWithAnnotation proxy_config; net::ProxyConfigService::ConfigAvailability availability = @@ -102,21 +103,19 @@ void ProxyConfigMonitor::OnProxyConfigChanged( { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) || !BrowserThread::IsThreadInitialized(BrowserThread::UI)); - proxy_config_client_set_.ForAllPtrs( - [config, availability](network::mojom::ProxyConfigClient *proxy_config_client) { - switch (availability) { - case net::ProxyConfigService::CONFIG_VALID: - proxy_config_client->OnProxyConfigUpdated(config); - break; - case net::ProxyConfigService::CONFIG_UNSET: - proxy_config_client->OnProxyConfigUpdated( - net::ProxyConfigWithAnnotation::CreateDirect()); - break; - case net::ProxyConfigService::CONFIG_PENDING: - NOTREACHED(); - break; - } - }); + for (const auto &proxy_config_client : proxy_config_client_set_) { + switch (availability) { + case net::ProxyConfigService::CONFIG_VALID: + proxy_config_client->OnProxyConfigUpdated(config); + break; + case net::ProxyConfigService::CONFIG_UNSET: + proxy_config_client->OnProxyConfigUpdated(net::ProxyConfigWithAnnotation::CreateDirect()); + break; + case net::ProxyConfigService::CONFIG_PENDING: + NOTREACHED(); + break; + } + } } void ProxyConfigMonitor::OnLazyProxyConfigPoll() diff --git a/src/core/net/proxy_config_monitor.h b/src/core/net/proxy_config_monitor.h index 23f073a84..fda6a6fb9 100644 --- a/src/core/net/proxy_config_monitor.h +++ b/src/core/net/proxy_config_monitor.h @@ -51,8 +51,8 @@ #include "base/macros.h" #include "build/buildflag.h" #include "extensions/buildflags/buildflags.h" -#include "mojo/public/cpp/bindings/binding_set.h" -#include "mojo/public/cpp/bindings/interface_ptr_set.h" +#include "mojo/public/cpp/bindings/receiver_set.h" +#include "mojo/public/cpp/bindings/remote_set.h" #include "net/proxy_resolution/proxy_config_service.h" #include "services/network/public/mojom/network_context.mojom-forward.h" #include "services/network/public/mojom/network_service.mojom-forward.h" @@ -94,9 +94,8 @@ private: std::unique_ptr<ProxyConfigServiceQt> proxy_config_service_; - mojo::BindingSet<network::mojom::ProxyConfigPollerClient> poller_binding_set_; - - mojo::InterfacePtrSet<network::mojom::ProxyConfigClient> proxy_config_client_set_; + mojo::ReceiverSet<network::mojom::ProxyConfigPollerClient> poller_receiver_set_; + mojo::RemoteSet<network::mojom::ProxyConfigClient> proxy_config_client_set_; DISALLOW_COPY_AND_ASSIGN(ProxyConfigMonitor); }; diff --git a/src/core/net/proxying_restricted_cookie_manager_qt.cpp b/src/core/net/proxying_restricted_cookie_manager_qt.cpp index e14ea2375..7ee6c2a15 100644 --- a/src/core/net/proxying_restricted_cookie_manager_qt.cpp +++ b/src/core/net/proxying_restricted_cookie_manager_qt.cpp @@ -72,10 +72,10 @@ public: , client_listener_(std::move(client_listener)) {} - void OnCookieChange(const net::CanonicalCookie &cookie, network::mojom::CookieChangeCause cause) override + void OnCookieChange(const net::CookieChangeInfo &change) override { if (restricted_cookie_manager_ && restricted_cookie_manager_->allowCookies(url_, site_for_cookies_)) - client_listener_->OnCookieChange(cookie, cause); + client_listener_->OnCookieChange(change); } private: diff --git a/src/core/net/proxying_url_loader_factory_qt.cpp b/src/core/net/proxying_url_loader_factory_qt.cpp index 429c158a5..29ca02513 100644 --- a/src/core/net/proxying_url_loader_factory_qt.cpp +++ b/src/core/net/proxying_url_loader_factory_qt.cpp @@ -63,6 +63,7 @@ #include "type_conversion.h" #include "web_contents_adapter_client.h" #include "web_contents_view_qt.h" + #include <QVariant> // originally based on aw_proxying_url_loader_factory.cc: @@ -93,7 +94,7 @@ class InterceptedRequest : public network::mojom::URLLoader { public: InterceptedRequest(int process_id, uint64_t request_id, int32_t routing_id, uint32_t options, - const network::ResourceRequest &request, + const network::ResourceRequest &request, const GURL &top_document_url, const net::MutableNetworkTrafficAnnotationTag &traffic_annotation, ProfileIODataQt *profileData, network::mojom::URLLoaderRequest loader_request, network::mojom::URLLoaderClientPtr client, @@ -146,7 +147,7 @@ private: // That way the destructor can send it to OnReceivedError if safe browsing // error didn't occur. int error_status_ = net::OK; - GURL m_originalUrl; + GURL m_topDocumentUrl; network::ResourceRequest request_; network::ResourceResponseHead current_response_; @@ -167,7 +168,7 @@ private: }; InterceptedRequest::InterceptedRequest(int process_id, uint64_t request_id, int32_t routing_id, uint32_t options, - const network::ResourceRequest &request, + const network::ResourceRequest &request, const GURL &top_document_url, const net::MutableNetworkTrafficAnnotationTag &traffic_annotation, ProfileIODataQt *profileData, network::mojom::URLLoaderRequest loader_request, @@ -177,6 +178,7 @@ InterceptedRequest::InterceptedRequest(int process_id, uint64_t request_id, int3 , request_id_(request_id) , routing_id_(routing_id) , options_(options) + , m_topDocumentUrl(top_document_url) , request_(request) , traffic_annotation_(traffic_annotation) , m_profileData(profileData) @@ -217,16 +219,15 @@ void InterceptedRequest::InterceptOnUIThread() WebContentsAdapterClient::NavigationType navigationType = pageTransitionToNavigationType(ui::PageTransition(request_.transition_type)); - m_originalUrl = request_.url; const QUrl qUrl = toQt(request_.url); const QUrl initiator = request_.request_initiator.has_value() ? toQt(request_.request_initiator->GetURL()) : QUrl(); QUrl firstPartyUrl; - if (resourceType == content::ResourceType::kSubFrame) - firstPartyUrl = toQt(request_.first_party_url); + if (!m_topDocumentUrl.is_empty()) + firstPartyUrl = toQt(m_topDocumentUrl); else - firstPartyUrl = toQt(request_.site_for_cookies); + firstPartyUrl = toQt(request_.site_for_cookies); // m_topDocumentUrl can be empty for the main-frame. QWebEngineUrlRequestInfoPrivate *infoPrivate = new QWebEngineUrlRequestInfoPrivate(toQt(resourceType), toQt(navigationType), @@ -275,7 +276,7 @@ void InterceptedRequest::InterceptOnUIThread() request_.update_first_party_url_on_redirect ? net::URLRequest::UPDATE_FIRST_PARTY_URL_ON_REDIRECT : net::URLRequest::NEVER_CHANGE_FIRST_PARTY_URL; net::RedirectInfo redirectInfo = net::RedirectInfo::ComputeRedirectInfo(request_.method, request_.url, - request_.site_for_cookies, request_.top_frame_origin, + request_.site_for_cookies, first_party_url_policy, request_.referrer_policy, request_.referrer.spec(), net::HTTP_TEMPORARY_REDIRECT, toGurl(requestInfo.requestUrl()), base::nullopt, @@ -469,9 +470,10 @@ void InterceptedRequest::SendErrorAndCompleteImmediately(int error_code) ProxyingURLLoaderFactoryQt::ProxyingURLLoaderFactoryQt(int process_id, content::ResourceContext *resourceContext, - network::mojom::URLLoaderFactoryRequest loader_request, + content::RenderFrameHostImpl *host, + mojo::PendingReceiver<network::mojom::URLLoaderFactory> loader_receiver, network::mojom::URLLoaderFactoryPtrInfo target_factory_info) - : m_processId(process_id), m_resourceContext(resourceContext), m_weakFactory(this) + : m_processId(process_id), m_resourceContext(resourceContext), m_renderFrameHost(host), m_weakFactory(this) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); if (target_factory_info) { @@ -479,8 +481,8 @@ ProxyingURLLoaderFactoryQt::ProxyingURLLoaderFactoryQt(int process_id, m_targetFactory.set_connection_error_handler( base::BindOnce(&ProxyingURLLoaderFactoryQt::OnTargetFactoryError, m_weakFactory.GetWeakPtr())); } - m_proxyBindings.AddBinding(this, std::move(loader_request)); - m_proxyBindings.set_connection_error_handler( + m_proxyReceivers.Add(this, std::move(loader_receiver)); + m_proxyReceivers.set_disconnect_handler( base::BindRepeating(&ProxyingURLLoaderFactoryQt::OnProxyBindingError, m_weakFactory.GetWeakPtr())); } @@ -492,13 +494,14 @@ ProxyingURLLoaderFactoryQt::~ProxyingURLLoaderFactoryQt() // static void ProxyingURLLoaderFactoryQt::CreateProxy(int process_id, content::ResourceContext *resourceContext, - network::mojom::URLLoaderFactoryRequest loader_request, + content::RenderFrameHostImpl *host, + mojo::PendingReceiver<network::mojom::URLLoaderFactory> loader_receiver, network::mojom::URLLoaderFactoryPtrInfo target_factory_info) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); // Will manage its own lifetime - new ProxyingURLLoaderFactoryQt(process_id, resourceContext, std::move(loader_request), std::move(target_factory_info)); + new ProxyingURLLoaderFactoryQt(process_id, resourceContext, host, std::move(loader_receiver), std::move(target_factory_info)); } void ProxyingURLLoaderFactoryQt::CreateLoaderAndStart(network::mojom::URLLoaderRequest loader, int32_t routing_id, @@ -523,9 +526,16 @@ void ProxyingURLLoaderFactoryQt::CreateLoaderAndStart(network::mojom::URLLoaderR if (m_targetFactory) m_targetFactory->Clone(mojo::MakeRequest(&target_factory_clone)); + // Follows a similar path to the root as RenderFrameHostImpl::CalculateSiteForCookies() + GURL top_document_url; + if (m_renderFrameHost) + top_document_url = m_renderFrameHost->frame_tree_node()->frame_tree()->root()->current_frame_host()->GetLastCommittedURL(); + else + LOG(INFO) << "ProxyingURLLoaderFactoryQt::CreateLoaderAndStart() - null m_renderFrameHost, shouldn't happen"; // Will manage its own lifetime InterceptedRequest *req = new InterceptedRequest(m_processId, request_id, routing_id, options, request, + top_document_url, traffic_annotation, profileIOData, std::move(loader), std::move(client), std::move(target_factory_clone)); @@ -539,14 +549,14 @@ void ProxyingURLLoaderFactoryQt::OnTargetFactoryError() void ProxyingURLLoaderFactoryQt::OnProxyBindingError() { - if (m_proxyBindings.empty()) + if (m_proxyReceivers.empty()) delete this; } -void ProxyingURLLoaderFactoryQt::Clone(network::mojom::URLLoaderFactoryRequest loader_request) +void ProxyingURLLoaderFactoryQt::Clone(mojo::PendingReceiver<network::mojom::URLLoaderFactory> receiver) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); - m_proxyBindings.AddBinding(this, std::move(loader_request)); + m_proxyReceivers.Add(this, std::move(receiver)); } } // namespace QtWebEngineCore diff --git a/src/core/net/proxying_url_loader_factory_qt.h b/src/core/net/proxying_url_loader_factory_qt.h index a2f175885..4d913f545 100644 --- a/src/core/net/proxying_url_loader_factory_qt.h +++ b/src/core/net/proxying_url_loader_factory_qt.h @@ -46,8 +46,7 @@ #include "base/memory/ref_counted_delete_on_sequence.h" #include "base/memory/weak_ptr.h" #include "base/optional.h" -#include "mojo/public/cpp/bindings/binding.h" -#include "mojo/public/cpp/bindings/binding_set.h" +#include "mojo/public/cpp/bindings/receiver_set.h" #include "net/traffic_annotation/network_traffic_annotation.h" #include "services/network/public/cpp/resource_request.h" #include "services/network/public/cpp/resource_response.h" @@ -61,6 +60,7 @@ // found in the LICENSE file. namespace content { +class RenderFrameHostImpl; class ResourceContext; } @@ -70,14 +70,15 @@ class ProxyingURLLoaderFactoryQt : public network::mojom::URLLoaderFactory { public: ProxyingURLLoaderFactoryQt(int process_id, content::ResourceContext *resourceContext, - network::mojom::URLLoaderFactoryRequest loader_request, + content::RenderFrameHostImpl *host, + mojo::PendingReceiver<network::mojom::URLLoaderFactory> loader_receiver, network::mojom::URLLoaderFactoryPtrInfo target_factory_info); ~ProxyingURLLoaderFactoryQt() override; - // static static void CreateProxy(int process_id, content::ResourceContext *resourceContext, - network::mojom::URLLoaderFactoryRequest loader, + content::RenderFrameHostImpl *host, + mojo::PendingReceiver<network::mojom::URLLoaderFactory> loader_receiver, network::mojom::URLLoaderFactoryPtrInfo target_factory_info); void CreateLoaderAndStart(network::mojom::URLLoaderRequest loader, int32_t routing_id, int32_t request_id, @@ -85,17 +86,18 @@ public: network::mojom::URLLoaderClientPtr client, const net::MutableNetworkTrafficAnnotationTag &traffic_annotation) override; - void Clone(network::mojom::URLLoaderFactoryRequest loader_request) override; + void Clone(mojo::PendingReceiver<network::mojom::URLLoaderFactory> receiver) override; private: void OnTargetFactoryError(); void OnProxyBindingError(); const int m_processId; - mojo::BindingSet<network::mojom::URLLoaderFactory> m_proxyBindings; + mojo::ReceiverSet<network::mojom::URLLoaderFactory> m_proxyReceivers; network::mojom::URLLoaderFactoryPtr m_targetFactory; content::ResourceContext *m_resourceContext; + content::RenderFrameHostImpl *m_renderFrameHost; base::WeakPtrFactory<ProxyingURLLoaderFactoryQt> m_weakFactory; diff --git a/src/core/net/system_network_context_manager.cpp b/src/core/net/system_network_context_manager.cpp index 29343df4e..2c5f49615 100644 --- a/src/core/net/system_network_context_manager.cpp +++ b/src/core/net/system_network_context_manager.cpp @@ -78,6 +78,7 @@ #include "services/network/public/cpp/features.h" #include "services/network/public/cpp/shared_url_loader_factory.h" #include "services/network/public/mojom/host_resolver.mojom.h" +#include "services/network/public/mojom/url_loader_factory.mojom.h" #include "services/proxy_resolver/public/mojom/proxy_resolver.mojom.h" #include "url/gurl.h" @@ -133,11 +134,11 @@ public: url_request, std::move(client), traffic_annotation); } - void Clone(network::mojom::URLLoaderFactoryRequest request) override + void Clone(mojo::PendingReceiver<network::mojom::URLLoaderFactory> receiver) { if (!manager_) return; - manager_->GetURLLoaderFactory()->Clone(std::move(request)); + manager_->GetURLLoaderFactory()->Clone(std::move(receiver)); } // SharedURLLoaderFactory implementation: @@ -322,8 +323,6 @@ network::mojom::NetworkContextParamsPtr SystemNetworkContextManager::CreateDefau network_context_params->ct_logs.push_back(std::move(log_info)); } - network_context_params->http_09_on_non_default_ports_enabled = false; - return network_context_params; } @@ -343,7 +342,7 @@ network::mojom::NetworkContextParamsPtr SystemNetworkContextManager::CreateNetwo network_context_params->enable_ftp_url_support = true; #endif - network_context_params->primary_network_context = true; + network_context_params->primary_network_context = false; proxy_config_monitor_.AddToNetworkContextParams(network_context_params.get()); diff --git a/src/core/net/webui_controller_factory_qt.cpp b/src/core/net/webui_controller_factory_qt.cpp index 8c045bb7b..27e58d75f 100644 --- a/src/core/net/webui_controller_factory_qt.cpp +++ b/src/core/net/webui_controller_factory_qt.cpp @@ -65,7 +65,7 @@ #include "url/gurl.h" #if defined(OS_LINUX) || defined(OS_ANDROID) -#include "chrome/browser/ui/webui/sandbox_internals_ui.h" +#include "chrome/browser/ui/webui/sandbox/sandbox_internals_ui.h" #endif // The Following WebUIs are disabled because they currently doesn't build diff --git a/src/core/ozone/gl_surface_qt.cpp b/src/core/ozone/gl_surface_qt.cpp index e9da5e6a5..c54a8f12e 100644 --- a/src/core/ozone/gl_surface_qt.cpp +++ b/src/core/ozone/gl_surface_qt.cpp @@ -238,6 +238,11 @@ bool DirectCompositionSurfaceWin::IsHDRSupported() { return false; } + +bool DirectCompositionSurfaceWin::IsSwapChainTearingSupported() +{ + return false; +} } // namespace gl #endif #endif // !defined(OS_MACOSX) diff --git a/src/core/ozone/ozone_platform_qt.cpp b/src/core/ozone/ozone_platform_qt.cpp index 2ab274b8f..887bc167e 100644 --- a/src/core/ozone/ozone_platform_qt.cpp +++ b/src/core/ozone/ozone_platform_qt.cpp @@ -51,7 +51,6 @@ #include "ui/ozone/public/system_input_injector.h" #include "ui/platform_window/platform_window_delegate.h" #include "ui/platform_window/platform_window_init_properties.h" -#include "ui/platform_window/platform_window.h" #include "surface_factory_qt.h" #include "platform_window_qt.h" @@ -68,7 +67,7 @@ public: ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone() override; ui::CursorFactoryOzone* GetCursorFactoryOzone() override; GpuPlatformSupportHost* GetGpuPlatformSupportHost() override; - std::unique_ptr<PlatformWindow> CreatePlatformWindow(PlatformWindowDelegate* delegate, PlatformWindowInitProperties properties) override; + std::unique_ptr<PlatformWindowBase> CreatePlatformWindow(PlatformWindowDelegate* delegate, PlatformWindowInitProperties properties) override; std::unique_ptr<display::NativeDisplayDelegate> CreateNativeDisplayDelegate() override; ui::InputController* GetInputController() override; std::unique_ptr<ui::SystemInputInjector> CreateSystemInputInjector() override; @@ -109,7 +108,7 @@ GpuPlatformSupportHost* OzonePlatformQt::GetGpuPlatformSupportHost() return gpu_platform_support_host_.get(); } -std::unique_ptr<PlatformWindow> OzonePlatformQt::CreatePlatformWindow(PlatformWindowDelegate* delegate, PlatformWindowInitProperties properties) +std::unique_ptr<PlatformWindowBase> OzonePlatformQt::CreatePlatformWindow(PlatformWindowDelegate* delegate, PlatformWindowInitProperties properties) { return base::WrapUnique(new PlatformWindowQt(delegate, properties.bounds)); } diff --git a/src/core/ozone/platform_window_qt.h b/src/core/ozone/platform_window_qt.h index 13ee24b88..344e9b115 100644 --- a/src/core/ozone/platform_window_qt.h +++ b/src/core/ozone/platform_window_qt.h @@ -45,12 +45,12 @@ #include "ui/events/platform/platform_event_dispatcher.h" #include "ui/gfx/geometry/point.h" #include "ui/gfx/geometry/rect.h" -#include "ui/platform_window/platform_window.h" +#include "ui/platform_window/platform_window_base.h" #include "ui/platform_window/platform_window_delegate.h" namespace ui { -class PlatformWindowQt : public PlatformWindow, public PlatformEventDispatcher +class PlatformWindowQt : public PlatformWindowBase, public PlatformEventDispatcher { public: PlatformWindowQt(PlatformWindowDelegate* delegate, const gfx::Rect& bounds); @@ -58,9 +58,10 @@ public: // PlatformWindow: gfx::Rect GetBounds() override; void SetBounds(const gfx::Rect& bounds) override; - void Show() override { } + void Show(bool inactive = false) override { } void Hide() override { } void Close() override { } + bool IsVisible() const { return true; } void SetTitle(const base::string16&) override { } void SetCapture() override { } void ReleaseCapture() override { } @@ -78,6 +79,10 @@ public: void Activate() override { } void Deactivate() override { } void SetUseNativeFrame(bool use_native_frame) override { } + bool ShouldUseNativeFrame() const override { return false; } + void SetWindowIcons(const gfx::ImageSkia& window_icon, + const gfx::ImageSkia& app_icon) override { } + void SizeConstraintsChanged() override { } // PlatformEventDispatcher: bool CanDispatchEvent(const PlatformEvent& event) override; diff --git a/src/core/printing/print_view_manager_qt.cpp b/src/core/printing/print_view_manager_qt.cpp index 4c82faee8..ebaad9a80 100644 --- a/src/core/printing/print_view_manager_qt.cpp +++ b/src/core/printing/print_view_manager_qt.cpp @@ -66,6 +66,7 @@ #include "printing/metafile_skia.h" #include "printing/print_job_constants.h" #include "printing/units.h" +#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h" namespace { @@ -120,10 +121,7 @@ static base::DictionaryValue *createPrintSettings() printSettings->SetInteger(printing::kPreviewRequestID, internalRequestId); // The following are standard settings that Chromium expects to be set. - printSettings->SetBoolean(printing::kSettingPrintToPDF, true); - printSettings->SetBoolean(printing::kSettingCloudPrintDialog, false); - printSettings->SetBoolean(printing::kSettingPrintWithPrivet, false); - printSettings->SetBoolean(printing::kSettingPrintWithExtension, false); + printSettings->SetInteger(printing::kSettingPrinterType, printing::kPdfPrinter); printSettings->SetInteger(printing::kSettingDpiHorizontal, printing::kPointsPerInch); printSettings->SetInteger(printing::kSettingDpiVertical, printing::kPointsPerInch); @@ -272,15 +270,9 @@ bool PrintViewManagerQt::PrintToPDFInternal(const QPageLayout &pageLayout, return false; content::RenderFrameHost* rfh = web_contents()->GetMainFrame(); - auto message = std::make_unique<PrintMsg_InitiatePrintPreview>( - rfh->GetRoutingID(), false); + GetPrintRenderFrame(rfh)->InitiatePrintPreview(nullptr, false); DCHECK(!m_printPreviewRfh); - - if (!rfh->Send(message.release())) { - return false; - } - m_printPreviewRfh = rfh; return true; } @@ -324,6 +316,24 @@ void PrintViewManagerQt::RenderFrameDeleted(content::RenderFrameHost *render_fra if (render_frame_host == m_printPreviewRfh) PrintPreviewDone(); PrintViewManagerBaseQt::RenderFrameDeleted(render_frame_host); + m_printRenderFrames.erase(render_frame_host); +} + +const mojo::AssociatedRemote<printing::mojom::PrintRenderFrame> &PrintViewManagerQt::GetPrintRenderFrame(content::RenderFrameHost *rfh) +{ + auto it = m_printRenderFrames.find(rfh); + if (it == m_printRenderFrames.end()) { + mojo::AssociatedRemote<printing::mojom::PrintRenderFrame> remote; + rfh->GetRemoteAssociatedInterfaces()->GetInterface(&remote); + it = m_printRenderFrames.insert(std::make_pair(rfh, std::move(remote))).first; + } else if (it->second.is_bound() && !it->second.is_connected()) { + // When print preview is closed, the remote is disconnected from the + // receiver. Reset and bind the remote before using it again. + it->second.reset(); + rfh->GetRemoteAssociatedInterfaces()->GetInterface(&it->second); + } + + return it->second; } void PrintViewManagerQt::resetPdfState() @@ -419,7 +429,7 @@ void PrintViewManagerQt::OnSetupScriptedPrintPreview(content::RenderFrameHost* r return; // close preview - rfh->Send(new PrintMsg_ClosePrintPreviewDialog(rfh->GetRoutingID())); + GetPrintRenderFrame(rfh)->OnPrintPreviewDialogClosed(); client->printRequested(); } @@ -431,8 +441,7 @@ void PrintViewManagerQt::OnShowScriptedPrintPreview(content::RenderFrameHost* rf } void PrintViewManagerQt::PrintPreviewDone() { - m_printPreviewRfh->Send(new PrintMsg_ClosePrintPreviewDialog( - m_printPreviewRfh->GetRoutingID())); + GetPrintRenderFrame(m_printPreviewRfh)->OnPrintPreviewDialogClosed(); m_printPreviewRfh = nullptr; } diff --git a/src/core/printing/print_view_manager_qt.h b/src/core/printing/print_view_manager_qt.h index 14f2688dd..06c2f47ea 100644 --- a/src/core/printing/print_view_manager_qt.h +++ b/src/core/printing/print_view_manager_qt.h @@ -47,14 +47,17 @@ #include "print_view_manager_base_qt.h" #include "qtwebenginecoreglobal_p.h" + #include "base/memory/ref_counted.h" #include "base/strings/string16.h" #include "components/prefs/pref_member.h" #include "components/printing/browser/print_manager.h" +#include "components/printing/common/print.mojom.h" #include "components/printing/common/print_messages.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "content/public/browser/web_contents_user_data.h" +#include "mojo/public/cpp/bindings/associated_remote.h" #include <QSharedPointer> @@ -132,6 +135,11 @@ protected: private: void resetPdfState(); + + // Helper method to fetch the PrintRenderFrame associated remote interface + // pointer. + const mojo::AssociatedRemote<printing::mojom::PrintRenderFrame> &GetPrintRenderFrame(content::RenderFrameHost *rfh); + // content::WebContentsObserver implementation. void DidStartLoading() override; void PrintPreviewDone(); @@ -143,6 +151,9 @@ private: PrintToPDFCallback m_pdfPrintCallback; PrintToPDFFileCallback m_pdfSaveCallback; std::unique_ptr<base::DictionaryValue> m_printSettings; + + std::map<content::RenderFrameHost*,mojo::AssociatedRemote<printing::mojom::PrintRenderFrame>> m_printRenderFrames; + friend class content::WebContentsUserData<PrintViewManagerQt>; DISALLOW_COPY_AND_ASSIGN(PrintViewManagerQt); struct FrameDispatchHelper; diff --git a/src/core/profile_adapter.cpp b/src/core/profile_adapter.cpp index 55db83d16..143e6ccee 100644 --- a/src/core/profile_adapter.cpp +++ b/src/core/profile_adapter.cpp @@ -45,6 +45,7 @@ #include "content/public/browser/download_manager.h" #include "content/public/browser/shared_cors_origin_access_list.h" #include "services/network/public/cpp/cors/origin_access_list.h" +#include "url/url_util.h" #include "api/qwebengineurlscheme.h" #include "content_browser_client_qt.h" @@ -610,7 +611,7 @@ void ProfileAdapter::setHttpAcceptLanguage(const QString &httpAcceptLanguage) if (web_contents->GetBrowserContext() == m_profile.data()) { blink::mojom::RendererPreferences *rendererPrefs = web_contents->GetMutableRendererPrefs(); rendererPrefs->accept_languages = httpAcceptLanguageWithoutQualities().toStdString(); - web_contents->GetRenderViewHost()->SyncRendererPrefs(); + web_contents->SyncRendererPrefs(); } } diff --git a/src/core/profile_io_data_qt.cpp b/src/core/profile_io_data_qt.cpp index d24689dec..6eb758f46 100644 --- a/src/core/profile_io_data_qt.cpp +++ b/src/core/profile_io_data_qt.cpp @@ -51,7 +51,6 @@ #include "net/proxy_resolution/proxy_config_service.h" #include "net/proxy_resolution/proxy_resolution_service.h" #include "net/ssl/ssl_config_service_defaults.h" -#include "services/file/user_id_map.h" #include "services/network/proxy_service_mojo.h" #include "services/network/public/cpp/features.h" #include "services/network/public/cpp/cors/origin_access_list.h" @@ -269,11 +268,6 @@ void ProfileIODataQt::updateStorageSettings() const std::lock_guard<QRecursiveMutex> lock(m_mutex); setFullConfiguration(); - base::Token groupId = content::BrowserContext::GetServiceInstanceGroupFor(m_profile); - if (file::GetUserDirForInstanceGroup(groupId) != toFilePath(m_profileAdapter->dataPath())) { - file::ForgetServiceInstanceGroupUserDirAssociation(groupId); - file::AssociateServiceInstanceGroupWithUserDir(groupId, toFilePath(m_profileAdapter->dataPath())); - } if (!m_pendingStorageRequestGeneration) requestStorageGeneration(); } @@ -429,7 +423,8 @@ network::mojom::NetworkContextParamsPtr ProfileIODataQt::CreateNetworkContextPar network_context_params->accept_language = m_httpAcceptLanguage.toStdString(); network_context_params->enable_referrers = true; - network_context_params->enable_encrypted_cookies = false; // ??? + // Encrypted cookies requires os_crypt, which currently has issues for us on Linux. + network_context_params->enable_encrypted_cookies = false; // network_context_params->proxy_resolver_factory = std::move(m_proxyResolverFactoryInterface); network_context_params->http_cache_enabled = m_httpCacheType != ProfileAdapter::NoCache; diff --git a/src/core/profile_qt.cpp b/src/core/profile_qt.cpp index f87247fe6..3d3baa0d7 100644 --- a/src/core/profile_qt.cpp +++ b/src/core/profile_qt.cpp @@ -216,6 +216,11 @@ content::ClientHintsControllerDelegate *ProfileQt::GetClientHintsControllerDeleg return nullptr; } +content::StorageNotificationService *ProfileQt::GetStorageNotificationService() +{ + return nullptr; +} + void ProfileQt::SetCorsOriginAccessListForOrigin(const url::Origin &source_origin, std::vector<network::mojom::CorsOriginPatternPtr> allow_patterns, std::vector<network::mojom::CorsOriginPatternPtr> block_patterns, diff --git a/src/core/profile_qt.h b/src/core/profile_qt.h index 527816b6e..59f5a8c21 100644 --- a/src/core/profile_qt.h +++ b/src/core/profile_qt.h @@ -91,6 +91,7 @@ public: content::BackgroundSyncController *GetBackgroundSyncController() override; content::BrowsingDataRemoverDelegate *GetBrowsingDataRemoverDelegate() override; content::ClientHintsControllerDelegate *GetClientHintsControllerDelegate() override; + content::StorageNotificationService *GetStorageNotificationService() override; void SetCorsOriginAccessListForOrigin(const url::Origin &source_origin, std::vector<network::mojom::CorsOriginPatternPtr> allow_patterns, std::vector<network::mojom::CorsOriginPatternPtr> block_patterns, diff --git a/src/core/qtwebengine_sources.gni b/src/core/qtwebengine_sources.gni index f6518d95b..c9d0da8ba 100644 --- a/src/core/qtwebengine_sources.gni +++ b/src/core/qtwebengine_sources.gni @@ -130,8 +130,8 @@ source_set("qtwebengine_sources") { if (is_linux) { sources += [ - "//chrome/browser/ui/webui/sandbox_internals_ui.cc", - "//chrome/browser/ui/webui/sandbox_internals_ui.h", + "//chrome/browser/ui/webui/sandbox/sandbox_internals_ui.cc", + "//chrome/browser/ui/webui/sandbox/sandbox_internals_ui.h", ] } diff --git a/src/core/renderer/content_renderer_client_qt.cpp b/src/core/renderer/content_renderer_client_qt.cpp index 7dc0525ab..aa6038723 100644 --- a/src/core/renderer/content_renderer_client_qt.cpp +++ b/src/core/renderer/content_renderer_client_qt.cpp @@ -250,10 +250,8 @@ bool ContentRendererClientQt::ShouldSuppressErrorPage(content::RenderFrame *fram void ContentRendererClientQt::PrepareErrorPage(content::RenderFrame *renderFrame, const blink::WebURLError &web_error, const std::string &httpMethod, - bool ignoring_cache, std::string *errorHtml) { - Q_UNUSED(ignoring_cache); GetNavigationErrorStringsInternal( renderFrame, httpMethod, error_page::Error::NetError(web_error.url(), web_error.reason(), web_error.has_copy_in_cache()), errorHtml); @@ -262,11 +260,9 @@ void ContentRendererClientQt::PrepareErrorPage(content::RenderFrame *renderFrame void ContentRendererClientQt::PrepareErrorPageForHttpStatusError(content::RenderFrame *renderFrame, const GURL &unreachable_url, const std::string &httpMethod, - bool ignoring_cache, int http_status, std::string *errorHtml) { - Q_UNUSED(ignoring_cache); GetNavigationErrorStringsInternal(renderFrame, httpMethod, error_page::Error::HttpError(unreachable_url, http_status), errorHtml); diff --git a/src/core/renderer/content_renderer_client_qt.h b/src/core/renderer/content_renderer_client_qt.h index 7cd282a83..46504d606 100644 --- a/src/core/renderer/content_renderer_client_qt.h +++ b/src/core/renderer/content_renderer_client_qt.h @@ -89,12 +89,10 @@ public: void PrepareErrorPage(content::RenderFrame *render_frame, const blink::WebURLError &error, const std::string &http_method, - bool ignoring_cache, std::string *error_html) override; void PrepareErrorPageForHttpStatusError(content::RenderFrame *render_frame, const GURL &unreachable_url, const std::string &http_method, - bool ignoring_cache, int http_status, std::string *error_html) override; diff --git a/src/core/renderer/render_thread_observer_qt.cpp b/src/core/renderer/render_thread_observer_qt.cpp index 6012099b8..4912ebfc2 100644 --- a/src/core/renderer/render_thread_observer_qt.cpp +++ b/src/core/renderer/render_thread_observer_qt.cpp @@ -67,9 +67,9 @@ void RenderThreadObserverQt::SetInitialConfiguration(bool is_incognito_process) } void RenderThreadObserverQt::OnRendererConfigurationAssociatedRequest( - qtwebengine::mojom::RendererConfigurationAssociatedRequest request) + mojo::PendingAssociatedReceiver<qtwebengine::mojom::RendererConfiguration> receiver) { - m_rendererConfigurationBindings.AddBinding(this, std::move(request)); + m_rendererConfigurationReceivers.Add(this, std::move(receiver)); } } // namespace diff --git a/src/core/renderer/render_thread_observer_qt.h b/src/core/renderer/render_thread_observer_qt.h index 21acc6f13..05372049b 100644 --- a/src/core/renderer/render_thread_observer_qt.h +++ b/src/core/renderer/render_thread_observer_qt.h @@ -41,7 +41,8 @@ #define RENDER_THREAD_OBSERVER_QT_H #include "content/public/renderer/render_thread_observer.h" -#include "mojo/public/cpp/bindings/associated_binding_set.h" +#include "mojo/public/cpp/bindings/associated_receiver_set.h" +#include "mojo/public/cpp/bindings/pending_associated_receiver.h" #include "qtwebengine/common/renderer_configuration.mojom.h" namespace QtWebEngineCore { @@ -64,11 +65,12 @@ private: // qtwebengine::mojom::RendererConfiguration: void SetInitialConfiguration(bool is_incognito_process) override; - void OnRendererConfigurationAssociatedRequest(qtwebengine::mojom::RendererConfigurationAssociatedRequest request); + void OnRendererConfigurationAssociatedRequest( + mojo::PendingAssociatedReceiver<qtwebengine::mojom::RendererConfiguration> receiver); static bool m_isIncognitoProcess; - mojo::AssociatedBindingSet<qtwebengine::mojom::RendererConfiguration> m_rendererConfigurationBindings; + mojo::AssociatedReceiverSet<qtwebengine::mojom::RendererConfiguration> m_rendererConfigurationReceivers; DISALLOW_COPY_AND_ASSIGN(RenderThreadObserverQt); }; diff --git a/src/core/renderer/web_channel_ipc_transport.cpp b/src/core/renderer/web_channel_ipc_transport.cpp index 8e961566c..1fb3bc678 100644 --- a/src/core/renderer/web_channel_ipc_transport.cpp +++ b/src/core/renderer/web_channel_ipc_transport.cpp @@ -165,7 +165,7 @@ void WebChannelTransport::NativeQtSendMessage(gin::Arguments *args) int size = 0; const char *rawData = doc.rawData(&size); - qtwebchannel::mojom::WebChannelTransportHostAssociatedPtr webChannelTransport; + mojo::AssociatedRemote<qtwebchannel::mojom::WebChannelTransportHost> webChannelTransport; renderFrame->GetRemoteAssociatedInterfaces()->GetInterface(&webChannelTransport); webChannelTransport->DispatchWebChannelMessage(std::vector<uint8_t>(rawData, rawData + size)); } @@ -180,13 +180,13 @@ WebChannelIPCTransport::WebChannelIPCTransport(content::RenderFrame *renderFrame : content::RenderFrameObserver(renderFrame), m_worldId(0), m_worldInitialized(false) { renderFrame->GetAssociatedInterfaceRegistry()->AddInterface( - base::Bind(&WebChannelIPCTransport::BindRequest, base::Unretained(this))); + base::BindRepeating(&WebChannelIPCTransport::BindReceiver, base::Unretained(this))); } -void WebChannelIPCTransport::BindRequest(qtwebchannel::mojom::WebChannelTransportRenderAssociatedRequest request) +void WebChannelIPCTransport::BindReceiver( + mojo::PendingAssociatedReceiver<qtwebchannel::mojom::WebChannelTransportRender> receiver) { - - m_binding.AddBinding(this, std::move(request)); + m_receivers.Add(this, std::move(receiver)); } void WebChannelIPCTransport::SetWorldId(uint32_t worldId) diff --git a/src/core/renderer/web_channel_ipc_transport.h b/src/core/renderer/web_channel_ipc_transport.h index a80eecf24..15778a7bc 100644 --- a/src/core/renderer/web_channel_ipc_transport.h +++ b/src/core/renderer/web_channel_ipc_transport.h @@ -42,7 +42,8 @@ #include "content/public/renderer/render_frame_observer.h" #include "services/service_manager/public/cpp/binder_registry.h" -#include "mojo/public/cpp/bindings/associated_binding_set.h" +#include "mojo/public/cpp/bindings/associated_receiver_set.h" +#include "mojo/public/cpp/bindings/pending_associated_receiver.h" #include "qtwebengine/browser/qtwebchannel.mojom.h" #include <QtCore/qglobal.h> @@ -66,7 +67,7 @@ private: void WillReleaseScriptContext(v8::Local<v8::Context> context, int worldId) override; void DidClearWindowObject() override; void OnDestruct() override; - void BindRequest(qtwebchannel::mojom::WebChannelTransportRenderAssociatedRequest request); + void BindReceiver(mojo::PendingAssociatedReceiver<qtwebchannel::mojom::WebChannelTransportRender> receiver); private: // The worldId from our WebChannelIPCTransportHost or empty when there is no @@ -75,7 +76,7 @@ private: bool m_worldInitialized; // True means it's currently OK to manipulate the frame's script context. bool m_canUseContext = false; - mojo::AssociatedBindingSet<qtwebchannel::mojom::WebChannelTransportRender> m_binding; + mojo::AssociatedReceiverSet<qtwebchannel::mojom::WebChannelTransportRender> m_receivers; }; } // namespace diff --git a/src/core/renderer_host/web_channel_ipc_transport_host.cpp b/src/core/renderer_host/web_channel_ipc_transport_host.cpp index 6dbf2a370..c071a566a 100644 --- a/src/core/renderer_host/web_channel_ipc_transport_host.cpp +++ b/src/core/renderer_host/web_channel_ipc_transport_host.cpp @@ -96,7 +96,7 @@ void WebChannelIPCTransportHost::sendMessage(const QJsonObject &message) int size = 0; const char *rawData = doc.rawData(&size); content::RenderFrameHost *frame = web_contents()->GetMainFrame(); - qtwebchannel::mojom::WebChannelTransportRenderAssociatedPtr webChannelTransport; + mojo::AssociatedRemote<qtwebchannel::mojom::WebChannelTransportRender> webChannelTransport; frame->GetRemoteAssociatedInterfaces()->GetInterface(&webChannelTransport); qCDebug(log).nospace() << "sending webchannel message to " << frame << ": " << doc; webChannelTransport->DispatchWebChannelMessage(std::vector<uint8_t>(rawData, rawData + size), m_worldId); @@ -116,7 +116,7 @@ void WebChannelIPCTransportHost::setWorldId(content::RenderFrameHost *frame, uin if (!frame->IsRenderFrameLive()) return; qCDebug(log).nospace() << "sending setWorldId(" << worldId << ") message to " << frame; - qtwebchannel::mojom::WebChannelTransportRenderAssociatedPtr webChannelTransport; + mojo::AssociatedRemote<qtwebchannel::mojom::WebChannelTransportRender> webChannelTransport; frame->GetRemoteAssociatedInterfaces()->GetInterface(&webChannelTransport); webChannelTransport->SetWorldId(worldId); } @@ -126,7 +126,7 @@ void WebChannelIPCTransportHost::resetWorldId() for (content::RenderFrameHost *frame : web_contents()->GetAllFrames()) { if (!frame->IsRenderFrameLive()) return; - qtwebchannel::mojom::WebChannelTransportRenderAssociatedPtr webChannelTransport; + mojo::AssociatedRemote<qtwebchannel::mojom::WebChannelTransportRender> webChannelTransport; frame->GetRemoteAssociatedInterfaces()->GetInterface(&webChannelTransport); webChannelTransport->ResetWorldId(); } diff --git a/src/core/user_notification_controller.cpp b/src/core/user_notification_controller.cpp index 50d12e8fd..f94605a55 100644 --- a/src/core/user_notification_controller.cpp +++ b/src/core/user_notification_controller.cpp @@ -43,6 +43,7 @@ #include "base/callback.h" #include "content/public/browser/notification_event_dispatcher.h" +#include "third_party/blink/public/mojom/notifications/notification.mojom-shared.h" #include "third_party/blink/public/common/notifications/notification_resources.h" #include "third_party/blink/public/common/notifications/platform_notification_data.h" #include "ui/message_center/public/cpp/notification_delegate.h" diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index 98e2adcab..9dc2f7b8b 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -85,8 +85,9 @@ #include "content/public/common/page_zoom.h" #include "content/public/common/url_constants.h" #include "content/public/common/web_preferences.h" -#include "content/public/common/webrtc_ip_handling_policy.h" #include "extensions/buildflags/buildflags.h" +#include "third_party/blink/public/common/page/page_zoom.h" +#include "third_party/blink/public/common/peerconnection/webrtc_ip_handling_policy.h" #include "third_party/blink/public/web/web_media_player_action.h" #include "printing/buildflags/buildflags.h" #include "ui/base/clipboard/clipboard.h" @@ -240,7 +241,6 @@ static std::unique_ptr<content::WebContents> createBlankWebContents(WebContentsA { content::WebContents::CreateParams create_params(browserContext, NULL); create_params.routing_id = MSG_ROUTING_NONE; - create_params.initial_size = gfx::Size(kTestWindowWidth, kTestWindowHeight); create_params.initially_hidden = true; std::unique_ptr<content::WebContents> webContents = content::WebContents::Create(create_params); @@ -502,7 +502,6 @@ void WebContentsAdapter::initialize(content::SiteInstance *site) // Create our own if a WebContents wasn't provided at construction. if (!m_webContents) { content::WebContents::CreateParams create_params(m_profileAdapter->profile(), site); - create_params.initial_size = gfx::Size(kTestWindowWidth, kTestWindowHeight); create_params.initially_hidden = true; m_webContents = content::WebContents::Create(create_params); } @@ -563,8 +562,8 @@ void WebContentsAdapter::initializeRenderPrefs() else rendererPrefs->webrtc_ip_handling_policy = m_adapterClient->webEngineSettings()->testAttribute(WebEngineSettings::WebRTCPublicInterfacesOnly) - ? content::kWebRTCIPHandlingDefaultPublicInterfaceOnly - : content::kWebRTCIPHandlingDefault; + ? blink::kWebRTCIPHandlingDefaultPublicInterfaceOnly + : blink::kWebRTCIPHandlingDefault; #endif // Set web-contents font settings to the default font settings as Chromium constantly overrides // the global font defaults with the font settings of the latest web-contents created. @@ -575,7 +574,7 @@ void WebContentsAdapter::initializeRenderPrefs() rendererPrefs->use_autohinter = params.autohinter; rendererPrefs->use_bitmaps = params.use_bitmaps; rendererPrefs->subpixel_rendering = params.subpixel_rendering; - m_webContents->GetRenderViewHost()->SyncRendererPrefs(); + m_webContents->SyncRendererPrefs(); } bool WebContentsAdapter::canGoBack() const @@ -974,10 +973,10 @@ void WebContentsAdapter::serializeNavigationHistory(QDataStream &output) void WebContentsAdapter::setZoomFactor(qreal factor) { CHECK_INITIALIZED(); - if (factor < content::kMinimumZoomFactor || factor > content::kMaximumZoomFactor) + if (factor < blink::kMinimumPageZoomFactor || factor > blink::kMaximumPageZoomFactor) return; - double zoomLevel = content::ZoomFactorToZoomLevel(static_cast<double>(factor)); + double zoomLevel = blink::PageZoomFactorToZoomLevel(static_cast<double>(factor)); content::HostZoomMap *zoomMap = content::HostZoomMap::GetForWebContents(m_webContents.get()); if (zoomMap) { @@ -990,7 +989,7 @@ void WebContentsAdapter::setZoomFactor(qreal factor) qreal WebContentsAdapter::currentZoomFactor() const { CHECK_INITIALIZED(1); - return content::ZoomLevelToZoomFactor(content::HostZoomMap::GetZoomLevel(m_webContents.get())); + return blink::PageZoomLevelToZoomFactor(content::HostZoomMap::GetZoomLevel(m_webContents.get())); } ProfileQt* WebContentsAdapter::profile() diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp index c6a1157c5..e97536593 100644 --- a/src/core/web_contents_delegate_qt.cpp +++ b/src/core/web_contents_delegate_qt.cpp @@ -546,7 +546,7 @@ content::JavaScriptDialogManager *WebContentsDelegateQt::GetJavaScriptDialogMana return JavaScriptDialogManagerQt::GetInstance(); } -void WebContentsDelegateQt::EnterFullscreenModeForTab(content::WebContents *web_contents, const GURL& origin, const blink::WebFullscreenOptions &) +void WebContentsDelegateQt::EnterFullscreenModeForTab(content::WebContents *web_contents, const GURL& origin, const blink::mojom::FullscreenOptions &) { Q_UNUSED(web_contents); if (!m_viewClient->isFullScreenMode()) diff --git a/src/core/web_contents_delegate_qt.h b/src/core/web_contents_delegate_qt.h index 33fd49b3d..6818fa551 100644 --- a/src/core/web_contents_delegate_qt.h +++ b/src/core/web_contents_delegate_qt.h @@ -128,7 +128,7 @@ public: void WebContentsCreated(content::WebContents *source_contents, int opener_render_process_id, int opener_render_frame_id, const std::string &frame_name, const GURL &target_url, content::WebContents *new_contents) override; content::JavaScriptDialogManager *GetJavaScriptDialogManager(content::WebContents *source) override; - void EnterFullscreenModeForTab(content::WebContents *web_contents, const GURL &origin, const blink::WebFullscreenOptions &) override; + void EnterFullscreenModeForTab(content::WebContents *web_contents, const GURL &origin, const blink::mojom::FullscreenOptions &options) override; void ExitFullscreenModeForTab(content::WebContents*) override; bool IsFullscreenForTabOrPending(const content::WebContents* web_contents) override; void RunFileChooser(content::RenderFrameHost* render_frame_host, diff --git a/src/core/web_contents_view_qt.cpp b/src/core/web_contents_view_qt.cpp index e50835f74..139450cd8 100644 --- a/src/core/web_contents_view_qt.cpp +++ b/src/core/web_contents_view_qt.cpp @@ -111,7 +111,7 @@ content::RenderWidgetHostViewBase* WebContentsViewQt::CreateViewForChildWidget(c return view; } -void WebContentsViewQt::CreateView(const gfx::Size& initial_size, gfx::NativeView context) +void WebContentsViewQt::CreateView(gfx::NativeView context) { } diff --git a/src/core/web_contents_view_qt.h b/src/core/web_contents_view_qt.h index 978a2ce2e..6f5ffdb86 100644 --- a/src/core/web_contents_view_qt.h +++ b/src/core/web_contents_view_qt.h @@ -72,7 +72,7 @@ public: // content::WebContentsView overrides: content::RenderWidgetHostViewBase *CreateViewForWidget(content::RenderWidgetHost* render_widget_host, bool is_guest_view_hack) override; - void CreateView(const gfx::Size& initial_size, gfx::NativeView context) override; + void CreateView(gfx::NativeView context) override; content::RenderWidgetHostViewBase *CreateViewForChildWidget(content::RenderWidgetHost* render_widget_host) override; diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index 2ecb371ee..622670acf 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -47,6 +47,7 @@ #include "base/run_loop.h" #include "base/task/post_task.h" #include "base/task/sequence_manager/thread_controller_with_message_pump_impl.h" +#include "base/task/thread_pool/thread_pool_instance.h" #include "base/threading/thread_restrictions.h" #include "cc/base/switches.h" #include "chrome/common/chrome_switches.h" @@ -84,6 +85,7 @@ #include "ppapi/buildflags/buildflags.h" #include "services/network/public/cpp/features.h" #include "services/network/public/cpp/network_switches.h" +#include "services/network/public/mojom/network_context.mojom.h" #include "services/service_manager/sandbox/switches.h" #include "services/tracing/public/cpp/trace_startup.h" #include "services/tracing/public/cpp/tracing_features.h" @@ -521,6 +523,11 @@ WebEngineContext::WebEngineContext() #ifndef QT_NO_OPENGL m_threadedGpu = QOpenGLContext::supportsThreadedOpenGL(); +#if defined(Q_OS_MACOS) + // QtBase disabled it when building on 10.14+, unfortunately we still need it + // until we have fixed single-threaded viz-display-compositor. + m_threadedGpu = true; +#endif #endif m_threadedGpu = m_threadedGpu && !qEnvironmentVariableIsSet(kDisableInProcGpuThread); diff --git a/src/core/web_engine_settings.cpp b/src/core/web_engine_settings.cpp index b0537c0c6..eb6db9793 100644 --- a/src/core/web_engine_settings.cpp +++ b/src/core/web_engine_settings.cpp @@ -50,8 +50,8 @@ #include "content/public/browser/web_contents.h" #include "content/public/common/content_switches.h" #include "content/public/common/web_preferences.h" -#include "content/public/common/webrtc_ip_handling_policy.h" #include "media/base/media_switches.h" +#include "third_party/blink/public/common/peerconnection/webrtc_ip_handling_policy.h" #include "third_party/blink/public/mojom/renderer_preferences.mojom.h" #include "ui/base/ui_base_switches.h" #include "ui/events/event_switches.h" @@ -128,9 +128,8 @@ void WebEngineSettings::overrideWebPreferences(content::WebContents *webContents webPreferences.reset(new content::WebPreferences(*prefs)); if (webContents - && webContents->GetRenderViewHost() && applySettingsToRendererPreferences(webContents->GetMutableRendererPrefs())) { - webContents->GetRenderViewHost()->SyncRendererPrefs(); + webContents->SyncRendererPrefs(); } } @@ -340,7 +339,7 @@ void WebEngineSettings::doApply() m_adapter->updateWebPreferences(*webPreferences.data()); if (applySettingsToRendererPreferences(m_adapter->webContents()->GetMutableRendererPrefs())) - m_adapter->webContents()->GetRenderViewHost()->SyncRendererPrefs(); + m_adapter->webContents()->SyncRendererPrefs(); } void WebEngineSettings::applySettingsToWebPreferences(content::WebPreferences *prefs) @@ -404,12 +403,6 @@ void WebEngineSettings::applySettingsToWebPreferences(content::WebPreferences *p // Set the theme colors. Based on chrome_content_browser_client.cc: const ui::NativeTheme *webTheme = ui::NativeTheme::GetInstanceForWeb(); if (webTheme) { -#if !defined(OS_MACOSX) - // Mac has a concept of high contrast that does not relate to forced colors. - prefs->forced_colors = webTheme->UsesHighContrastColors() - ? blink::ForcedColors::kActive - : blink::ForcedColors::kNone; -#endif // !defined(OS_MACOSX) switch (webTheme->GetPreferredColorScheme()) { case ui::NativeTheme::PreferredColorScheme::kDark: prefs->preferred_color_scheme = blink::PreferredColorScheme::kDark; @@ -452,8 +445,8 @@ bool WebEngineSettings::applySettingsToRendererPreferences(blink::mojom::Rendere #if QT_CONFIG(webengine_webrtc) if (!base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kForceWebRtcIPHandlingPolicy)) { std::string webrtc_ip_handling_policy = testAttribute(WebEngineSettings::WebRTCPublicInterfacesOnly) - ? content::kWebRTCIPHandlingDefaultPublicInterfaceOnly - : content::kWebRTCIPHandlingDefault; + ? blink::kWebRTCIPHandlingDefaultPublicInterfaceOnly + : blink::kWebRTCIPHandlingDefault; if (prefs->webrtc_ip_handling_policy != webrtc_ip_handling_policy) { prefs->webrtc_ip_handling_policy = webrtc_ip_handling_policy; changed = true; diff --git a/src/core/web_event_factory.cpp b/src/core/web_event_factory.cpp index f4940f305..f37cce6c7 100644 --- a/src/core/web_event_factory.cpp +++ b/src/core/web_event_factory.cpp @@ -1510,8 +1510,9 @@ blink::WebMouseWheelEvent WebEventFactory::toWebWheelEvent(QWheelEvent *ev) webEvent.wheel_ticks_y = static_cast<float>(ev->angleDelta().y()) / QWheelEvent::DefaultDeltasPerStep; webEvent.phase = toBlinkPhase(ev); #if defined(Q_OS_DARWIN) - // has_precise_scrolling_deltas is a macOS term meaning it is a system scroll gesture, see qnsview_mouse.mm - webEvent.has_precise_scrolling_deltas = (ev->source() == Qt::MouseEventSynthesizedBySystem); + // PrecisePixel is a macOS term meaning it is a system scroll gesture, see qnsview_mouse.mm + if (ev->source() == Qt::MouseEventSynthesizedBySystem) + webEvent.delta_units = ui::input_types::ScrollGranularity::kScrollByPrecisePixel; #endif setBlinkWheelEventDelta(webEvent); @@ -1528,7 +1529,8 @@ bool WebEventFactory::coalesceWebWheelEvent(blink::WebMouseWheelEvent &webEvent, if (toBlinkPhase(ev) != webEvent.phase) return false; #if defined(Q_OS_DARWIN) - if (webEvent.has_precise_scrolling_deltas != (ev->source() == Qt::MouseEventSynthesizedBySystem)) + if ((webEvent.delta_units == ui::input_types::ScrollGranularity::kScrollByPrecisePixel) + != (ev->source() == Qt::MouseEventSynthesizedBySystem)) return false; #endif diff --git a/tests/auto/quick/qmltests/data/test4.html b/tests/auto/quick/qmltests/data/test4.html index afda71bc5..c9b395ee5 100644 --- a/tests/auto/quick/qmltests/data/test4.html +++ b/tests/auto/quick/qmltests/data/test4.html @@ -24,106 +24,106 @@ } </script> <div id="content"> - bla00<br/> - bla01<br/> - bla02<br/> - bla03<br/> - bla04<br/> - bla05<br/> - bla06<br/> - bla07<br/> - bla08<br/> - bla09<br/> - bla10<br/> - bla11<br/> - bla12<br/> - bla13<br/> - bla14<br/> - bla15<br/> - bla16<br/> - bla17<br/> - bla18<br/> - bla19<br/> - bla20<br/> - bla21<br/> - bla22<br/> - bla23<br/> - bla24<br/> - bla25<br/> - bla26<br/> - bla27<br/> - bla28<br/> - bla29<br/> - bla30<br/> - bla31<br/> - bla32<br/> - bla33<br/> - bla34<br/> - bla35<br/> - bla36<br/> - bla37<br/> - bla38<br/> - bla39<br/> - bla40<br/> - bla41<br/> - bla42<br/> - bla43<br/> - bla44<br/> - bla45<br/> - bla46<br/> - bla47<br/> - bla48<br/> - bla49<br/> - bla50<br/> - bla51<br/> - bla52<br/> - bla53<br/> - bla54<br/> - bla55<br/> - bla56<br/> - bla57<br/> - bla58<br/> - bla59<br/> - bla60<br/> - bla61<br/> - bla62<br/> - bla63<br/> - bla64<br/> - bla65<br/> - bla66<br/> - bla67<br/> - bla68<br/> - bla69<br/> - bla70<br/> - bla71<br/> - bla72<br/> - bla73<br/> - bla74<br/> - bla75<br/> - bla76<br/> - bla77<br/> - bla78<br/> - bla79<br/> - bla80<br/> - bla81<br/> - bla82<br/> - bla83<br/> - bla84<br/> - bla85<br/> - bla86<br/> - bla87<br/> - bla88<br/> - bla89<br/> - bla90<br/> - bla91<br/> - bla92<br/> - bla93<br/> - bla94<br/> - bla95<br/> - bla96<br/> - bla97<br/> - bla98<br/> - bla99<br/> + <p>bla00 + <p>bla01 + <p>bla02 + <p>bla03 + <p>bla04 + <p>bla05 + <p>bla06 + <p>bla07 + <p>bla08 + <p>bla09 + <p>bla10 + <p>bla11 + <p>bla12 + <p>bla13 + <p>bla14 + <p>bla15 + <p>bla16 + <p>bla17 + <p>bla18 + <p>bla19 + <p>bla20 + <p>bla21 + <p>bla22 + <p>bla23 + <p>bla24 + <p>bla25 + <p>bla26 + <p>bla27 + <p>bla28 + <p>bla29 + <p>bla30 + <p>bla31 + <p>bla32 + <p>bla33 + <p>bla34 + <p>bla35 + <p>bla36 + <p>bla37 + <p>bla38 + <p>bla39 + <p>bla40 + <p>bla41 + <p>bla42 + <p>bla43 + <p>bla44 + <p>bla45 + <p>bla46 + <p>bla47 + <p>bla48 + <p>bla49 + <p>bla50 + <p>bla51 + <p>bla52 + <p>bla53 + <p>bla54 + <p>bla55 + <p>bla56 + <p>bla57 + <p>bla58 + <p>bla59 + <p>bla60 + <p>bla61 + <p>bla62 + <p>bla63 + <p>bla64 + <p>bla65 + <p>bla66 + <p>bla67 + <p>bla68 + <p>bla69 + <p>bla70 + <p>bla71 + <p>bla72 + <p>bla73 + <p>bla74 + <p>bla75 + <p>bla76 + <p>bla77 + <p>bla78 + <p>bla79 + <p>bla80 + <p>bla81 + <p>bla82 + <p>bla83 + <p>bla84 + <p>bla85 + <p>bla86 + <p>bla87 + <p>bla88 + <p>bla89 + <p>bla90 + <p>bla91 + <p>bla92 + <p>bla93 + <p>bla94 + <p>bla95 + <p>bla96 + <p>bla97 + <p>bla98 + <p>bla99 </div> </body> </html> diff --git a/tests/auto/quick/qmltests/data/tst_loadUrl.qml b/tests/auto/quick/qmltests/data/tst_loadUrl.qml index 7bdd0c761..872c46641 100644 --- a/tests/auto/quick/qmltests/data/tst_loadUrl.qml +++ b/tests/auto/quick/qmltests/data/tst_loadUrl.qml @@ -230,7 +230,7 @@ TestWebEngineView { compare(loadRequest.activeUrl, aboutBlank); loadRequest = loadRequestArray[2]; compare(loadRequest.status, WebEngineView.LoadStartedStatus); - compare(loadRequest.activeUrl, "data:text/html;charset=UTF-8,load failed"); + compare(loadRequest.activeUrl, bogusSite); compare(loadRequest.url, "data:text/html;charset=UTF-8,load failed") loadRequest = loadRequestArray[3]; compare(loadRequest.status, WebEngineView.LoadSucceededStatus); diff --git a/tests/auto/widgets/accessibility/tst_accessibility.cpp b/tests/auto/widgets/accessibility/tst_accessibility.cpp index 5f472332f..80defb248 100644 --- a/tests/auto/widgets/accessibility/tst_accessibility.cpp +++ b/tests/auto/widgets/accessibility/tst_accessibility.cpp @@ -344,7 +344,7 @@ void tst_Accessibility::roles_data() QTest::newRow("AX_ROLE_APPLICATION") << QString("<div role='application'>landmark</div>") << true << QAccessible::Document; QTest::newRow("AX_ROLE_ARTICLE") << QString("<article>a</article>") << true << QAccessible::Section; QTest::newRow("AX_ROLE_AUDIO") << QString("<audio controls><source src='test.mp3' type='audio/mpeg'></audio>") << false << QAccessible::Sound; - QTest::newRow("AX_ROLE_BANNER") << QString("<header>a</header>") << true << QAccessible::Section; + QTest::newRow("AX_ROLE_BANNER") << QString("<div role=banner>a</div>") << true << QAccessible::Section; QTest::newRow("AX_ROLE_BLOCKQUOTE") << QString("<blockquote>a</blockquote>") << true << QAccessible::Section; QTest::newRow("AX_ROLE_BUTTON") << QString("<button>a</button>") << false << QAccessible::Button; //QTest::newRow("AX_ROLE_BUTTON_DROP_DOWN"); // TODO: Remove this during the next Chromium update: https://chromium-review.googlesource.com/842475 @@ -383,6 +383,7 @@ void tst_Accessibility::roles_data() QTest::newRow("AX_ROLE_FORM") << QString("<form></form>") << true << QAccessible::Form; QTest::newRow("AX_ROLE_GRID") << QString("<div role='grid'></div>") << true << QAccessible::Table; QTest::newRow("AX_ROLE_GROUP") << QString("<fieldset></fieldset>") << true << QAccessible::Grouping; + QTest::newRow("AX_ROLE_HEADER)") << QString("<header>a</header>") << true << QAccessible::Section; QTest::newRow("AX_ROLE_HEADING") << QString("<h1>a</h1>") << true << QAccessible::Heading; QTest::newRow("AX_ROLE_IFRAME") << QString("<iframe>a</iframe>") << true << QAccessible::Section; QTest::newRow("AX_ROLE_IFRAME_PRESENTATIONAL") << QString("<iframe role='presentation'>a</iframe>") << false << QAccessible::NoRole; diff --git a/tests/auto/widgets/origins/BLACKLIST b/tests/auto/widgets/origins/BLACKLIST deleted file mode 100644 index db858f11e..000000000 --- a/tests/auto/widgets/origins/BLACKLIST +++ /dev/null @@ -1,3 +0,0 @@ -# QTBUG-81556 -[mixedXHR] -* diff --git a/tests/auto/widgets/qwebenginepage/BLACKLIST b/tests/auto/widgets/qwebenginepage/BLACKLIST index 3053876d4..02b297d5a 100644 --- a/tests/auto/widgets/qwebenginepage/BLACKLIST +++ b/tests/auto/widgets/qwebenginepage/BLACKLIST @@ -5,10 +5,6 @@ osx windows macos # Can't move cursor (QTBUG-76312) -# QTBUG-81614 -[setHtmlWithBaseURL] -* - [devTools] msvc-2019 diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp index f500652c7..10ad34a9e 100644 --- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp +++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp @@ -799,7 +799,7 @@ void tst_QWebEnginePage::backActionUpdate() }; QVERIFY(evaluateJavaScriptSync(page, "document.getElementsByName('frame_b')[0].contentDocument == undefined").toBool()); - QTest::mouseClick(view.focusProxy(), Qt::LeftButton, 0, firstAnchorCenterInFrame(page, "frame_c")); + QTest::mouseClick(view.focusProxy(), Qt::LeftButton, {}, firstAnchorCenterInFrame(page, "frame_c")); QTRY_VERIFY(evaluateJavaScriptSync(page, "document.getElementsByName('frame_b')[0].contentDocument != undefined").toBool()); QTRY_VERIFY(action->isEnabled()); } @@ -1964,8 +1964,7 @@ void tst_QWebEnginePage::urlChange() QUrl testUrl("http://test.qt.io/"); m_view->setHtml(QStringLiteral("<h1>Test</h1"), testUrl); - QTRY_COMPARE(urlSpy.size(), 2); - QCOMPARE(urlSpy.takeFirst().value(0).toUrl(), QUrl("data:text/html;charset=UTF-8,%3Ch1%3ETest%3C%2Fh1")); + QTRY_COMPARE(urlSpy.size(), 1); QCOMPARE(urlSpy.takeFirst().value(0).toUrl(), testUrl); } @@ -2077,7 +2076,7 @@ void tst_QWebEnginePage::requestedUrlAfterSetAndLoadFailures() page.load(second); QTRY_COMPARE_WITH_TIMEOUT(spy.count(), 2, 20000); - QCOMPARE(page.url(), second); + QCOMPARE(page.url(), first); QCOMPARE(page.requestedUrl(), second); QVERIFY(!spy.at(1).first().toBool()); } @@ -2777,8 +2776,8 @@ void tst_QWebEnginePage::setUrlThenLoads() QCOMPARE(baseUrlSync(m_page), extractBaseUrl(urlToLoad1)); m_page->load(urlToLoad2); - QTRY_COMPARE(m_page->url(), urlToLoad2); - QTRY_COMPARE(m_page->requestedUrl(), urlToLoad2); + QCOMPARE(m_page->url(), urlToLoad1); + QCOMPARE(m_page->requestedUrl(), urlToLoad2); QCOMPARE(baseUrlSync(m_page), extractBaseUrl(urlToLoad1)); QTRY_COMPARE(startedSpy.count(), 3); diff --git a/tools/scripts/version_resolver.py b/tools/scripts/version_resolver.py index 034ed1928..4aec57051 100644 --- a/tools/scripts/version_resolver.py +++ b/tools/scripts/version_resolver.py @@ -38,8 +38,8 @@ import json import urllib2 import git_submodule as GitSubmodule -chromium_version = '78.0.3904.130' -chromium_branch = '3904' +chromium_version = '79.0.3945.139' +chromium_branch = '3945' ninja_version = 'v1.8.2' json_url = 'http://omahaproxy.appspot.com/all.json' |