summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-06-10 13:57:42 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-09-09 15:19:10 +0200
commit455619d3875e0e0e7a03734806d61c7998735cd4 (patch)
tree3e2558da4525819ad9bd5e46ee9f471c73aa8d5f /src
parentcd61343ceb4a3de8ce16082917a2f197b2481d08 (diff)
Adaptations for Chromium 83
Change-Id: I63ed851426b18623d549ceaf87f1b6eeec527966 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
Diffstat (limited to 'src')
m---------src/3rdparty0
-rw-r--r--src/buildtools/config/common.pri3
-rw-r--r--src/buildtools/config/mac_osx.pri1
-rw-r--r--src/buildtools/config/windows.pri7
-rw-r--r--src/core/api/qwebengineurlrequestinfo.cpp24
-rw-r--r--src/core/browser_accessibility_qt.cpp1
-rw-r--r--src/core/browser_main_parts_qt.cpp12
-rw-r--r--src/core/clipboard_qt.cpp6
-rw-r--r--src/core/clipboard_qt.h2
-rw-r--r--src/core/compositor/display_gl_output_surface.cpp18
-rw-r--r--src/core/compositor/display_gl_output_surface.h4
-rw-r--r--src/core/config/windows.pri3
-rw-r--r--src/core/content_browser_client_qt.cpp19
-rw-r--r--src/core/devtools_frontend_qt.cpp16
-rw-r--r--src/core/extensions/extensions_browser_client_qt.cpp2
-rw-r--r--src/core/extensions/extensions_browser_client_qt.h2
-rw-r--r--src/core/extensions/mime_handler_view_guest_delegate_qt.cpp2
-rw-r--r--src/core/net/cookie_monster_delegate_qt.cpp4
-rw-r--r--src/core/net/plugin_response_interceptor_url_loader_throttle.cpp1
-rw-r--r--src/core/net/proxy_config_service_qt.cpp4
-rw-r--r--src/core/net/proxying_url_loader_factory_qt.cpp28
-rw-r--r--src/core/ozone/gl_context_qt.cpp3
-rw-r--r--src/core/ozone/gl_ozone_egl_qt.cpp32
-rw-r--r--src/core/ozone/gl_ozone_egl_qt.h2
-rw-r--r--src/core/ozone/gl_surface_egl_qt.cpp3
-rw-r--r--src/core/ozone/gl_surface_qt.cpp11
-rw-r--r--src/core/ozone/surface_factory_qt.cpp4
-rw-r--r--src/core/permission_manager_qt.cpp1
-rw-r--r--src/core/printing/print_view_manager_base_qt.cpp2
-rw-r--r--src/core/printing/print_view_manager_qt.cpp2
-rw-r--r--src/core/profile_adapter.cpp2
-rw-r--r--src/core/render_widget_host_view_qt.cpp174
-rw-r--r--src/core/render_widget_host_view_qt.h3
-rw-r--r--src/core/touch_selection_controller_client_qt.h2
-rw-r--r--src/core/type_conversion.cpp18
-rw-r--r--src/core/type_conversion.h7
-rw-r--r--src/core/web_contents_adapter.cpp13
-rw-r--r--src/core/web_contents_delegate_qt.cpp14
-rw-r--r--src/core/web_contents_delegate_qt.h2
-rw-r--r--src/core/web_contents_view_qt.cpp2
-rw-r--r--src/core/web_contents_view_qt.h2
-rw-r--r--src/core/web_engine_context.cpp13
-rw-r--r--src/core/web_event_factory.cpp4
43 files changed, 254 insertions, 221 deletions
diff --git a/src/3rdparty b/src/3rdparty
-Subproject 62bc475876cbae17e2e39175fe321780512e595
+Subproject 5958153d4c472c038117a0cc927505e158fd3fd
diff --git a/src/buildtools/config/common.pri b/src/buildtools/config/common.pri
index c184024e8..85781d251 100644
--- a/src/buildtools/config/common.pri
+++ b/src/buildtools/config/common.pri
@@ -5,6 +5,7 @@ QT_FOR_CONFIG += buildtools-private webenginecore webenginecore-private
gn_args += \
use_qt=true \
+ init_stack_vars=false \
is_component_build=false \
is_shared=true \
enable_debugallocation=false \
@@ -62,6 +63,8 @@ CONFIG(release, debug|release):!qtConfig(webengine-developer-build) {
} else {
gn_args += is_official_build=false
!qtConfig(webengine-developer-build): gn_args += is_unsafe_developer_build=false
+ # Just doesn't work in many configurations:
+ gn_args += from_here_uses_location_builtins=false
}
CONFIG(release, debug|release) {
diff --git a/src/buildtools/config/mac_osx.pri b/src/buildtools/config/mac_osx.pri
index a93460784..b53f91706 100644
--- a/src/buildtools/config/mac_osx.pri
+++ b/src/buildtools/config/mac_osx.pri
@@ -34,6 +34,5 @@ gn_args += \
mac_deployment_target=\"$${QMAKE_MACOSX_DEPLOYMENT_TARGET}\" \
mac_sdk_min=\"$${QMAKE_MAC_SDK_VERSION_MAJOR_MINOR}\" \
use_external_popup_menu=false \
- init_stack_vars=false \
angle_enable_vulkan=false
diff --git a/src/buildtools/config/windows.pri b/src/buildtools/config/windows.pri
index c36534d19..bd236e1a5 100644
--- a/src/buildtools/config/windows.pri
+++ b/src/buildtools/config/windows.pri
@@ -7,7 +7,8 @@ gn_args += \
is_multi_dll_chrome=false \
win_linker_timing=true \
com_init_check_hook_disabled=true \
- heterogeneous_executables=true
+ heterogeneous_executables=true \
+ enable_vr=false
clang_cl {
clang_full_path = $$system_path($$which($${QMAKE_CXX}))
@@ -24,9 +25,6 @@ clang_cl {
}
qtConfig(webengine-developer-build) {
- gn_args += \
- is_win_fastlink=true
-
# Incremental linking doesn't work in release developer builds due to usage of /OPT:ICF
# by Chromium.
CONFIG(debug, debug|release) {
@@ -38,7 +36,6 @@ qtConfig(webengine-developer-build) {
}
} else {
gn_args += \
- is_win_fastlink=false \
use_incremental_linking=false
}
diff --git a/src/core/api/qwebengineurlrequestinfo.cpp b/src/core/api/qwebengineurlrequestinfo.cpp
index 5ed729f5e..040305f66 100644
--- a/src/core/api/qwebengineurlrequestinfo.cpp
+++ b/src/core/api/qwebengineurlrequestinfo.cpp
@@ -40,34 +40,10 @@
#include "qwebengineurlrequestinfo.h"
#include "qwebengineurlrequestinfo_p.h"
-#include "content/public/common/resource_type.h"
-
#include "web_contents_adapter_client.h"
QT_BEGIN_NAMESPACE
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeMainFrame, content::ResourceType::kMainFrame)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeSubFrame, content::ResourceType::kSubFrame)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeStylesheet, content::ResourceType::kStylesheet)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeScript, content::ResourceType::kScript)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeImage, content::ResourceType::kImage)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeFontResource, content::ResourceType::kFontResource)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeSubResource, content::ResourceType::kSubResource)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeObject, content::ResourceType::kObject)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeMedia, content::ResourceType::kMedia)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeWorker, content::ResourceType::kWorker)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeSharedWorker, content::ResourceType::kSharedWorker)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypePrefetch, content::ResourceType::kPrefetch)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeFavicon, content::ResourceType::kFavicon)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeXhr, content::ResourceType::kXhr)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypePing, content::ResourceType::kPing)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeServiceWorker, content::ResourceType::kServiceWorker)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeCspReport, content::ResourceType::kCspReport)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypePluginResource, content::ResourceType::kPluginResource)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeNavigationPreloadMainFrame, content::ResourceType::kNavigationPreloadMainFrame)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeNavigationPreloadSubFrame, content::ResourceType::kNavigationPreloadSubFrame)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeLast, content::ResourceType::kMaxValue)
-
ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::LinkNavigation, QWebEngineUrlRequestInfo::NavigationTypeLink)
ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::TypedNavigation, QWebEngineUrlRequestInfo::NavigationTypeTyped)
ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::FormSubmittedNavigation,
diff --git a/src/core/browser_accessibility_qt.cpp b/src/core/browser_accessibility_qt.cpp
index cf889961f..f4fe2f694 100644
--- a/src/core/browser_accessibility_qt.cpp
+++ b/src/core/browser_accessibility_qt.cpp
@@ -392,7 +392,6 @@ QAccessible::Role BrowserAccessibilityQt::role() const
return QAccessible::StaticText;
case ax::mojom::Role::kLayoutTable:
case ax::mojom::Role::kLayoutTableCell:
- case ax::mojom::Role::kLayoutTableColumn:
case ax::mojom::Role::kLayoutTableRow:
return QAccessible::Section;
case ax::mojom::Role::kLegend:
diff --git a/src/core/browser_main_parts_qt.cpp b/src/core/browser_main_parts_qt.cpp
index 785c52507..c1f4cbb2d 100644
--- a/src/core/browser_main_parts_qt.cpp
+++ b/src/core/browser_main_parts_qt.cpp
@@ -204,19 +204,15 @@ private:
{
ScopedGLContextChecker glContextChecker;
- bool more_work_is_plausible = m_delegate->DoWork();
+ base::MessagePump::Delegate::NextWorkInfo more_work_info = m_delegate->DoWork();
- base::TimeTicks delayed_work_time;
- more_work_is_plausible |= m_delegate->DoDelayedWork(&delayed_work_time);
-
- if (more_work_is_plausible)
+ if (more_work_info.is_immediate())
return ScheduleWork();
- more_work_is_plausible |= m_delegate->DoIdleWork();
- if (more_work_is_plausible)
+ if (m_delegate->DoIdleWork())
return ScheduleWork();
- ScheduleDelayedWork(delayed_work_time);
+ ScheduleDelayedWork(more_work_info.delayed_run_time);
}
Delegate *m_delegate = nullptr;
diff --git a/src/core/clipboard_qt.cpp b/src/core/clipboard_qt.cpp
index f9bc0bc74..a1dba8150 100644
--- a/src/core/clipboard_qt.cpp
+++ b/src/core/clipboard_qt.cpp
@@ -268,12 +268,12 @@ void ClipboardQt::ReadRTF(ui::ClipboardBuffer type, std::string *result) const
*result = std::string(byteArray.constData(), byteArray.length());
}
-SkBitmap ClipboardQt::ReadImage(ui::ClipboardBuffer type) const
+void ClipboardQt::ReadImage(ui::ClipboardBuffer type, ReadImageCallback callback) const
{
const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(
type == ui::ClipboardBuffer::kCopyPaste ? QClipboard::Clipboard : QClipboard::Selection);
if (!mimeData)
- return SkBitmap();
+ return std::move(callback).Run(SkBitmap());
QImage image = qvariant_cast<QImage>(mimeData->imageData());
image = image.convertToFormat(QImage::Format_ARGB32);
@@ -291,7 +291,7 @@ SkBitmap ClipboardQt::ReadImage(ui::ClipboardBuffer type) const
src += bytesPerLineSrc;
}
- return bitmap;
+ return std::move(callback).Run(bitmap);
}
void ClipboardQt::ReadCustomData(ui::ClipboardBuffer clipboard_type, const base::string16 &type, base::string16 *result) const
diff --git a/src/core/clipboard_qt.h b/src/core/clipboard_qt.h
index 034f40863..cc1b95a32 100644
--- a/src/core/clipboard_qt.h
+++ b/src/core/clipboard_qt.h
@@ -56,7 +56,7 @@ public:
void ReadHTML(ui::ClipboardBuffer type, base::string16 *markup, std::string *src_url, uint32_t *fragment_start,
uint32_t *fragment_end) const override;
void ReadRTF(ui::ClipboardBuffer type, std::string *result) const override;
- SkBitmap ReadImage(ui::ClipboardBuffer type) const override;
+ void ReadImage(ui::ClipboardBuffer buffer, ReadImageCallback callback) const override;
void ReadCustomData(ui::ClipboardBuffer clipboard_type, const base::string16 &type, base::string16 *result) const override;
void ReadBookmark(base::string16 *title, std::string *url) const override;
void ReadData(const ui::ClipboardFormatType &format, std::string *result) const override;
diff --git a/src/core/compositor/display_gl_output_surface.cpp b/src/core/compositor/display_gl_output_surface.cpp
index 139015938..a75daf222 100644
--- a/src/core/compositor/display_gl_output_surface.cpp
+++ b/src/core/compositor/display_gl_output_surface.cpp
@@ -47,6 +47,7 @@
#include "gpu/command_buffer/service/mailbox_manager.h"
#include "gpu/command_buffer/service/texture_base.h"
#include "gpu/ipc/in_process_command_buffer.h"
+#include "ui/gfx/buffer_format_util.h"
namespace QtWebEngineCore {
@@ -110,9 +111,10 @@ void DisplayGLOutputSurface::DiscardBackbuffer()
void DisplayGLOutputSurface::Reshape(const gfx::Size &sizeInPixels,
float devicePixelRatio,
const gfx::ColorSpace &colorSpace,
- bool hasAlpha,
+ gfx::BufferFormat format,
bool /*useStencil*/)
{
+ bool hasAlpha = gfx::AlphaBitsForBufferFormat(format) > 0;
m_currentShape = Shape{sizeInPixels, devicePixelRatio, colorSpace, hasAlpha};
m_gl->ResizeCHROMIUM(sizeInPixels.width(), sizeInPixels.height(), devicePixelRatio,
colorSpace.AsGLColorSpace(), hasAlpha);
@@ -246,13 +248,6 @@ unsigned DisplayGLOutputSurface::GetOverlayTextureId() const
return 0;
}
-// Only used if IsDisplayedAsOverlayPlane was true (called from
-// viz::DirectRender::DrawFrame).
-gfx::BufferFormat DisplayGLOutputSurface::GetOverlayBufferFormat() const
-{
- return gfx::BufferFormat();
-}
-
// Called by viz::GLRenderer but always false in all implementations except for
// android_webview::ParentOutputSurface.
bool DisplayGLOutputSurface::HasExternalStencilTest() const
@@ -282,7 +277,12 @@ unsigned DisplayGLOutputSurface::UpdateGpuFence()
scoped_refptr<gpu::GpuTaskSchedulerHelper> DisplayGLOutputSurface::GetGpuTaskSchedulerHelper()
{
- return nullptr;
+ return m_vizContextProvider->GetGpuTaskSchedulerHelper();
+}
+
+gpu::MemoryTracker *DisplayGLOutputSurface::GetMemoryTracker()
+{
+ return m_vizContextProvider->GetMemoryTracker();
}
void DisplayGLOutputSurface::SetUpdateVSyncParametersCallback(viz::UpdateVSyncParametersCallback callback)
diff --git a/src/core/compositor/display_gl_output_surface.h b/src/core/compositor/display_gl_output_surface.h
index 3755a294f..c9c9343ae 100644
--- a/src/core/compositor/display_gl_output_surface.h
+++ b/src/core/compositor/display_gl_output_surface.h
@@ -72,11 +72,10 @@ public:
void SetDrawRectangle(const gfx::Rect &drawRect) override;
bool IsDisplayedAsOverlayPlane() const override;
unsigned GetOverlayTextureId() const override;
- gfx::BufferFormat GetOverlayBufferFormat() const override;
void Reshape(const gfx::Size &size,
float devicePixelRatio,
const gfx::ColorSpace &colorSpace,
- bool hasAlpha,
+ gfx::BufferFormat format,
bool useStencil) override;
bool HasExternalStencilTest() const override;
void ApplyExternalStencil() override;
@@ -87,6 +86,7 @@ public:
void SetDisplayTransformHint(gfx::OverlayTransform transform) override;
gfx::OverlayTransform GetDisplayTransform() override;
scoped_refptr<gpu::GpuTaskSchedulerHelper> GetGpuTaskSchedulerHelper() override;
+ gpu::MemoryTracker *GetMemoryTracker() override;
// Overridden from DisplayProducer.
QSGNode *updatePaintNode(QSGNode *oldNode, RenderWidgetHostViewQtDelegate *delegate) override;
diff --git a/src/core/config/windows.pri b/src/core/config/windows.pri
index 9543daf90..732a61e28 100644
--- a/src/core/config/windows.pri
+++ b/src/core/config/windows.pri
@@ -6,3 +6,6 @@ qtConfig(build-qtwebengine-core):qtConfig(webengine-spellchecker) {
} else {
gn_args += use_browser_spellchecker=false
}
+
+# Avoid conflicting vulkan.h headers
+gn_args += enable_vulkan=false
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp
index f50878ae4..d3181c555 100644
--- a/src/core/content_browser_client_qt.cpp
+++ b/src/core/content_browser_client_qt.cpp
@@ -90,7 +90,6 @@
#include "extensions/buildflags/buildflags.h"
#include "extensions/browser/extension_protocols.h"
#include "extensions/browser/guest_view/web_view/web_view_guest.h"
-#include "extensions/browser/url_loader_factory_manager.h"
#include "mojo/public/cpp/bindings/binding.h"
#include "mojo/public/cpp/bindings/binding_set.h"
#include "mojo/public/cpp/bindings/remote.h"
@@ -172,6 +171,7 @@
#include "content/public/browser/file_url_loader.h"
#include "extensions/browser/extension_message_filter.h"
#include "extensions/browser/guest_view/extensions_guest_view_message_filter.h"
+#include "extensions/browser/url_loader_factory_manager.h"
#include "extensions/common/constants.h"
#include "common/extensions/extensions_client_qt.h"
@@ -573,7 +573,6 @@ public:
if (!web_contents)
return;
CreateForWebContents(web_contents);
-
}
static ServiceDriver* FromRenderFrameHost(content::RenderFrameHost *renderFrameHost)
{
@@ -582,17 +581,17 @@ public:
return nullptr;
return FromWebContents(web_contents);
}
- static void BindInsecureInputService(blink::mojom::InsecureInputServiceRequest request, content::RenderFrameHost *render_frame_host)
+ static void BindInsecureInputService(content::RenderFrameHost *render_frame_host, mojo::PendingReceiver<blink::mojom::InsecureInputService> receiver)
{
CreateForRenderFrameHost(render_frame_host);
ServiceDriver *driver = FromRenderFrameHost(render_frame_host);
if (driver)
- driver->BindInsecureInputServiceRequest(std::move(request));
+ driver->BindInsecureInputServiceReceiver(std::move(receiver));
}
- void BindInsecureInputServiceRequest(blink::mojom::InsecureInputServiceRequest request)
+ void BindInsecureInputServiceReceiver(mojo::PendingReceiver<blink::mojom::InsecureInputService> receiver)
{
- m_insecureInputServiceBindings.AddBinding(this, std::move(request));
+ m_receivers.Add(this, std::move(receiver));
}
// blink::mojom::InsecureInputService:
@@ -603,7 +602,7 @@ private:
WEB_CONTENTS_USER_DATA_KEY_DECL();
explicit ServiceDriver(content::WebContents* /*web_contents*/) { }
friend class content::WebContentsUserData<ServiceDriver>;
- mojo::BindingSet<blink::mojom::InsecureInputService> m_insecureInputServiceBindings;
+ mojo::ReceiverSet<blink::mojom::InsecureInputService> m_receivers;
};
WEB_CONTENTS_USER_DATA_KEY_IMPL(ServiceDriver)
@@ -612,7 +611,6 @@ void ContentBrowserClientQt::InitFrameInterfaces()
{
m_frameInterfaces = std::make_unique<service_manager::BinderRegistry>();
m_frameInterfacesParameterized = std::make_unique<service_manager::BinderRegistryWithArgs<content::RenderFrameHost*>>();
- m_frameInterfacesParameterized->AddInterface(base::BindRepeating(&ServiceDriver::BindInsecureInputService));
}
void ContentBrowserClientQt::BindInterfaceRequestFromFrame(content::RenderFrameHost* render_frame_host,
@@ -648,6 +646,7 @@ void ContentBrowserClientQt::RegisterBrowserInterfaceBindersForFrame(
service_manager::BinderMapWithContext<content::RenderFrameHost *> *map)
{
Q_UNUSED(render_frame_host);
+ map->Add<blink::mojom::InsecureInputService>(base::BindRepeating(&ServiceDriver::BindInsecureInputService));
map->Add<network_hints::mojom::NetworkHintsHandler>(base::BindRepeating(&BindNetworkHintsHandler));
}
@@ -662,8 +661,8 @@ void BindProcessNode(int render_process_host_id,
performance_manager::RenderProcessUserData *user_data =
performance_manager::RenderProcessUserData::GetForRenderProcessHost(render_process_host);
- DCHECK(performance_manager::PerformanceManagerImpl::GetInstance());
- performance_manager::PerformanceManagerImpl::GetTaskRunner()->PostTask(
+ DCHECK(performance_manager::PerformanceManagerImpl::IsAvailable());
+ performance_manager::PerformanceManagerImpl::CallOnGraphImpl(
FROM_HERE, base::BindOnce(&performance_manager::ProcessNodeImpl::Bind,
base::Unretained(user_data->process_node()),
std::move(receiver)));
diff --git a/src/core/devtools_frontend_qt.cpp b/src/core/devtools_frontend_qt.cpp
index fb79a09e6..810c91b94 100644
--- a/src/core/devtools_frontend_qt.cpp
+++ b/src/core/devtools_frontend_qt.cpp
@@ -487,6 +487,22 @@ void DevToolsFrontendQt::HandleMessageFromDevToolsFrontend(const std::string &me
} else if (method == "reattach") {
m_agentHost->DetachClient(this);
m_agentHost->AttachClient(this);
+ } else if (method == "inspectedURLChanged" && params && params->GetSize() >= 1) {
+ std::string url;
+ if (!params->GetString(0, &url))
+ return;
+ const std::string kHttpPrefix = "http://";
+ const std::string kHttpsPrefix = "https://";
+ const std::string simplified_url =
+ base::StartsWith(url, kHttpsPrefix, base::CompareCase::SENSITIVE)
+ ? url.substr(kHttpsPrefix.length())
+ : base::StartsWith(url, kHttpPrefix, base::CompareCase::SENSITIVE)
+ ? url.substr(kHttpPrefix.length())
+ : url;
+ // DevTools UI is not localized.
+ web_contents()->UpdateTitleForEntry(web_contents()->GetController().GetActiveEntry(),
+ base::UTF8ToUTF16(
+ base::StringPrintf("DevTools - %s", simplified_url.c_str())));
} else if (method == "openInNewTab") {
std::string urlString;
if (!params->GetString(0, &urlString))
diff --git a/src/core/extensions/extensions_browser_client_qt.cpp b/src/core/extensions/extensions_browser_client_qt.cpp
index 08ce07da8..b285aadd8 100644
--- a/src/core/extensions/extensions_browser_client_qt.cpp
+++ b/src/core/extensions/extensions_browser_client_qt.cpp
@@ -377,7 +377,7 @@ void ExtensionsBrowserClientQt::LoadResourceFromResourceBundle(const network::Re
bool ExtensionsBrowserClientQt::AllowCrossRendererResourceLoad(const GURL &url,
- content::ResourceType resource_type,
+ blink::mojom::ResourceType resource_type,
ui::PageTransition page_transition,
int child_id,
bool is_incognito,
diff --git a/src/core/extensions/extensions_browser_client_qt.h b/src/core/extensions/extensions_browser_client_qt.h
index f57165fcf..b7f944635 100644
--- a/src/core/extensions/extensions_browser_client_qt.h
+++ b/src/core/extensions/extensions_browser_client_qt.h
@@ -76,7 +76,7 @@ public:
bool IsExtensionIncognitoEnabled(const std::string &extension_id, content::BrowserContext *context) const override;
bool CanExtensionCrossIncognito(const Extension *extension, content::BrowserContext *context) const override;
bool AllowCrossRendererResourceLoad(const GURL &url,
- content::ResourceType resource_type,
+ blink::mojom::ResourceType resource_type,
ui::PageTransition page_transition,
int child_id,
bool is_incognito,
diff --git a/src/core/extensions/mime_handler_view_guest_delegate_qt.cpp b/src/core/extensions/mime_handler_view_guest_delegate_qt.cpp
index 022bc7db6..58f4f209a 100644
--- a/src/core/extensions/mime_handler_view_guest_delegate_qt.cpp
+++ b/src/core/extensions/mime_handler_view_guest_delegate_qt.cpp
@@ -46,8 +46,8 @@
#include "content/browser/browser_plugin/browser_plugin_guest.h"
#include "content/browser/web_contents/web_contents_impl.h"
+#include "content/public/browser/context_menu_params.h"
#include "content/public/browser/web_contents.h"
-#include "content/public/common/context_menu_params.h"
#include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h"
namespace extensions {
diff --git a/src/core/net/cookie_monster_delegate_qt.cpp b/src/core/net/cookie_monster_delegate_qt.cpp
index 263973684..a7a3a9348 100644
--- a/src/core/net/cookie_monster_delegate_qt.cpp
+++ b/src/core/net/cookie_monster_delegate_qt.cpp
@@ -78,9 +78,9 @@ public:
CookieAccessFilter(CookieMonsterDelegateQt *delegate) : m_delegate(delegate) { }
~CookieAccessFilter() override = default;
- void AllowedAccess(const GURL& url, const GURL& site_for_cookies, AllowedAccessCallback callback) override
+ void AllowedAccess(const GURL &url, const net::SiteForCookies &site_for_cookies, AllowedAccessCallback callback) override
{
- bool allow = m_delegate->canGetCookies(toQt(site_for_cookies), toQt(url));
+ bool allow = m_delegate->canGetCookies(toQt(site_for_cookies.RepresentativeUrl()), toQt(url));
std::move(callback).Run(allow);
}
diff --git a/src/core/net/plugin_response_interceptor_url_loader_throttle.cpp b/src/core/net/plugin_response_interceptor_url_loader_throttle.cpp
index 4fdb8c3d0..4641717f7 100644
--- a/src/core/net/plugin_response_interceptor_url_loader_throttle.cpp
+++ b/src/core/net/plugin_response_interceptor_url_loader_throttle.cpp
@@ -46,7 +46,6 @@
#include "content/public/browser/download_manager.h"
#include "content/public/browser/download_request_utils.h"
#include "content/public/browser/download_utils.h"
-#include "content/public/common/resource_type.h"
#include "extensions/common/constants.h"
#include "extensions/common/extension.h"
diff --git a/src/core/net/proxy_config_service_qt.cpp b/src/core/net/proxy_config_service_qt.cpp
index 59884961d..bc934c960 100644
--- a/src/core/net/proxy_config_service_qt.cpp
+++ b/src/core/net/proxy_config_service_qt.cpp
@@ -48,7 +48,7 @@
#include "base/bind.h"
#include "components/proxy_config/pref_proxy_config_tracker_impl.h"
#include "content/public/browser/browser_thread.h"
-#include "net/proxy_resolution/proxy_resolution_service.h"
+#include "net/proxy_resolution/configured_proxy_resolution_service.h"
using content::BrowserThread;
@@ -72,7 +72,7 @@ net::ProxyServer ProxyConfigServiceQt::fromQNetworkProxy(const QNetworkProxy &qt
ProxyConfigServiceQt::ProxyConfigServiceQt(PrefService *prefService,
const scoped_refptr<base::SingleThreadTaskRunner> &taskRunner)
- : m_baseService(net::ProxyResolutionService::CreateSystemProxyConfigService(taskRunner))
+ : m_baseService(net::ConfiguredProxyResolutionService::CreateSystemProxyConfigService(taskRunner))
, m_usesSystemConfiguration(false)
, m_registeredObserver(false)
, m_prefState(prefService
diff --git a/src/core/net/proxying_url_loader_factory_qt.cpp b/src/core/net/proxying_url_loader_factory_qt.cpp
index cf0b0fb7e..d63659d2d 100644
--- a/src/core/net/proxying_url_loader_factory_qt.cpp
+++ b/src/core/net/proxying_url_loader_factory_qt.cpp
@@ -72,11 +72,33 @@
namespace QtWebEngineCore {
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeMainFrame, blink::mojom::ResourceType::kMainFrame)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeSubFrame, blink::mojom::ResourceType::kSubFrame)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeStylesheet, blink::mojom::ResourceType::kStylesheet)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeScript, blink::mojom::ResourceType::kScript)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeImage, blink::mojom::ResourceType::kImage)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeFontResource, blink::mojom::ResourceType::kFontResource)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeSubResource, blink::mojom::ResourceType::kSubResource)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeObject, blink::mojom::ResourceType::kObject)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeMedia, blink::mojom::ResourceType::kMedia)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeWorker, blink::mojom::ResourceType::kWorker)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeSharedWorker, blink::mojom::ResourceType::kSharedWorker)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypePrefetch, blink::mojom::ResourceType::kPrefetch)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeFavicon, blink::mojom::ResourceType::kFavicon)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeXhr, blink::mojom::ResourceType::kXhr)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypePing, blink::mojom::ResourceType::kPing)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeServiceWorker, blink::mojom::ResourceType::kServiceWorker)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeCspReport, blink::mojom::ResourceType::kCspReport)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypePluginResource, blink::mojom::ResourceType::kPluginResource)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeNavigationPreloadMainFrame, blink::mojom::ResourceType::kNavigationPreloadMainFrame)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeNavigationPreloadSubFrame, blink::mojom::ResourceType::kNavigationPreloadSubFrame)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeLast, blink::mojom::ResourceType::kMaxValue)
+
extern WebContentsAdapterClient::NavigationType pageTransitionToNavigationType(ui::PageTransition transition);
-static QWebEngineUrlRequestInfo::ResourceType toQt(content::ResourceType resourceType)
+static QWebEngineUrlRequestInfo::ResourceType toQt(blink::mojom::ResourceType resourceType)
{
- if (resourceType >= content::ResourceType::kMainFrame && resourceType <= content::ResourceType::kMaxValue)
+ if (resourceType >= blink::mojom::ResourceType::kMinValue && resourceType <= blink::mojom::ResourceType::kMaxValue)
return static_cast<QWebEngineUrlRequestInfo::ResourceType>(resourceType);
return QWebEngineUrlRequestInfo::ResourceTypeUnknown;
}
@@ -204,7 +226,7 @@ InterceptedRequest::~InterceptedRequest()
void InterceptedRequest::Restart()
{
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- content::ResourceType resourceType = content::ResourceType(request_.resource_type);
+ blink::mojom::ResourceType resourceType = blink::mojom::ResourceType(request_.resource_type);
WebContentsAdapterClient::NavigationType navigationType =
pageTransitionToNavigationType(ui::PageTransition(request_.transition_type));
diff --git a/src/core/ozone/gl_context_qt.cpp b/src/core/ozone/gl_context_qt.cpp
index 10347bdc7..9a24f6bf4 100644
--- a/src/core/ozone/gl_context_qt.cpp
+++ b/src/core/ozone/gl_context_qt.cpp
@@ -123,7 +123,8 @@ void* GLContextHelper::getEGLConfig()
void* GLContextHelper::getGlXConfig()
{
- return resourceForContext(QByteArrayLiteral("glxconfig"));
+ QByteArray resource = QByteArrayLiteral("glxconfig");
+ return resourceForContext(resource);
}
void* GLContextHelper::getEGLDisplay()
diff --git a/src/core/ozone/gl_ozone_egl_qt.cpp b/src/core/ozone/gl_ozone_egl_qt.cpp
index c692920cf..c33570d44 100644
--- a/src/core/ozone/gl_ozone_egl_qt.cpp
+++ b/src/core/ozone/gl_ozone_egl_qt.cpp
@@ -38,13 +38,21 @@
****************************************************************************/
#if defined(USE_OZONE)
-#include "gl_ozone_egl_qt.h"
+#include <QtCore/qobject.h>
+#include <QtGui/qtgui-config.h>
+
+#if QT_CONFIG(opengl)
+#include <QOpenGLContext>
+QT_BEGIN_NAMESPACE
+Q_GUI_EXPORT QOpenGLContext *qt_gl_global_share_context();
+QT_END_NAMESPACE
+#endif
+
#include "gl_context_qt.h"
+#include "gl_ozone_egl_qt.h"
#include "gl_surface_egl_qt.h"
#include "base/files/file_path.h"
#include "base/native_library.h"
-#include "gl_context_qt.h"
-#include "gl_ozone_egl_qt.h"
#include "ui/gl/gl_context_egl.h"
#include "ui/gl/gl_implementation.h"
#include "ui/gl/gl_surface.h"
@@ -55,15 +63,6 @@
#include <EGL/egl.h>
#include <dlfcn.h>
-#include <QtGui/qtgui-config.h>
-
-#if QT_CONFIG(opengl)
-#include <QOpenGLContext>
-QT_BEGIN_NAMESPACE
-Q_GUI_EXPORT QOpenGLContext *qt_gl_global_share_context();
-QT_END_NAMESPACE
-#endif
-
namespace ui {
base::NativeLibrary LoadLibrary(const base::FilePath& filename) {
@@ -142,14 +141,11 @@ scoped_refptr<gl::GLSurface> GLOzoneEGLQt::CreateOffscreenGLSurface(const gfx::S
return nullptr;
}
-intptr_t GLOzoneEGLQt::GetNativeDisplay()
+gl::EGLDisplayPlatform GLOzoneEGLQt::GetNativeDisplay()
{
static void *display = GLContextHelper::getNativeDisplay();
-
- if (display)
- return reinterpret_cast<intptr_t>(display);
-
- return reinterpret_cast<intptr_t>(EGL_DEFAULT_DISPLAY);
+ static gl::EGLDisplayPlatform platform(display ? reinterpret_cast<intptr_t>(display) : EGL_DEFAULT_DISPLAY);
+ return platform;
}
} // namespace ui
diff --git a/src/core/ozone/gl_ozone_egl_qt.h b/src/core/ozone/gl_ozone_egl_qt.h
index c24d03a81..c55ba232c 100644
--- a/src/core/ozone/gl_ozone_egl_qt.h
+++ b/src/core/ozone/gl_ozone_egl_qt.h
@@ -58,7 +58,7 @@ public:
protected:
// Returns native platform display handle. This is used to obtain the EGL
// display connection for the native display.
- intptr_t GetNativeDisplay() override;
+ gl::EGLDisplayPlatform GetNativeDisplay() override;
// Sets up GL bindings for the native surface.
bool LoadGLES2Bindings(gl::GLImplementation implementation) override;
diff --git a/src/core/ozone/gl_surface_egl_qt.cpp b/src/core/ozone/gl_surface_egl_qt.cpp
index 31126eab9..8e8e66f63 100644
--- a/src/core/ozone/gl_surface_egl_qt.cpp
+++ b/src/core/ozone/gl_surface_egl_qt.cpp
@@ -194,8 +194,7 @@ bool GLSurfaceEGL::HasEGLExtension(const char* name)
{
return ExtensionsContain(GetEGLExtensions(), name);
}
-
-bool GLSurfaceEGL::InitializeOneOff(EGLNativeDisplayType /*native_display*/)
+bool GLSurfaceEGL::InitializeOneOff(gl::EGLDisplayPlatform /*native_display*/)
{
return GLSurfaceEGLQt::InitializeOneOff();
}
diff --git a/src/core/ozone/gl_surface_qt.cpp b/src/core/ozone/gl_surface_qt.cpp
index 4be17f12b..90f486532 100644
--- a/src/core/ozone/gl_surface_qt.cpp
+++ b/src/core/ozone/gl_surface_qt.cpp
@@ -243,6 +243,17 @@ bool DirectCompositionSurfaceWin::IsSwapChainTearingSupported()
{
return false;
}
+
+bool DirectCompositionSurfaceWin::AreOverlaysSupported()
+{
+ return false;
+}
+
+UINT DirectCompositionSurfaceWin::GetOverlaySupportFlags(DXGI_FORMAT format)
+{
+ Q_UNUSED(format);
+ return 0;
+}
} // namespace gl
#endif
#endif // !defined(OS_MACOSX)
diff --git a/src/core/ozone/surface_factory_qt.cpp b/src/core/ozone/surface_factory_qt.cpp
index 5420b4809..533a97abc 100644
--- a/src/core/ozone/surface_factory_qt.cpp
+++ b/src/core/ozone/surface_factory_qt.cpp
@@ -45,18 +45,16 @@
#endif
#include "ui/gl/gl_surface.h"
-#include <QGuiApplication>
#if defined(USE_OZONE)
-
#include "ozone/gl_ozone_egl_qt.h"
#include "ozone/surface_factory_qt.h"
#include "ui/gl/gl_surface.h"
+
namespace QtWebEngineCore {
SurfaceFactoryQt::SurfaceFactoryQt()
{
- Q_ASSERT(qApp);
#if defined(USE_GLX)
if (GLContextHelper::getGlXConfig()) {
m_impl = gl::kGLImplementationDesktopGL;
diff --git a/src/core/permission_manager_qt.cpp b/src/core/permission_manager_qt.cpp
index 5c33ca702..a1b481946 100644
--- a/src/core/permission_manager_qt.cpp
+++ b/src/core/permission_manager_qt.cpp
@@ -85,6 +85,7 @@ static ProfileAdapter::PermissionType toQt(content::PermissionType type)
case content::PermissionType::NFC:
case content::PermissionType::AR:
case content::PermissionType::VR:
+ case content::PermissionType::STORAGE_ACCESS_GRANT:
case content::PermissionType::NUM:
LOG(INFO) << "Unsupported permission type: " << static_cast<int>(type);
break;
diff --git a/src/core/printing/print_view_manager_base_qt.cpp b/src/core/printing/print_view_manager_base_qt.cpp
index 34c86e506..a6c478037 100644
--- a/src/core/printing/print_view_manager_base_qt.cpp
+++ b/src/core/printing/print_view_manager_base_qt.cpp
@@ -127,7 +127,7 @@ void PrintViewManagerBaseQt::PrintDocument(printing::PrintedDocument *document,
{
std::unique_ptr<printing::MetafileSkia> metafile =
std::make_unique<printing::MetafileSkia>();
- CHECK(metafile->InitFromData(print_data->front(), print_data->size()));
+ CHECK(metafile->InitFromData(*print_data));
// Update the rendered document. It will send notifications to the listener.
document->SetDocument(std::move(metafile), page_size, content_area);
diff --git a/src/core/printing/print_view_manager_qt.cpp b/src/core/printing/print_view_manager_qt.cpp
index 3a42f2c41..df7fcc0fc 100644
--- a/src/core/printing/print_view_manager_qt.cpp
+++ b/src/core/printing/print_view_manager_qt.cpp
@@ -102,7 +102,7 @@ static void SavePdfFile(scoped_refptr<base::RefCountedBytes> data,
DCHECK_GT(data->size(), 0U);
printing::MetafileSkia metafile;
- metafile.InitFromData(static_cast<const void*>(data->front()), data->size());
+ metafile.InitFromData(base::as_bytes(base::make_span(data->front(), data->size())));
base::File file(path,
base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE);
diff --git a/src/core/profile_adapter.cpp b/src/core/profile_adapter.cpp
index c436c8277..b0b48af03 100644
--- a/src/core/profile_adapter.cpp
+++ b/src/core/profile_adapter.cpp
@@ -323,7 +323,7 @@ void ProfileAdapter::setHttpUserAgent(const QString &userAgent)
std::vector<content::WebContentsImpl *> list = content::WebContentsImpl::GetAllWebContents();
for (content::WebContentsImpl *web_contents : list)
if (web_contents->GetBrowserContext() == m_profile.data())
- web_contents->SetUserAgentOverride(stdUserAgent, true);
+ web_contents->SetUserAgentOverride(blink::UserAgentOverride::UserAgentOnly(stdUserAgent), true);
content::BrowserContext::ForEachStoragePartition(
m_profile.get(), base::BindRepeating([](const std::string &user_agent, content::StoragePartition *storage_partition) {
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
index ef5eaaab6..525e9924e 100644
--- a/src/core/render_widget_host_view_qt.cpp
+++ b/src/core/render_widget_host_view_qt.cpp
@@ -69,7 +69,7 @@
#include "content/common/cursors/webcursor.h"
#include "content/common/input_messages.h"
#include "third_party/skia/include/core/SkColor.h"
-#include "third_party/blink/public/platform/web_cursor_info.h"
+#include "ui/base/cursor/cursor.h"
#include "ui/events/blink/blink_event_util.h"
#include "ui/events/event.h"
#include "ui/events/gesture_detection/gesture_configuration.h"
@@ -83,7 +83,7 @@
#endif
#if defined(USE_AURA)
-#include "ui/base/cursor/cursor.h"
+#include "ui/base/cursor/cursor_size.h"
#include "ui/base/cursor/cursors_aura.h"
#include "ui/base/resource/resource_bundle.h"
#endif
@@ -281,15 +281,14 @@ public:
FlingingCompositor(RenderWidgetHostViewQt *rwhv,
const viz::FrameSinkId &frame_sink_id,
ui::ContextFactory *context_factory,
- ui::ContextFactoryPrivate *context_factory_private,
scoped_refptr<base::SingleThreadTaskRunner> task_runner,
bool enable_pixel_canvas,
bool use_external_begin_frame_control = false,
- bool force_software_compositor = false,
- const char *trace_environment_name = nullptr)
- : ui::Compositor(frame_sink_id, context_factory, context_factory_private,
- task_runner, enable_pixel_canvas, use_external_begin_frame_control,
- force_software_compositor, trace_environment_name)
+ bool force_software_compositor = false)
+ : ui::Compositor(frame_sink_id, context_factory,
+ task_runner, enable_pixel_canvas,
+ use_external_begin_frame_control,
+ force_software_compositor)
, m_rwhv(rwhv)
{}
@@ -338,12 +337,10 @@ RenderWidgetHostViewQt::RenderWidgetHostViewQt(content::RenderWidgetHost *widget
content::ImageTransportFactory *imageTransportFactory = content::ImageTransportFactory::GetInstance();
ui::ContextFactory *contextFactory = imageTransportFactory->GetContextFactory();
- ui::ContextFactoryPrivate *contextFactoryPrivate = imageTransportFactory->GetContextFactoryPrivate();
m_uiCompositor.reset(new FlingingCompositor(
this,
- contextFactoryPrivate->AllocateFrameSinkId(),
+ contextFactory->AllocateFrameSinkId(),
contextFactory,
- contextFactoryPrivate,
m_taskRunner,
false /* enable_pixel_canvas */));
m_uiCompositor->SetAcceleratedWidget(gfx::kNullAcceleratedWidget); // null means offscreen
@@ -526,17 +523,30 @@ void RenderWidgetHostViewQt::UpdateBackgroundColor()
m_uiCompositor->SetBackgroundColor(color);
content::RenderViewHost *rvh = content::RenderViewHost::From(host());
- host()->Send(new RenderViewObserverQt_SetBackgroundColor(rvh->GetRoutingID(), color));
+ if (color == SK_ColorTRANSPARENT)
+ host()->owner_delegate()->SetBackgroundOpaque(false);
+ else
+ host()->Send(new RenderViewObserverQt_SetBackgroundColor(rvh->GetRoutingID(), color));
}
// Return value indicates whether the mouse is locked successfully or not.
-bool RenderWidgetHostViewQt::LockMouse(bool)
+blink::mojom::PointerLockResult RenderWidgetHostViewQt::LockMouse(bool request_unadjusted_movement)
{
+ if (request_unadjusted_movement)
+ return blink::mojom::PointerLockResult::kUnsupportedOptions;
+
m_previousMousePosition = QCursor::pos();
m_delegate->lockMouse();
m_isMouseLocked = true;
qApp->setOverrideCursor(Qt::BlankCursor);
- return true;
+ return blink::mojom::PointerLockResult::kSuccess;
+}
+
+blink::mojom::PointerLockResult RenderWidgetHostViewQt::ChangeMouseLock(bool request_unadjusted_movement)
+{
+ if (request_unadjusted_movement)
+ return blink::mojom::PointerLockResult::kUnsupportedOptions;
+ return blink::mojom::PointerLockResult::kSuccess;
}
void RenderWidgetHostViewQt::UnlockMouse()
@@ -554,134 +564,134 @@ void RenderWidgetHostViewQt::UpdateCursor(const content::WebCursor &webCursor)
void RenderWidgetHostViewQt::DisplayCursor(const content::WebCursor &webCursor)
{
- const content::CursorInfo &cursorInfo = webCursor.info();
+ const ui::Cursor &cursorInfo = webCursor.cursor();
Qt::CursorShape shape = Qt::ArrowCursor;
#if defined(USE_AURA)
- ui::CursorType auraType = ui::CursorType::kNull;
+ ui::mojom::CursorType auraType = ui::mojom::CursorType::kNull;
#endif
- switch (cursorInfo.type) {
- case ui::CursorType::kNull:
- case ui::CursorType::kPointer:
+ switch (cursorInfo.type()) {
+ case ui::mojom::CursorType::kNull:
+ case ui::mojom::CursorType::kPointer:
shape = Qt::ArrowCursor;
break;
- case ui::CursorType::kCross:
+ case ui::mojom::CursorType::kCross:
shape = Qt::CrossCursor;
break;
- case ui::CursorType::kHand:
+ case ui::mojom::CursorType::kHand:
shape = Qt::PointingHandCursor;
break;
- case ui::CursorType::kIBeam:
+ case ui::mojom::CursorType::kIBeam:
shape = Qt::IBeamCursor;
break;
- case ui::CursorType::kWait:
+ case ui::mojom::CursorType::kWait:
shape = Qt::WaitCursor;
break;
- case ui::CursorType::kHelp:
+ case ui::mojom::CursorType::kHelp:
shape = Qt::WhatsThisCursor;
break;
- case ui::CursorType::kEastResize:
- case ui::CursorType::kWestResize:
- case ui::CursorType::kEastWestResize:
- case ui::CursorType::kEastPanning:
- case ui::CursorType::kWestPanning:
- case ui::CursorType::kMiddlePanningHorizontal:
+ case ui::mojom::CursorType::kEastResize:
+ case ui::mojom::CursorType::kWestResize:
+ case ui::mojom::CursorType::kEastWestResize:
+ case ui::mojom::CursorType::kEastPanning:
+ case ui::mojom::CursorType::kWestPanning:
+ case ui::mojom::CursorType::kMiddlePanningHorizontal:
shape = Qt::SizeHorCursor;
break;
- case ui::CursorType::kNorthResize:
- case ui::CursorType::kSouthResize:
- case ui::CursorType::kNorthSouthResize:
- case ui::CursorType::kNorthPanning:
- case ui::CursorType::kSouthPanning:
- case ui::CursorType::kMiddlePanningVertical:
+ case ui::mojom::CursorType::kNorthResize:
+ case ui::mojom::CursorType::kSouthResize:
+ case ui::mojom::CursorType::kNorthSouthResize:
+ case ui::mojom::CursorType::kNorthPanning:
+ case ui::mojom::CursorType::kSouthPanning:
+ case ui::mojom::CursorType::kMiddlePanningVertical:
shape = Qt::SizeVerCursor;
break;
- case ui::CursorType::kNorthEastResize:
- case ui::CursorType::kSouthWestResize:
- case ui::CursorType::kNorthEastSouthWestResize:
- case ui::CursorType::kNorthEastPanning:
- case ui::CursorType::kSouthWestPanning:
+ case ui::mojom::CursorType::kNorthEastResize:
+ case ui::mojom::CursorType::kSouthWestResize:
+ case ui::mojom::CursorType::kNorthEastSouthWestResize:
+ case ui::mojom::CursorType::kNorthEastPanning:
+ case ui::mojom::CursorType::kSouthWestPanning:
shape = Qt::SizeBDiagCursor;
break;
- case ui::CursorType::kNorthWestResize:
- case ui::CursorType::kSouthEastResize:
- case ui::CursorType::kNorthWestSouthEastResize:
- case ui::CursorType::kNorthWestPanning:
- case ui::CursorType::kSouthEastPanning:
+ case ui::mojom::CursorType::kNorthWestResize:
+ case ui::mojom::CursorType::kSouthEastResize:
+ case ui::mojom::CursorType::kNorthWestSouthEastResize:
+ case ui::mojom::CursorType::kNorthWestPanning:
+ case ui::mojom::CursorType::kSouthEastPanning:
shape = Qt::SizeFDiagCursor;
break;
- case ui::CursorType::kColumnResize:
+ case ui::mojom::CursorType::kColumnResize:
shape = Qt::SplitHCursor;
break;
- case ui::CursorType::kRowResize:
+ case ui::mojom::CursorType::kRowResize:
shape = Qt::SplitVCursor;
break;
- case ui::CursorType::kMiddlePanning:
- case ui::CursorType::kMove:
+ case ui::mojom::CursorType::kMiddlePanning:
+ case ui::mojom::CursorType::kMove:
shape = Qt::SizeAllCursor;
break;
- case ui::CursorType::kProgress:
+ case ui::mojom::CursorType::kProgress:
shape = Qt::BusyCursor;
break;
- case ui::CursorType::kDndNone:
- case ui::CursorType::kDndMove:
+ case ui::mojom::CursorType::kDndNone:
+ case ui::mojom::CursorType::kDndMove:
shape = Qt::DragMoveCursor;
break;
- case ui::CursorType::kDndCopy:
- case ui::CursorType::kCopy:
+ case ui::mojom::CursorType::kDndCopy:
+ case ui::mojom::CursorType::kCopy:
shape = Qt::DragCopyCursor;
break;
- case ui::CursorType::kDndLink:
- case ui::CursorType::kAlias:
+ case ui::mojom::CursorType::kDndLink:
+ case ui::mojom::CursorType::kAlias:
shape = Qt::DragLinkCursor;
break;
#if defined(USE_AURA)
- case ui::CursorType::kVerticalText:
- auraType = ui::CursorType::kVerticalText;
+ case ui::mojom::CursorType::kVerticalText:
+ auraType = ui::mojom::CursorType::kVerticalText;
break;
- case ui::CursorType::kCell:
- auraType = ui::CursorType::kCell;
+ case ui::mojom::CursorType::kCell:
+ auraType = ui::mojom::CursorType::kCell;
break;
- case ui::CursorType::kContextMenu:
- auraType = ui::CursorType::kContextMenu;
+ case ui::mojom::CursorType::kContextMenu:
+ auraType = ui::mojom::CursorType::kContextMenu;
break;
- case ui::CursorType::kZoomIn:
- auraType = ui::CursorType::kZoomIn;
+ case ui::mojom::CursorType::kZoomIn:
+ auraType = ui::mojom::CursorType::kZoomIn;
break;
- case ui::CursorType::kZoomOut:
- auraType = ui::CursorType::kZoomOut;
+ case ui::mojom::CursorType::kZoomOut:
+ auraType = ui::mojom::CursorType::kZoomOut;
break;
#else
- case ui::CursorType::kVerticalText:
- case ui::CursorType::kCell:
- case ui::CursorType::kContextMenu:
- case ui::CursorType::kZoomIn:
- case ui::CursorType::kZoomOut:
+ case ui::mojom::CursorType::kVerticalText:
+ case ui::mojom::CursorType::kCell:
+ case ui::mojom::CursorType::kContextMenu:
+ case ui::mojom::CursorType::kZoomIn:
+ case ui::mojom::CursorType::kZoomOut:
// FIXME: Support on OS X
break;
#endif
- case ui::CursorType::kNoDrop:
- case ui::CursorType::kNotAllowed:
+ case ui::mojom::CursorType::kNoDrop:
+ case ui::mojom::CursorType::kNotAllowed:
shape = Qt::ForbiddenCursor;
break;
- case ui::CursorType::kNone:
+ case ui::mojom::CursorType::kNone:
shape = Qt::BlankCursor;
break;
- case ui::CursorType::kGrab:
+ case ui::mojom::CursorType::kGrab:
shape = Qt::OpenHandCursor;
break;
- case ui::CursorType::kGrabbing:
+ case ui::mojom::CursorType::kGrabbing:
shape = Qt::ClosedHandCursor;
break;
- case ui::CursorType::kCustom:
- if (cursorInfo.custom_image.colorType() == SkColorType::kN32_SkColorType) {
- QImage cursor = toQImage(cursorInfo.custom_image, QImage::Format_ARGB32);
- m_delegate->updateCursor(QCursor(QPixmap::fromImage(cursor), cursorInfo.hotspot.x(), cursorInfo.hotspot.y()));
+ case ui::mojom::CursorType::kCustom:
+ if (cursorInfo.custom_bitmap().colorType() == SkColorType::kN32_SkColorType) {
+ QImage cursor = toQImage(cursorInfo.custom_bitmap(), QImage::Format_ARGB32);
+ m_delegate->updateCursor(QCursor(QPixmap::fromImage(cursor), cursorInfo.custom_hotspot().x(), cursorInfo.custom_hotspot().y()));
return;
}
break;
}
#if defined(USE_AURA)
- if (auraType != ui::CursorType::kNull) {
+ if (auraType != ui::mojom::CursorType::kNull) {
int resourceId;
gfx::Point hotspot;
// GetCursorDataFor only knows hotspots for 1x and 2x cursor images, in physical pixels.
diff --git a/src/core/render_widget_host_view_qt.h b/src/core/render_widget_host_view_qt.h
index 5bddd0d34..18ea8b9c2 100644
--- a/src/core/render_widget_host_view_qt.h
+++ b/src/core/render_widget_host_view_qt.h
@@ -141,7 +141,8 @@ public:
bool IsShowing() override;
gfx::Rect GetViewBounds() override;
void UpdateBackgroundColor() override;
- bool LockMouse(bool) override;
+ blink::mojom::PointerLockResult LockMouse(bool) override;
+ blink::mojom::PointerLockResult ChangeMouseLock(bool) override;
void UnlockMouse() override;
void UpdateCursor(const content::WebCursor&) override;
void DisplayCursor(const content::WebCursor&) override;
diff --git a/src/core/touch_selection_controller_client_qt.h b/src/core/touch_selection_controller_client_qt.h
index 0d8dcf696..aadf72172 100644
--- a/src/core/touch_selection_controller_client_qt.h
+++ b/src/core/touch_selection_controller_client_qt.h
@@ -40,8 +40,8 @@
#ifndef TOUCH_SELECTION_CONTROLLER_CLIENT_QT_H
#define TOUCH_SELECTION_CONTROLLER_CLIENT_QT_H
+#include "content/public/browser/context_menu_params.h"
#include "content/public/browser/touch_selection_controller_client_manager.h"
-#include "content/public/common/context_menu_params.h"
#include "ui/touch_selection/touch_selection_controller.h"
#include "ui/touch_selection/touch_selection_menu_runner.h"
diff --git a/src/core/type_conversion.cpp b/src/core/type_conversion.cpp
index 403125784..1d8d63257 100644
--- a/src/core/type_conversion.cpp
+++ b/src/core/type_conversion.cpp
@@ -39,11 +39,11 @@
#include "type_conversion.h"
-#include <content/public/common/favicon_url.h>
#include <net/cert/x509_certificate.h>
#include <net/cert/x509_util.h>
#include <ui/events/event_constants.h>
#include <ui/gfx/image/image_skia.h>
+#include "third_party/blink/public/mojom/favicon/favicon_url.mojom.h"
#include <QtCore/qcoreapplication.h>
#include <QtGui/qmatrix4x4.h>
@@ -242,27 +242,27 @@ int flagsFromModifiers(Qt::KeyboardModifiers modifiers)
return modifierFlags;
}
-FaviconInfo::FaviconTypeFlags toQt(content::FaviconURL::IconType type)
+FaviconInfo::FaviconTypeFlags toQt(blink::mojom::FaviconIconType type)
{
switch (type) {
- case content::FaviconURL::IconType::kFavicon:
+ case blink::mojom::FaviconIconType::kFavicon:
return FaviconInfo::Favicon;
- case content::FaviconURL::IconType::kTouchIcon:
+ case blink::mojom::FaviconIconType::kTouchIcon:
return FaviconInfo::TouchIcon;
- case content::FaviconURL::IconType::kTouchPrecomposedIcon:
+ case blink::mojom::FaviconIconType::kTouchPrecomposedIcon:
return FaviconInfo::TouchPrecomposedIcon;
- case content::FaviconURL::IconType::kInvalid:
+ case blink::mojom::FaviconIconType::kInvalid:
return FaviconInfo::InvalidIcon;
}
Q_UNREACHABLE();
return FaviconInfo::InvalidIcon;
}
-FaviconInfo toFaviconInfo(const content::FaviconURL &favicon_url)
+FaviconInfo toFaviconInfo(const blink::mojom::FaviconURLPtr &favicon_url)
{
FaviconInfo info;
- info.url = toQt(favicon_url.icon_url);
- info.type = toQt(favicon_url.icon_type);
+ info.url = toQt(favicon_url->icon_url);
+ info.type = toQt(favicon_url->icon_type);
// TODO: Add support for rel sizes attribute (favicon_url.icon_sizes):
// http://www.w3schools.com/tags/att_link_sizes.asp
info.size = QSize(0, 0);
diff --git a/src/core/type_conversion.h b/src/core/type_conversion.h
index 2275ae82e..83a499284 100644
--- a/src/core/type_conversion.h
+++ b/src/core/type_conversion.h
@@ -55,6 +55,7 @@
#include "content/public/common/file_chooser_file_info.h"
#include "favicon_manager.h"
#include "net/cookies/canonical_cookie.h"
+#include "third_party/blink/public/mojom/favicon/favicon_url.mojom-forward.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/core/SkPixelRef.h"
@@ -66,10 +67,6 @@
QT_FORWARD_DECLARE_CLASS(QMatrix4x4)
QT_FORWARD_DECLARE_CLASS(QSslCertificate)
-namespace content {
-struct FaviconURL;
-}
-
namespace gfx {
class ImageSkiaRep;
}
@@ -294,7 +291,7 @@ inline QStringList fromVector(const std::vector<base::string16> &vector)
return result;
}
-FaviconInfo toFaviconInfo(const content::FaviconURL &);
+FaviconInfo toFaviconInfo(const blink::mojom::FaviconURLPtr &favicon_url);
QList<QSslCertificate> toCertificateChain(net::X509Certificate *certificate);
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index e3b1c2439..a44b3316e 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -242,7 +242,6 @@ static void callbackOnPdfSavingFinished(WebContentsAdapterClient *adapterClient,
static std::unique_ptr<content::WebContents> createBlankWebContents(WebContentsAdapterClient *adapterClient, content::BrowserContext *browserContext)
{
content::WebContents::CreateParams create_params(browserContext, nullptr);
- create_params.routing_id = MSG_ROUTING_NONE;
create_params.initially_hidden = true;
std::unique_ptr<content::WebContents> webContents = content::WebContents::Create(create_params);
@@ -557,7 +556,7 @@ void WebContentsAdapter::initializeRenderPrefs()
const int qtCursorFlashTime = QGuiApplication::styleHints()->cursorFlashTime();
rendererPrefs->caret_blink_interval =
base::TimeDelta::FromMillisecondsD(0.5 * static_cast<double>(qtCursorFlashTime));
- rendererPrefs->user_agent_override = m_profileAdapter->httpUserAgent().toStdString();
+ rendererPrefs->user_agent_override = blink::UserAgentOverride::UserAgentOnly(m_profileAdapter->httpUserAgent().toStdString());
rendererPrefs->accept_languages = m_profileAdapter->httpAcceptLanguageWithoutQualities().toStdString();
#if QT_CONFIG(webengine_webrtc)
base::CommandLine* commandLine = base::CommandLine::ForCurrentProcess();
@@ -1398,7 +1397,8 @@ void WebContentsAdapter::grantMouseLockPermission(const QUrl &securityOrigin, bo
granted = false;
}
- m_webContents->GotResponseToLockMouseRequest(granted);
+ m_webContents->GotResponseToLockMouseRequest(granted ? blink::mojom::PointerLockResult::kSuccess
+ : blink::mojom::PointerLockResult::kPermissionDenied);
}
void WebContentsAdapter::handlePendingMouseLockPermission()
@@ -1406,7 +1406,8 @@ void WebContentsAdapter::handlePendingMouseLockPermission()
CHECK_INITIALIZED();
auto it = m_pendingMouseLockPermissions.find(toQt(m_webContents->GetLastCommittedURL().GetOrigin()));
if (it != m_pendingMouseLockPermissions.end()) {
- m_webContents->GotResponseToLockMouseRequest(it.value());
+ m_webContents->GotResponseToLockMouseRequest(it.value() ? blink::mojom::PointerLockResult::kSuccess
+ : blink::mojom::PointerLockResult::kPermissionDenied);
m_pendingMouseLockPermissions.erase(it);
}
}
@@ -1671,7 +1672,7 @@ void WebContentsAdapter::waitForUpdateDragActionCalled()
DCHECK(delegate);
m_updateDragActionCalled = false;
for (;;) {
- while (delegate->DoWork() && !m_updateDragActionCalled) {}
+ while (delegate->DoWork().is_immediate() && !m_updateDragActionCalled) {}
if (m_updateDragActionCalled)
break;
if (t.hasExpired(timeout)) {
@@ -2045,7 +2046,7 @@ ASSERT_ENUMS_MATCH(ReferrerPolicy::NoReferrerWhenDowngrade, network::mojom::Refe
ASSERT_ENUMS_MATCH(ReferrerPolicy::Never, network::mojom::ReferrerPolicy::kNever)
ASSERT_ENUMS_MATCH(ReferrerPolicy::Origin, network::mojom::ReferrerPolicy::kOrigin)
ASSERT_ENUMS_MATCH(ReferrerPolicy::OriginWhenCrossOrigin, network::mojom::ReferrerPolicy::kOriginWhenCrossOrigin)
-ASSERT_ENUMS_MATCH(ReferrerPolicy::NoReferrerWhenDowngradeOriginWhenCrossOrigin, network::mojom::ReferrerPolicy::kNoReferrerWhenDowngradeOriginWhenCrossOrigin)
+//ASSERT_ENUMS_MATCH(ReferrerPolicy::NoReferrerWhenDowngradeOriginWhenCrossOrigin, network::mojom::ReferrerPolicy::kNoReferrerWhenDowngradeOriginWhenCrossOrigin)
ASSERT_ENUMS_MATCH(ReferrerPolicy::SameOrigin, network::mojom::ReferrerPolicy::kSameOrigin)
ASSERT_ENUMS_MATCH(ReferrerPolicy::StrictOrigin, network::mojom::ReferrerPolicy::kStrictOrigin)
ASSERT_ENUMS_MATCH(ReferrerPolicy::Last, network::mojom::ReferrerPolicy::kLast)
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index e75a461e2..d5a3934fe 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -62,6 +62,8 @@
#include "web_engine_settings.h"
#include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h"
+#include "components/error_page/common/error.h"
+#include "components/error_page/common/localized_error.h"
#include "components/web_cache/browser/web_cache_manager.h"
#include "content/browser/frame_host/render_frame_host_impl.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
@@ -75,7 +77,6 @@
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
-#include "content/public/common/favicon_url.h"
#include "content/public/common/frame_navigate_params.h"
#include "content/public/common/url_constants.h"
#include "content/public/common/web_preferences.h"
@@ -239,7 +240,9 @@ void WebContentsDelegateQt::AddNewContents(content::WebContents* source, std::un
// so set it here. Note the actual value doesn't really matter here. Only the second value does, but we try
// to give the correct user-agent anyway.
if (newAdapter)
- newAdapter->webContents()->SetUserAgentOverride(newAdapter->profileAdapter()->httpUserAgent().toStdString(), true);
+ newAdapter->webContents()->SetUserAgentOverride(
+ blink::UserAgentOverride::UserAgentOnly(newAdapter->profileAdapter()->httpUserAgent().toStdString()),
+ true);
if (newAdapter && !newAdapter->isInitialized())
newAdapter->loadDefault();
if (was_blocked)
@@ -514,11 +517,12 @@ void WebContentsDelegateQt::DidFinishLoad(content::RenderFrameHost* render_frame
EmitLoadFinished(true /* success */ , toQt(validated_url), false /* isErrorPage */, http_statuscode);
}
-void WebContentsDelegateQt::DidUpdateFaviconURL(const std::vector<content::FaviconURL> &candidates)
+void WebContentsDelegateQt::DidUpdateFaviconURL(const std::vector<blink::mojom::FaviconURLPtr> &candidates)
+
{
QList<FaviconInfo> faviconCandidates;
faviconCandidates.reserve(static_cast<int>(candidates.size()));
- for (const content::FaviconURL &candidate : candidates) {
+ for (const blink::mojom::FaviconURLPtr &candidate : candidates) {
// Store invalid candidates too for later debugging via API
faviconCandidates.append(toFaviconInfo(candidate));
}
@@ -659,7 +663,7 @@ void WebContentsDelegateQt::RequestToLockMouse(content::WebContents *web_content
Q_UNUSED(user_gesture);
if (last_unlocked_by_target)
- web_contents->GotResponseToLockMouseRequest(true);
+ web_contents->GotResponseToLockMouseRequest(blink::mojom::PointerLockResult::kSuccess);
else
m_viewClient->runMouseLockPermissionRequest(toQt(web_contents->GetLastCommittedURL().GetOrigin()));
}
diff --git a/src/core/web_contents_delegate_qt.h b/src/core/web_contents_delegate_qt.h
index bce02df4f..159803840 100644
--- a/src/core/web_contents_delegate_qt.h
+++ b/src/core/web_contents_delegate_qt.h
@@ -164,7 +164,7 @@ public:
void DidFailLoad(content::RenderFrameHost* render_frame_host, const GURL& validated_url, int error_code) override;
void DidFinishLoad(content::RenderFrameHost *render_frame_host, const GURL &validated_url) override;
void BeforeUnloadFired(bool proceed, const base::TimeTicks& proceed_time) override;
- void DidUpdateFaviconURL(const std::vector<content::FaviconURL> &candidates) override;
+ void DidUpdateFaviconURL(const std::vector<blink::mojom::FaviconURLPtr> &candidates) override;
void OnVisibilityChanged(content::Visibility visibility) override;
void DidFirstVisuallyNonEmptyPaint() override;
void ActivateContents(content::WebContents* contents) override;
diff --git a/src/core/web_contents_view_qt.cpp b/src/core/web_contents_view_qt.cpp
index 7f6bfe34f..4e20c86ea 100644
--- a/src/core/web_contents_view_qt.cpp
+++ b/src/core/web_contents_view_qt.cpp
@@ -55,8 +55,8 @@
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/web_contents/web_contents_impl.h"
+#include "content/public/browser/context_menu_params.h"
#include "content/public/browser/web_contents_delegate.h"
-#include "content/public/common/context_menu_params.h"
#include "third_party/blink/public/common/context_menu_data/edit_flags.h"
#include "third_party/blink/public/common/context_menu_data/media_type.h"
#include "ui/gfx/image/image_skia.h"
diff --git a/src/core/web_contents_view_qt.h b/src/core/web_contents_view_qt.h
index 3dcb648bf..3c89bf3b0 100644
--- a/src/core/web_contents_view_qt.h
+++ b/src/core/web_contents_view_qt.h
@@ -78,8 +78,6 @@ public:
void SetPageTitle(const base::string16& title) override { }
- void RenderViewCreated(content::RenderViewHost* host) override { }
-
void RenderViewReady() override { }
void RenderViewHostChanged(content::RenderViewHost*, content::RenderViewHost*) override { }
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 410ada37a..c7add160b 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -44,6 +44,8 @@
#include "base/base_switches.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
+#include "base/power_monitor/power_monitor.h"
+#include "base/power_monitor/power_monitor_device_source.h"
#include "base/run_loop.h"
#include "base/task/post_task.h"
#include "base/task/sequence_manager/thread_controller_with_message_pump_impl.h"
@@ -94,6 +96,7 @@
#include "services/tracing/public/cpp/trace_startup.h"
#include "services/tracing/public/cpp/tracing_features.h"
#include "third_party/blink/public/common/features.h"
+#include "ui/base/ui_base_features.h"
#include "ui/events/event_switches.h"
#include "ui/native_theme/native_theme_features.h"
#include "ui/gl/gl_switches.h"
@@ -362,12 +365,12 @@ void WebEngineContext::destroy()
// task runner is not working anymore so we need to do this earlier.
cleanupVizProcess();
while (waitForViz) {
- while (delegate->DoWork()){}
+ while (delegate->DoWork().is_immediate()) { }
QThread::msleep(50);
}
destroyGpuProcess();
// Flush the UI message loop before quitting.
- while (delegate->DoWork()) { }
+ while (delegate->DoWork().is_immediate()) { }
#if QT_CONFIG(webengine_printing_and_pdf)
// Kill print job manager early as it has a content::NotificationRegistrar
@@ -389,7 +392,7 @@ void WebEngineContext::destroy()
// Handle any events posted by browser-context shutdown.
// This should deliver all nessesery calls of DeleteSoon from PostTask
- while (delegate->DoWork()) { }
+ while (delegate->DoWork().is_immediate()) { }
m_devtoolsServer.reset();
m_runLoop->AfterRun();
@@ -652,6 +655,9 @@ WebEngineContext::WebEngineContext()
appendToFeatureList(disableFeatures, features::kWebUsb.name);
appendToFeatureList(disableFeatures, media::kPictureInPicture.name);
+ // Breaks current colordialog tests.
+ appendToFeatureList(disableFeatures, features::kFormControlsRefresh.name);
+
if (useEmbeddedSwitches) {
// embedded switches are based on the switches for Android, see content/browser/android/content_startup_flags.cc
appendToFeatureList(enableFeatures, features::kOverlayScrollbar.name);
@@ -774,6 +780,7 @@ WebEngineContext::WebEngineContext()
content::BrowserTaskExecutor::PostFeatureListSetup();
tracing::InitTracingPostThreadPoolStartAndFeatureList();
m_discardableSharedMemoryManager = std::make_unique<discardable_memory::DiscardableSharedMemoryManager>();
+ base::PowerMonitor::Initialize(std::make_unique<base::PowerMonitorDeviceSource>());
m_serviceManagerEnvironment = std::make_unique<content::ServiceManagerEnvironment>(content::BrowserTaskExecutor::CreateIOThread());
m_startupData = m_serviceManagerEnvironment->CreateBrowserStartupData();
diff --git a/src/core/web_event_factory.cpp b/src/core/web_event_factory.cpp
index 7bc905bbf..08f0bf2c6 100644
--- a/src/core/web_event_factory.cpp
+++ b/src/core/web_event_factory.cpp
@@ -1586,7 +1586,7 @@ blink::WebMouseWheelEvent WebEventFactory::toWebWheelEvent(QWheelEvent *ev)
#if defined(Q_OS_DARWIN)
// 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;
+ webEvent.delta_units = ui::ScrollGranularity::kScrollByPrecisePixel;
#endif
setBlinkWheelEventDelta(webEvent);
@@ -1603,7 +1603,7 @@ bool WebEventFactory::coalesceWebWheelEvent(blink::WebMouseWheelEvent &webEvent,
if (toBlinkPhase(ev) != webEvent.phase)
return false;
#if defined(Q_OS_DARWIN)
- if ((webEvent.delta_units == ui::input_types::ScrollGranularity::kScrollByPrecisePixel)
+ if ((webEvent.delta_units == ui::ScrollGranularity::kScrollByPrecisePixel)
!= (ev->source() == Qt::MouseEventSynthesizedBySystem))
return false;
#endif