summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2023-08-11 10:38:24 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2023-12-09 19:53:11 +0100
commit66804e89073700b3f05e42515d738a5906a30ae9 (patch)
treef1207c84dc0afb23c54bbdc145cf1fb7ff11098c /src/core
parent8ec6e351ceb7fa82424a1f755f14072934692478 (diff)
Chromium 114 adaptations
Change-Id: I1131b2873f82d954ca47bf90bc82200d5f4cd751 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/CMakeLists.txt14
-rw-r--r--src/core/api/qwebengineglobalsettings.cpp4
-rw-r--r--src/core/autofill_client_qt.cpp12
-rw-r--r--src/core/autofill_client_qt.h10
-rw-r--r--src/core/browser_main_parts_qt.cpp6
-rw-r--r--src/core/clipboard_qt.cpp5
-rw-r--r--src/core/clipboard_qt.h1
-rw-r--r--src/core/compositor/display_skia_output_device.cpp25
-rw-r--r--src/core/compositor/display_skia_output_device.h14
-rw-r--r--src/core/compositor/native_skia_output_device.cpp35
-rw-r--r--src/core/compositor/native_skia_output_device.h14
-rw-r--r--src/core/configure/BUILD.root.gn.in2
-rw-r--r--src/core/extensions/extension_system_qt.cpp56
-rw-r--r--src/core/extensions/extension_system_qt.h14
-rw-r--r--src/core/favicon_service_factory_qt.cpp2
-rw-r--r--src/core/favicon_service_factory_qt.h2
-rw-r--r--src/core/location_provider_qt.cpp42
-rw-r--r--src/core/location_provider_qt.h6
-rw-r--r--src/core/login_delegate_qt.cpp13
-rw-r--r--src/core/net/client_cert_qt.cpp1
-rw-r--r--src/core/net/ssl_host_state_delegate_qt.cpp11
-rw-r--r--src/core/net/ssl_host_state_delegate_qt.h2
-rw-r--r--src/core/permission_manager_qt.cpp9
-rw-r--r--src/core/permission_manager_qt.h2
-rw-r--r--src/core/printing/print_view_manager_base_qt.cpp34
-rw-r--r--src/core/printing/print_view_manager_base_qt.h3
-rw-r--r--src/core/render_widget_host_view_qt.cpp1
-rw-r--r--src/core/renderer/extensions/resource_request_policy_qt.cpp9
-rw-r--r--src/core/version_ui_qt.cpp3
-rw-r--r--src/core/web_contents_adapter.cpp3
30 files changed, 152 insertions, 203 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 28715f33e..8e54fcef0 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -303,6 +303,7 @@ foreach(arch ${archs})
list(APPEND gnArgArg
qtwebengine_target="${buildDir}/${config}/${arch}:QtWebEngineCore"
+ build_dawn_tests=false
build_with_tflite_lib=false
enable_background_contents=false
enable_background_mode=false
@@ -322,8 +323,6 @@ foreach(arch ${archs})
enable_swiftshader_vulkan=false
angle_enable_swiftshader=false
dawn_use_swiftshader=false
- use_dawn=false
- build_dawn_tests=false
enable_vr=false
enable_web_speech=false
enable_widevine=true
@@ -331,16 +330,17 @@ foreach(arch ${archs})
fatal_linker_warnings=false
has_native_accessibility=false
safe_browsing_mode=0
- skia_use_dawn=false
toolkit_views=false
chrome_pgo_phase=0
optimize_webui=false
strip_absolute_paths_from_debug_symbols=false
pdf_use_skia=true
+ use_dawn=false
+ skia_use_dawn=false
devtools_fast_bundle=false
devtools_skip_typecheck=false
use_static_angle=true
- chrome_root_store_supported=false
+ use_perfetto_client_library=false
trial_comparison_cert_verifier_supported=false
)
extend_gn_list(gnArgArg
@@ -413,7 +413,6 @@ foreach(arch ${archs})
use_qt=false # Qt5 toolkit bindings
use_cups=false
use_gio=false
- use_gnome_keyring=false
use_bundled_fontconfig=false
use_glib=false
use_bluez=false
@@ -524,11 +523,6 @@ foreach(arch ${archs})
)
endif()
- if(NOT CLANG)
- list(APPEND gnArgArg
- enable_location_source=false)
- endif()
-
if(WIN32)
list(APPEND gnArgArg
ninja_use_custom_environment_files=false
diff --git a/src/core/api/qwebengineglobalsettings.cpp b/src/core/api/qwebengineglobalsettings.cpp
index 5eeff9fc5..d79a5d9e5 100644
--- a/src/core/api/qwebengineglobalsettings.cpp
+++ b/src/core/api/qwebengineglobalsettings.cpp
@@ -9,7 +9,6 @@
#undef signals
#endif
-#include "content/browser/network_service_instance_impl.h"
#include "content/public/browser/network_service_instance.h"
#include "services/network/network_service.h"
@@ -122,8 +121,7 @@ QWebEngineGlobalSettingsPrivate *QWebEngineGlobalSettingsPrivate::instance()
void QWebEngineGlobalSettingsPrivate::configureStubHostResolver()
{
- if (content::GetNetworkServiceAvailability()
- != content::NetworkServiceAvailability::NOT_CREATED) {
+ if (content::IsNetworkServiceCreated()) {
network::mojom::NetworkService *networkService = content::GetNetworkService();
if (networkService) {
qDebug() << "doh set to" << dnsOverHttpsTemplates << " -- "
diff --git a/src/core/autofill_client_qt.cpp b/src/core/autofill_client_qt.cpp
index c7becd605..1b51d5fbf 100644
--- a/src/core/autofill_client_qt.cpp
+++ b/src/core/autofill_client_qt.cpp
@@ -17,8 +17,16 @@
namespace QtWebEngineCore {
+void AutofillClientQt::CreateForWebContents(content::WebContents *contents)
+{
+ DCHECK(contents);
+ if (!FromWebContents(contents))
+ contents->SetUserData(UserDataKey(), base::WrapUnique(new AutofillClientQt(contents)));
+}
+
AutofillClientQt::AutofillClientQt(content::WebContents *webContents)
- : content::WebContentsUserData<AutofillClientQt>(*webContents)
+ : autofill::ContentAutofillClient(
+ webContents, base::BindRepeating(&autofill::BrowserDriverInitHook, this, ""))
, content::WebContentsObserver(webContents)
, m_popupController(new AutofillPopupController(new AutofillPopupControllerPrivate))
{
@@ -133,6 +141,4 @@ WebContentsAdapterClient *AutofillClientQt::adapterClient()
->client();
}
-WEB_CONTENTS_USER_DATA_KEY_IMPL(AutofillClientQt);
-
} // namespace QtWebEngineCore
diff --git a/src/core/autofill_client_qt.h b/src/core/autofill_client_qt.h
index 46e40f1da..c40b21e16 100644
--- a/src/core/autofill_client_qt.h
+++ b/src/core/autofill_client_qt.h
@@ -19,7 +19,7 @@
#include <vector>
#include "base/memory/weak_ptr.h"
-#include "components/autofill/core/browser/autofill_client.h"
+#include "components/autofill/content/browser/content_autofill_client.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_contents_user_data.h"
@@ -30,13 +30,14 @@ namespace QtWebEngineCore {
class AutofillPopupController;
class WebContentsAdapterClient;
-class AutofillClientQt : public autofill::AutofillClient,
- public content::WebContentsUserData<AutofillClientQt>,
+class AutofillClientQt : public autofill::ContentAutofillClient,
public content::WebContentsObserver
{
public:
~AutofillClientQt() override;
+ static void CreateForWebContents(content::WebContents *contents);
+
// autofill::AutofillClient overrides:
autofill::PersonalDataManager *GetPersonalDataManager() override;
autofill::AutocompleteHistoryManager *GetAutocompleteHistoryManager() override;
@@ -65,9 +66,6 @@ private:
WebContentsAdapterClient *adapterClient();
QScopedPointer<AutofillPopupController> m_popupController;
-
- WEB_CONTENTS_USER_DATA_KEY_DECL();
- friend class content::WebContentsUserData<AutofillClientQt>;
};
} // namespace QtWebEngineCore
diff --git a/src/core/browser_main_parts_qt.cpp b/src/core/browser_main_parts_qt.cpp
index a61319d36..c7d9ebd70 100644
--- a/src/core/browser_main_parts_qt.cpp
+++ b/src/core/browser_main_parts_qt.cpp
@@ -73,8 +73,8 @@
#endif
#if defined(Q_OS_LINUX)
-#include "components/os_crypt/key_storage_config_linux.h"
-#include "components/os_crypt/os_crypt.h"
+#include "components/os_crypt/sync/key_storage_config_linux.h"
+#include "components/os_crypt/sync/os_crypt.h"
#endif
namespace QtWebEngineCore {
@@ -220,7 +220,7 @@ void BrowserMainPartsQt::PostCreateMainMessageLoop()
device_event_log::Initialize(0 /* default max entries */);
#if defined(Q_OS_LINUX)
- std::unique_ptr<os_crypt::Config> config = std::make_unique<os_crypt::Config>();
+ auto config = std::make_unique<os_crypt::Config>();
config->product_name = "Qt WebEngine";
config->main_thread_runner = content::GetUIThreadTaskRunner({});
config->should_use_preference = false;
diff --git a/src/core/clipboard_qt.cpp b/src/core/clipboard_qt.cpp
index fe56a5db1..e6a0a10be 100644
--- a/src/core/clipboard_qt.cpp
+++ b/src/core/clipboard_qt.cpp
@@ -420,6 +420,11 @@ void ClipboardQt::WriteFilenames(std::vector<ui::FileInfo> filenames)
getUncommittedData()->setUrls(urls);
}
+void ClipboardQt::WriteUnsanitizedHTML(const char *markup_data, size_t markup_len, const char *url_data, size_t url_len)
+{
+ WriteHTML(markup_data, markup_len, url_data, url_len);
+}
+
#if defined(USE_OZONE)
bool ClipboardQt::IsSelectionBufferAvailable() const
{
diff --git a/src/core/clipboard_qt.h b/src/core/clipboard_qt.h
index 0351112e6..302e7a00e 100644
--- a/src/core/clipboard_qt.h
+++ b/src/core/clipboard_qt.h
@@ -56,6 +56,7 @@ protected:
void WriteData(const ui::ClipboardFormatType &format, const char *data_data, size_t data_len) override;
void WriteSvg(const char *, size_t) override;
void WriteFilenames(std::vector<ui::FileInfo> filenames) override;
+ void WriteUnsanitizedHTML(const char*, size_t, const char*, size_t) override;
base::flat_map<ui::ClipboardBuffer, std::unique_ptr<ui::DataTransferEndpoint>> m_dataSrc;
};
diff --git a/src/core/compositor/display_skia_output_device.cpp b/src/core/compositor/display_skia_output_device.cpp
index d46154f7e..9b87b4b01 100644
--- a/src/core/compositor/display_skia_output_device.cpp
+++ b/src/core/compositor/display_skia_output_device.cpp
@@ -47,11 +47,11 @@ public:
}
void initialize()
{
- const auto &colorType = m_shape.characterization.colorType();
+ const auto &colorType = m_shape.imageInfo.colorType();
DCHECK(colorType != kUnknown_SkColorType);
m_texture = m_parent->m_contextState->gr_context()->createBackendTexture(
- m_shape.characterization.width(), m_shape.characterization.height(), colorType,
+ m_shape.imageInfo.width(), m_shape.imageInfo.height(), colorType,
GrMipMapped::kNo, GrRenderable::kYes);
DCHECK(m_texture.isValid());
@@ -62,7 +62,7 @@ public:
NOTREACHED();
#endif
} else {
- auto info = SkImageInfo::Make(m_shape.characterization.width(), m_shape.characterization.height(),
+ auto info = SkImageInfo::Make(m_shape.imageInfo.width(), m_shape.imageInfo.height(),
colorType, kUnpremul_SkAlphaType);
m_estimatedSize = info.computeMinByteSize();
}
@@ -210,8 +210,8 @@ private:
m_imageInfo.fProtected == GrProtected::kYes ? VK_IMAGE_CREATE_PROTECTED_BIT : 0;
m_imageCreateInfo.imageType = VK_IMAGE_TYPE_2D;
m_imageCreateInfo.format = m_imageInfo.fFormat;
- m_imageCreateInfo.extent.width = static_cast<uint32_t>(m_shape.characterization.width());
- m_imageCreateInfo.extent.height = static_cast<uint32_t>(m_shape.characterization.height());
+ m_imageCreateInfo.extent.width = static_cast<uint32_t>(m_shape.imageInfo.width());
+ m_imageCreateInfo.extent.height = static_cast<uint32_t>(m_shape.imageInfo.height());
m_imageCreateInfo.extent.depth = 1;
m_imageCreateInfo.mipLevels = m_imageInfo.fLevelCount;
m_imageCreateInfo.arrayLayers = 1;
@@ -297,19 +297,20 @@ void DisplaySkiaOutputDevice::SetFrameSinkId(const viz::FrameSinkId &id)
{
bind(id);
}
-
-bool DisplaySkiaOutputDevice::Reshape(const SkSurfaceCharacterization &characterization,
+bool DisplaySkiaOutputDevice::Reshape(const SkImageInfo &image_info,
const gfx::ColorSpace &colorSpace,
+ int sample_count,
float device_scale_factor,
gfx::OverlayTransform transform)
{
- m_shape = Shape{characterization, device_scale_factor, colorSpace};
+ m_shape = Shape{image_info, device_scale_factor, colorSpace};
DCHECK_EQ(transform, gfx::OVERLAY_TRANSFORM_NONE);
return true;
}
-void DisplaySkiaOutputDevice::SwapBuffers(BufferPresentedCallback feedback,
- viz::OutputSurfaceFrame frame)
+void DisplaySkiaOutputDevice::Present(const absl::optional<gfx::Rect> &update_rect,
+ BufferPresentedCallback feedback,
+ viz::OutputSurfaceFrame frame)
{
DCHECK(m_backBuffer);
@@ -398,7 +399,7 @@ bool DisplaySkiaOutputDevice::textureIsFlipped()
QSize DisplaySkiaOutputDevice::size()
{
- return m_frontBuffer ? toQt(m_frontBuffer->shape().characterization.dimensions()) : QSize();
+ return m_frontBuffer ? toQt(m_frontBuffer->shape().imageInfo.dimensions()) : QSize();
}
bool DisplaySkiaOutputDevice::requiresAlphaChannel()
@@ -505,7 +506,7 @@ void DisplaySkiaOutputDevice::SwapBuffersFinished()
}
FinishSwapBuffers(gfx::SwapCompletionResult(gfx::SwapResult::SWAP_ACK),
- gfx::Size(m_shape.characterization.width(), m_shape.characterization.height()),
+ gfx::Size(m_shape.imageInfo.width(), m_shape.imageInfo.height()),
std::move(m_frame));
}
diff --git a/src/core/compositor/display_skia_output_device.h b/src/core/compositor/display_skia_output_device.h
index abe0e05e9..ed8fa145b 100644
--- a/src/core/compositor/display_skia_output_device.h
+++ b/src/core/compositor/display_skia_output_device.h
@@ -34,12 +34,14 @@ public:
// Overridden from SkiaOutputDevice.
void SetFrameSinkId(const viz::FrameSinkId &frame_sink_id) override;
- bool Reshape(const SkSurfaceCharacterization &characterization,
- const gfx::ColorSpace& colorSpace,
+ bool Reshape(const SkImageInfo &image_info,
+ const gfx::ColorSpace &color_space,
+ int sample_count,
float device_scale_factor,
gfx::OverlayTransform transform) override;
- void SwapBuffers(BufferPresentedCallback feedback,
- viz::OutputSurfaceFrame frame) override;
+ void Present(const absl::optional<gfx::Rect>& update_rect,
+ BufferPresentedCallback feedback,
+ viz::OutputSurfaceFrame frame) override;
void EnsureBackbuffer() override;
void DiscardBackbuffer() override;
SkSurface *BeginPaint(std::vector<GrBackendSemaphore> *semaphores) override;
@@ -63,13 +65,13 @@ public:
private:
struct Shape
{
- SkSurfaceCharacterization characterization;
+ SkImageInfo imageInfo;
float devicePixelRatio;
gfx::ColorSpace colorSpace;
bool operator==(const Shape &that) const
{
- return (characterization == that.characterization &&
+ return (imageInfo == that.imageInfo &&
devicePixelRatio == that.devicePixelRatio &&
colorSpace == that.colorSpace);
}
diff --git a/src/core/compositor/native_skia_output_device.cpp b/src/core/compositor/native_skia_output_device.cpp
index 3067e14a7..b7476bf8a 100644
--- a/src/core/compositor/native_skia_output_device.cpp
+++ b/src/core/compositor/native_skia_output_device.cpp
@@ -56,13 +56,13 @@ public:
if (!m_parent->m_factory->CreateSharedImage(mailbox,
viz::SharedImageFormat::SinglePlane(viz::RGBA_8888),
- {m_parent->m_shape.characterization.width(), m_parent->m_shape.characterization.height()},
+ {m_parent->m_shape.imageInfo.width(), m_parent->m_shape.imageInfo.height()},
m_parent->m_shape.colorSpace,
m_parent->capabilities_.output_surface_origin == gfx::SurfaceOrigin::kTopLeft
? kTopLeft_GrSurfaceOrigin
: kBottomLeft_GrSurfaceOrigin,
kPremul_SkAlphaType,
- m_parent->m_deps->GetSurfaceHandle(), kDefaultSharedImageUsage)) {
+ m_parent->m_deps->GetSurfaceHandle(), kDefaultSharedImageUsage, "QWE_SharedImageBuffer")) {
LOG(ERROR) << "CreateSharedImage failed.";
return false;
}
@@ -111,12 +111,13 @@ public:
// The Flush now takes place in finishPaintCurrentBuffer on the CPU side.
// check if end_semaphores is not empty then flush here
DCHECK(m_scopedSkiaWriteAccess);
- auto end_state = m_scopedSkiaWriteAccess->TakeEndState();
- if (!m_endSemaphores.empty() || end_state || force_flush) {
+ if (!m_endSemaphores.empty() || force_flush) {
GrFlushInfo flush_info = {};
flush_info.fNumSemaphores = m_endSemaphores.size();
flush_info.fSignalSemaphores = m_endSemaphores.data();
- m_scopedSkiaWriteAccess->surface()->flush(flush_info, end_state.get());
+ m_scopedSkiaWriteAccess->surface()->flush();
+ m_scopedSkiaWriteAccess->ApplyBackendSurfaceEndState();
+ m_scopedSkiaWriteAccess->surface()->flush(flush_info, nullptr);
auto *direct_context = m_scopedSkiaWriteAccess->surface()->recordingContext()->asDirectContext();
DCHECK(direct_context);
direct_context->submit();
@@ -258,18 +259,20 @@ void NativeSkiaOutputDevice::SetFrameSinkId(const viz::FrameSinkId &id)
bind(id);
}
-bool NativeSkiaOutputDevice::Reshape(const SkSurfaceCharacterization &characterization,
- const gfx::ColorSpace &colorSpace,
- float device_scale_factor,
- gfx::OverlayTransform transform)
+bool NativeSkiaOutputDevice::Reshape(const SkImageInfo &image_info,
+ const gfx::ColorSpace &colorSpace,
+ int sample_count,
+ float device_scale_factor,
+ gfx::OverlayTransform transform)
{
- m_shape = Shape{characterization, device_scale_factor, colorSpace};
+ m_shape = Shape{image_info, device_scale_factor, colorSpace};
DCHECK_EQ(transform, gfx::OVERLAY_TRANSFORM_NONE);
return true;
}
-void NativeSkiaOutputDevice::SwapBuffers(BufferPresentedCallback feedback,
- viz::OutputSurfaceFrame frame)
+void NativeSkiaOutputDevice::Present(const absl::optional<gfx::Rect> &update_rect,
+ BufferPresentedCallback feedback,
+ viz::OutputSurfaceFrame frame)
{
DCHECK(m_backBuffer);
@@ -370,13 +373,13 @@ QSGTexture *NativeSkiaOutputDevice::texture(QQuickWindow *win, uint32_t textureO
gfx::ScopedIOSurface ioSurface = m_frontBuffer->ioSurface();
if (graphicsApi == QSGRendererInterface::Metal) {
texture = makeMetalTexture(win, ioSurface.release(), /* plane */ 0,
- m_shape.characterization.width(), m_shape.characterization.height(),
+ m_shape.imageInfo.width(), m_shape.imageInfo.height(),
textureOptions);
#if QT_CONFIG(opengl)
} else if (graphicsApi == QSGRendererInterface::OpenGL) {
uint heldTexture;
texture = makeCGLTexture(win, ioSurface.release(),
- m_shape.characterization.width(), m_shape.characterization.height(),
+ m_shape.imageInfo.width(), m_shape.imageInfo.height(),
textureOptions, &heldTexture);
m_frontBuffer->m_textureCleanup = [heldTexture]() { releaseGlTexture(heldTexture); };
#endif
@@ -452,7 +455,7 @@ bool NativeSkiaOutputDevice::textureIsFlipped()
QSize NativeSkiaOutputDevice::size()
{
- return m_frontBuffer ? toQt(m_frontBuffer->shape().characterization.dimensions()) : QSize();
+ return m_frontBuffer ? toQt(m_frontBuffer->shape().imageInfo.dimensions()) : QSize();
}
bool NativeSkiaOutputDevice::requiresAlphaChannel()
@@ -473,7 +476,7 @@ void NativeSkiaOutputDevice::SwapBuffersFinished()
}
FinishSwapBuffers(gfx::SwapCompletionResult(gfx::SwapResult::SWAP_ACK),
- gfx::Size(m_shape.characterization.width(), m_shape.characterization.height()),
+ gfx::Size(m_shape.imageInfo.width(), m_shape.imageInfo.height()),
std::move(m_frame));
}
diff --git a/src/core/compositor/native_skia_output_device.h b/src/core/compositor/native_skia_output_device.h
index 6313007e4..c8140d8d8 100644
--- a/src/core/compositor/native_skia_output_device.h
+++ b/src/core/compositor/native_skia_output_device.h
@@ -41,12 +41,14 @@ public:
// Overridden from SkiaOutputDevice.
void SetFrameSinkId(const viz::FrameSinkId &frame_sink_id) override;
- bool Reshape(const SkSurfaceCharacterization &characterization,
- const gfx::ColorSpace& colorSpace,
+ bool Reshape(const SkImageInfo &image_info,
+ const gfx::ColorSpace &color_space,
+ int sample_count,
float device_scale_factor,
gfx::OverlayTransform transform) override;
- void SwapBuffers(BufferPresentedCallback feedback,
- viz::OutputSurfaceFrame frame) override;
+ void Present(const absl::optional<gfx::Rect>& update_rect,
+ BufferPresentedCallback feedback,
+ viz::OutputSurfaceFrame frame) override;
void EnsureBackbuffer() override;
void DiscardBackbuffer() override;
SkSurface *BeginPaint(std::vector<GrBackendSemaphore> *semaphores) override;
@@ -66,13 +68,13 @@ public:
private:
struct Shape
{
- SkSurfaceCharacterization characterization;
+ SkImageInfo imageInfo;
float devicePixelRatio;
gfx::ColorSpace colorSpace;
bool operator==(const Shape &that) const
{
- return (characterization == that.characterization &&
+ return (imageInfo == that.imageInfo &&
devicePixelRatio == that.devicePixelRatio &&
colorSpace == that.colorSpace);
}
diff --git a/src/core/configure/BUILD.root.gn.in b/src/core/configure/BUILD.root.gn.in
index 7b61ff4ef..b63ef76b5 100644
--- a/src/core/configure/BUILD.root.gn.in
+++ b/src/core/configure/BUILD.root.gn.in
@@ -555,6 +555,7 @@ repack("qtwebengine_repack_resources") {
"$root_gen_dir/content/content_resources.pak",
"$root_gen_dir/content/dev_ui_content_resources.pak",
"$root_gen_dir/content/indexed_db_resources.pak",
+ "$root_gen_dir/content/gpu_resources.pak",
"$root_gen_dir/content/quota_internals_resources.pak",
"$root_gen_dir/mojo/public/js/mojo_bindings_resources.pak",
"$root_gen_dir/net/net_resources.pak",
@@ -570,6 +571,7 @@ repack("qtwebengine_repack_resources") {
"//components/resources:components_resources_grit",
"//components/resources:dev_ui_components_resources_grit",
"//content/browser/resources/attribution_reporting:resources",
+ "//content/browser/resources/gpu:resources",
"//content/browser/resources/media:resources",
"//content/browser/tracing:resources",
"//content:content_resources",
diff --git a/src/core/extensions/extension_system_qt.cpp b/src/core/extensions/extension_system_qt.cpp
index d55d7d036..3a34b03e5 100644
--- a/src/core/extensions/extension_system_qt.cpp
+++ b/src/core/extensions/extension_system_qt.cpp
@@ -43,11 +43,11 @@
#include "extensions/browser/extension_pref_value_map_factory.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_registry.h"
-#include "extensions/browser/info_map.h"
#include "extensions/browser/notification_types.h"
#include "extensions/browser/quota_service.h"
#include "extensions/browser/renderer_startup_helper.h"
#include "extensions/browser/service_worker_manager.h"
+#include "extensions/browser/task_queue_util.h"
#include "extensions/browser/user_script_manager.h"
#include "extensions/common/constants.h"
#include "extensions/common/manifest_constants.h"
@@ -143,25 +143,11 @@ void ExtensionSystemQt::LoadExtension(std::string extension_id, const base::Valu
if (!extension.get())
LOG(ERROR) << error;
- content::GetIOThreadTaskRunner({})->PostTask(FROM_HERE,
- base::BindOnce(&InfoMap::AddExtension,
- base::Unretained(info_map()),
- base::RetainedRef(extension),
- base::Time::Now(),
- true,
- false));
extension_registry_->AddEnabled(extension.get());
NotifyExtensionLoaded(extension.get());
}
-void ExtensionSystemQt::OnExtensionRegisteredWithRequestContexts(scoped_refptr<const extensions::Extension> extension)
-{
- extension_registry_->AddReady(extension);
- if (extension_registry_->enabled_extensions().Contains(extension->id()))
- extension_registry_->TriggerOnReady(extension.get());
-}
-
// Implementation based on ExtensionService::NotifyExtensionLoaded.
void ExtensionSystemQt::NotifyExtensionLoaded(const Extension *extension)
{
@@ -171,11 +157,7 @@ void ExtensionSystemQt::NotifyExtensionLoaded(const Extension *extension)
// that the request context doesn't yet know about. The profile is responsible
// for ensuring its URLRequestContexts appropriately discover the loaded
// extension.
- RegisterExtensionWithRequestContexts(
- extension,
- base::BindRepeating(&ExtensionSystemQt::OnExtensionRegisteredWithRequestContexts,
- weak_ptr_factory_.GetWeakPtr(),
- base::WrapRefCounted(extension)));
+ ActivateTaskQueueForExtension(browser_context_, extension);
// Tell renderers about the loaded extension.
renderer_helper_->OnExtensionLoaded(*extension);
@@ -220,6 +202,10 @@ void ExtensionSystemQt::NotifyExtensionLoaded(const Extension *extension)
if (plugins_changed)
content::PluginService::GetInstance()->PurgePluginListCache(browser_context_, false);
#endif // BUILDFLAG(ENABLE_PLUGINS)
+
+ extension_registry_->AddReady(extension);
+ if (extension_registry_->enabled_extensions().Contains(extension->id()))
+ extension_registry_->TriggerOnReady(extension);
}
bool ExtensionSystemQt::FinishDelayedInstallationIfReady(const std::string &extension_id, bool install_immediately)
@@ -274,13 +260,6 @@ scoped_refptr<value_store::ValueStoreFactory> ExtensionSystemQt::store_factory()
return store_factory_;
}
-InfoMap *ExtensionSystemQt::info_map()
-{
- if (!info_map_.get())
- info_map_ = new InfoMap;
- return info_map_.get();
-}
-
QuotaService *ExtensionSystemQt::quota_service()
{
return quota_service_.get();
@@ -365,8 +344,6 @@ void ExtensionSystemQt::InitForRegularProfile(bool extensions_enabled)
{
if (initialized_)
return; // Already initialized.
- // The InfoMap needs to be created before the ProcessManager.
- info_map();
Init(extensions_enabled);
}
@@ -376,27 +353,6 @@ std::unique_ptr<ExtensionSet> ExtensionSystemQt::GetDependentExtensions(const Ex
return base::WrapUnique(new ExtensionSet());
}
-void ExtensionSystemQt::RegisterExtensionWithRequestContexts(const Extension *extension,
- base::OnceClosure callback)
-{
- base::Time install_time = base::Time::Now();
-
- bool incognito_enabled = false;
- bool notifications_disabled = false;
-
- content::GetIOThreadTaskRunner({})->PostTaskAndReply(FROM_HERE,
- base::BindOnce(&InfoMap::AddExtension, info_map(),
- base::RetainedRef(extension), install_time, incognito_enabled,
- notifications_disabled),
- std::move(callback));
-}
-
-void ExtensionSystemQt::UnregisterExtensionWithRequestContexts(const std::string &extension_id)
-{
- content::GetIOThreadTaskRunner({})->PostTask(FROM_HERE,
- base::BindOnce(&InfoMap::RemoveExtension, info_map(), extension_id));
-}
-
bool ExtensionSystemQt::is_ready() const
{
return ready_.is_signaled();
diff --git a/src/core/extensions/extension_system_qt.h b/src/core/extensions/extension_system_qt.h
index 87e740820..e4e9b953e 100644
--- a/src/core/extensions/extension_system_qt.h
+++ b/src/core/extensions/extension_system_qt.h
@@ -58,15 +58,9 @@ public:
StateStore *rules_store() override;
StateStore *dynamic_user_scripts_store() override;
scoped_refptr<value_store::ValueStoreFactory> store_factory() override;
- InfoMap *info_map() override;
QuotaService *quota_service() override;
AppSorting *app_sorting() override;
- void RegisterExtensionWithRequestContexts(const Extension *extension,
- base::OnceClosure callback) override;
-
- void UnregisterExtensionWithRequestContexts(const std::string &extension_id) override;
-
ContentVerifier *content_verifier() override;
std::unique_ptr<ExtensionSet> GetDependentExtensions(const Extension *extension) override;
@@ -80,20 +74,14 @@ public:
void PerformActionBasedOnOmahaAttributes(const std::string &, const base::Value &) override { /* fixme? */}
private:
- void OnExtensionRegisteredWithRequestContexts(scoped_refptr<const extensions::Extension> extension);
-
void NotifyExtensionLoaded(const Extension *extension);
void LoadExtension(std::string extension_id, const base::Value::Dict &manifest, const base::FilePath &directory);
- // The services that are shared between normal and incognito profiles.
-
- // Data to be accessed on the IO thread. Must outlive process_manager_.
- scoped_refptr<InfoMap> info_map_;
+ // The services that are shared between normal and incognito profiles.
std::unique_ptr<ServiceWorkerManager> service_worker_manager_;
std::unique_ptr<QuotaService> quota_service_;
std::unique_ptr<UserScriptManager> user_script_manager_;
-
// For verifying the contents of extensions read from disk.
scoped_refptr<ContentVerifier> content_verifier_;
base::OneShotEvent ready_;
diff --git a/src/core/favicon_service_factory_qt.cpp b/src/core/favicon_service_factory_qt.cpp
index 1ed33d559..dd2a1979a 100644
--- a/src/core/favicon_service_factory_qt.cpp
+++ b/src/core/favicon_service_factory_qt.cpp
@@ -46,7 +46,7 @@ std::unique_ptr<history::HistoryBackendClient> HistoryClientQt::CreateBackendCli
return nullptr;
}
-void HistoryClientQt::UpdateBookmarkLastUsedTime(int64_t /*bookmark_node_id*/, base::Time /*time*/)
+void HistoryClientQt::UpdateBookmarkLastUsedTime(const base::Uuid &, base::Time /*time*/)
{
}
diff --git a/src/core/favicon_service_factory_qt.h b/src/core/favicon_service_factory_qt.h
index 0c3bfd7b5..55d5f3b33 100644
--- a/src/core/favicon_service_factory_qt.h
+++ b/src/core/favicon_service_factory_qt.h
@@ -51,7 +51,7 @@ public:
history::CanAddURLCallback GetThreadSafeCanAddURLCallback() const override;
void NotifyProfileError(sql::InitStatus init_status, const std::string &diagnostics) override;
std::unique_ptr<history::HistoryBackendClient> CreateBackendClient() override;
- void UpdateBookmarkLastUsedTime(int64_t bookmark_node_id, base::Time time) override;
+ void UpdateBookmarkLastUsedTime(const base::Uuid &, base::Time) override;
};
class HistoryServiceFactoryQt : public BrowserContextKeyedServiceFactory
diff --git a/src/core/location_provider_qt.cpp b/src/core/location_provider_qt.cpp
index 8952c7c69..dc0d80aa7 100644
--- a/src/core/location_provider_qt.cpp
+++ b/src/core/location_provider_qt.cpp
@@ -22,6 +22,8 @@
#include "services/device/geolocation/geolocation_provider.h"
#include "services/device/geolocation/geolocation_provider_impl.h"
+#include "services/device/public/mojom/geoposition.mojom.h"
+
namespace QtWebEngineCore {
using content::BrowserThread;
@@ -161,59 +163,59 @@ void QtPositioningHelper::updatePosition(const QGeoPositionInfo &pos)
if (!pos.isValid())
return;
Q_ASSERT(m_positionInfoSource->error() == QGeoPositionInfoSource::NoError);
- device::mojom::Geoposition newPos;
- newPos.error_code = device::mojom::Geoposition::ErrorCode::NONE;
- newPos.error_message.clear();
+ auto newPos = device::mojom::Geoposition::New();
- newPos.timestamp = toTime(pos.timestamp());
- newPos.latitude = pos.coordinate().latitude();
- newPos.longitude = pos.coordinate().longitude();
+ newPos->timestamp = toTime(pos.timestamp());
+ newPos->latitude = pos.coordinate().latitude();
+ newPos->longitude = pos.coordinate().longitude();
const double altitude = pos.coordinate().altitude();
if (!qIsNaN(altitude))
- newPos.altitude = altitude;
+ newPos->altitude = altitude;
// Chromium's geoposition needs a valid (as in >=0.) accuracy field.
// try and get an accuracy estimate from QGeoPositionInfo.
// If we don't have any accuracy info, 100m seems a pesimistic enough default.
if (!pos.hasAttribute(QGeoPositionInfo::VerticalAccuracy) && !pos.hasAttribute(QGeoPositionInfo::HorizontalAccuracy))
- newPos.accuracy = 100;
+ newPos->accuracy = 100;
else {
const double vAccuracy = pos.hasAttribute(QGeoPositionInfo::VerticalAccuracy) ? pos.attribute(QGeoPositionInfo::VerticalAccuracy) : 0;
const double hAccuracy = pos.hasAttribute(QGeoPositionInfo::HorizontalAccuracy) ? pos.attribute(QGeoPositionInfo::HorizontalAccuracy) : 0;
- newPos.accuracy = sqrt(vAccuracy * vAccuracy + hAccuracy * hAccuracy);
+ newPos->accuracy = sqrt(vAccuracy * vAccuracy + hAccuracy * hAccuracy);
}
// And now the "nice to have" fields (-1 means invalid).
- newPos.speed = pos.hasAttribute(QGeoPositionInfo::GroundSpeed) ? pos.attribute(QGeoPositionInfo::GroundSpeed) : -1;
- newPos.heading = pos.hasAttribute(QGeoPositionInfo::Direction) ? pos.attribute(QGeoPositionInfo::Direction) : -1;
+ newPos->speed = pos.hasAttribute(QGeoPositionInfo::GroundSpeed) ? pos.attribute(QGeoPositionInfo::GroundSpeed) : -1;
+ newPos->heading = pos.hasAttribute(QGeoPositionInfo::Direction) ? pos.attribute(QGeoPositionInfo::Direction) : -1;
+ auto newResult = device::mojom::GeopositionResult::NewPosition(std::move(newPos));
if (m_locationProvider)
- postToLocationProvider(base::BindOnce(&LocationProviderQt::updatePosition, m_locationProviderFactory.GetWeakPtr(), newPos));
+ postToLocationProvider(base::BindOnce(&LocationProviderQt::updatePosition, m_locationProviderFactory.GetWeakPtr(), std::move(newResult)));
}
void QtPositioningHelper::error(QGeoPositionInfoSource::Error positioningError)
{
Q_ASSERT(positioningError != QGeoPositionInfoSource::NoError);
- device::mojom::Geoposition newPos;
+ auto newError = device::mojom::GeopositionError::New();
switch (positioningError) {
case QGeoPositionInfoSource::AccessError:
- newPos.error_code = device::mojom::Geoposition::ErrorCode::PERMISSION_DENIED;
+ newError->error_code = device::mojom::GeopositionErrorCode::kPermissionDenied;
break;
case QGeoPositionInfoSource::UpdateTimeoutError:
// content::Geoposition::ERROR_CODE_TIMEOUT is not handled properly in the renderer process, and the timeout
// argument used in JS never comes all the way to the browser process.
// Let's just treat it like any other error where the position is unavailable.
- newPos.error_code = device::mojom::Geoposition::ErrorCode::POSITION_UNAVAILABLE;
+ newError->error_code = device::mojom::GeopositionErrorCode::kPositionUnavailable;
break;
case QGeoPositionInfoSource::ClosedError:
case QGeoPositionInfoSource::UnknownSourceError: // position unavailable is as good as it gets in Geoposition
default:
- newPos.error_code = device::mojom::Geoposition::ErrorCode::POSITION_UNAVAILABLE;
+ newError->error_code = device::mojom::GeopositionErrorCode::kPositionUnavailable;
break;
}
+ auto newResult = device::mojom::GeopositionResult::NewError(std::move(newError));
if (m_locationProvider)
- postToLocationProvider(base::BindOnce(&LocationProviderQt::updatePosition, m_locationProviderFactory.GetWeakPtr(), newPos));
+ postToLocationProvider(base::BindOnce(&LocationProviderQt::updatePosition, m_locationProviderFactory.GetWeakPtr(), std::move(newResult)));
}
inline void QtPositioningHelper::postToLocationProvider(base::OnceClosure task)
@@ -263,10 +265,10 @@ void LocationProviderQt::SetUpdateCallback(const LocationProviderUpdateCallback&
m_callback = callback;
}
-void LocationProviderQt::updatePosition(const device::mojom::Geoposition &position)
+void LocationProviderQt::updatePosition(device::mojom::GeopositionResultPtr position)
{
- m_lastKnownPosition = position;
- m_callback.Run(this, position);
+ m_lastKnownPosition = std::move(position);
+ m_callback.Run(this, m_lastKnownPosition.Clone());
}
} // namespace QtWebEngineCore
diff --git a/src/core/location_provider_qt.h b/src/core/location_provider_qt.h
index e40471af5..76937cc15 100644
--- a/src/core/location_provider_qt.h
+++ b/src/core/location_provider_qt.h
@@ -23,16 +23,16 @@ public:
// LocationProvider
void StartProvider(bool high_accuracy) override;
void StopProvider() override;
- const device::mojom::Geoposition& GetPosition() override { return m_lastKnownPosition; }
+ const device::mojom::GeopositionResult* GetPosition() override { return m_lastKnownPosition.get(); }
void OnPermissionGranted() override;
void SetUpdateCallback(const LocationProviderUpdateCallback& callback) override;
private:
friend class QtPositioningHelper;
- void updatePosition(const device::mojom::Geoposition &);
+ void updatePosition(device::mojom::GeopositionResultPtr);
- device::mojom::Geoposition m_lastKnownPosition;
+ device::mojom::GeopositionResultPtr m_lastKnownPosition;
LocationProviderUpdateCallback m_callback;
QtPositioningHelper *m_positioningHelper;
};
diff --git a/src/core/login_delegate_qt.cpp b/src/core/login_delegate_qt.cpp
index 140335735..3f916b797 100644
--- a/src/core/login_delegate_qt.cpp
+++ b/src/core/login_delegate_qt.cpp
@@ -11,22 +11,11 @@
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_view_host.h"
-#include "extensions/buildflags/buildflags.h"
-#include "services/network/public/cpp/features.h"
-
-#if BUILDFLAG(ENABLE_EXTENSIONS)
-#include "extensions/browser/info_map.h"
-#include "extensions/common/extension.h"
-#include "extensions/common/manifest_handlers/mime_types_handler.h"
-#endif // BUILDFLAG(ENABLE_EXTENSIONS)
-
#include "net/url_request/url_request.h"
+#include "services/network/public/cpp/features.h"
#include "authentication_dialog_controller.h"
#include "authentication_dialog_controller_p.h"
-#if BUILDFLAG(ENABLE_EXTENSIONS)
-#include "extensions/extension_system_qt.h"
-#endif // BUILDFLAG(ENABLE_EXTENSIONS)
#include "type_conversion.h"
#include "web_contents_view_qt.h"
#include "web_engine_context.h"
diff --git a/src/core/net/client_cert_qt.cpp b/src/core/net/client_cert_qt.cpp
index 79317f467..044e5618e 100644
--- a/src/core/net/client_cert_qt.cpp
+++ b/src/core/net/client_cert_qt.cpp
@@ -5,6 +5,7 @@
#include "base/functional/bind.h"
#include "base/functional/callback_forward.h"
+#include "content/public/browser/browser_thread.h"
#include "content/public/browser/browser_task_traits.h"
#include "crypto/crypto_buildflags.h"
#include "net/ssl/client_cert_store.h"
diff --git a/src/core/net/ssl_host_state_delegate_qt.cpp b/src/core/net/ssl_host_state_delegate_qt.cpp
index 20429e62e..dcb881a49 100644
--- a/src/core/net/ssl_host_state_delegate_qt.cpp
+++ b/src/core/net/ssl_host_state_delegate_qt.cpp
@@ -111,5 +111,16 @@ bool SSLHostStateDelegateQt::HasAllowException(const std::string &host, content:
policy_iterator->second.HasAllowException();
}
+void SSLHostStateDelegateQt::SetHttpsEnforcementForHost(const std::string &host, bool enforce,
+ content::StoragePartition *storage_partition)
+{
+ // Intentional no-op see aw_ssl_host_state_delegate
+}
+
+bool SSLHostStateDelegateQt::IsHttpsEnforcedForHost(const std::string &host, content::StoragePartition *storage_partition)
+{
+ // Intentional no-op
+ return false;
+}
} // namespace QtWebEngineCore
diff --git a/src/core/net/ssl_host_state_delegate_qt.h b/src/core/net/ssl_host_state_delegate_qt.h
index 380e59f2c..ab415603f 100644
--- a/src/core/net/ssl_host_state_delegate_qt.h
+++ b/src/core/net/ssl_host_state_delegate_qt.h
@@ -39,6 +39,8 @@ public:
bool DidHostRunInsecureContent(const std::string &host, int child_id, InsecureContentType content_type) override;
void AllowHttpForHost(const std::string &host, content::StoragePartition *web_contents) override;
bool IsHttpAllowedForHost(const std::string &host, content::StoragePartition *web_contents) override;
+ void SetHttpsEnforcementForHost(const std::string &host, bool enforce, content::StoragePartition *storage_partition) override;
+ bool IsHttpsEnforcedForHost(const std::string &host, content::StoragePartition *web_contents) override;
void RevokeUserAllowExceptions(const std::string &host) override;
bool HasAllowException(const std::string &host, content::StoragePartition *web_contents) override;
diff --git a/src/core/permission_manager_qt.cpp b/src/core/permission_manager_qt.cpp
index b44fb4300..f1d8e04d9 100644
--- a/src/core/permission_manager_qt.cpp
+++ b/src/core/permission_manager_qt.cpp
@@ -305,6 +305,15 @@ blink::mojom::PermissionStatus PermissionManagerQt::GetPermissionStatusForWorker
return GetPermissionStatus(permission, url, url);
}
+blink::mojom::PermissionStatus PermissionManagerQt::GetPermissionStatusForEmbeddedRequester(
+ blink::PermissionType permission,
+ content::RenderFrameHost *render_frame_host,
+ const url::Origin &requesting_origin)
+{
+ return GetPermissionStatus(permission, requesting_origin.GetURL(),
+ render_frame_host->GetLastCommittedOrigin().GetURL());
+}
+
content::PermissionResult PermissionManagerQt::GetPermissionResultForOriginWithoutContext(
blink::PermissionType permission,
const url::Origin &origin)
diff --git a/src/core/permission_manager_qt.h b/src/core/permission_manager_qt.h
index 6cfeb874e..ce4f97397 100644
--- a/src/core/permission_manager_qt.h
+++ b/src/core/permission_manager_qt.h
@@ -39,6 +39,8 @@ public:
blink::mojom::PermissionStatus GetPermissionStatusForWorker(blink::PermissionType, content::RenderProcessHost *, const GURL &) override;
+ blink::mojom::PermissionStatus GetPermissionStatusForEmbeddedRequester(blink::PermissionType, content::RenderFrameHost*, const url::Origin&) override;
+
content::PermissionResult GetPermissionResultForOriginWithoutContext(blink::PermissionType, const url::Origin &) override;
void ResetPermission(
diff --git a/src/core/printing/print_view_manager_base_qt.cpp b/src/core/printing/print_view_manager_base_qt.cpp
index d6113ecd9..b2b8e34fc 100644
--- a/src/core/printing/print_view_manager_base_qt.cpp
+++ b/src/core/printing/print_view_manager_base_qt.cpp
@@ -69,24 +69,6 @@ void OnDidGetDefaultPrintSettings(scoped_refptr<printing::PrintQueriesQueue> que
}
}
-printing::mojom::PrintPagesParamsPtr CreateEmptyPrintPagesParamsPtr()
-{
- auto params = printing::mojom::PrintPagesParams::New();
- params->params = printing::mojom::PrintParams::New();
- return params;
-}
-
-// Runs |callback| with |params| to reply to
-// mojom::PrintManagerHost::UpdatePrintSettings.
-void UpdatePrintSettingsReply(printing::mojom::PrintManagerHost::UpdatePrintSettingsCallback callback,
- printing::mojom::PrintPagesParamsPtr params, bool canceled)
-{
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- if (!params)
- params = CreateEmptyPrintPagesParamsPtr();
- std::move(callback).Run(std::move(params), canceled);
-}
-
void OnDidUpdatePrintSettings(scoped_refptr<printing::PrintQueriesQueue> queue,
std::unique_ptr<printing::PrinterQuery> printer_query,
printing::mojom::PrintManagerHost::UpdatePrintSettingsCallback callback,
@@ -101,22 +83,21 @@ void OnDidUpdatePrintSettings(scoped_refptr<printing::PrintQueriesQueue> queue,
params->params->document_cookie = printer_query->cookie();
params->pages = printer_query->settings().ranges();
}
- bool canceled = printer_query->last_status() == printing::mojom::ResultCode::kCanceled;
- UpdatePrintSettingsReply(std::move(callback), std::move(params), canceled);
+ std::move(callback).Run(std::move(params));
if (printer_query->cookie() && printer_query->settings().dpi()) {
queue->QueuePrinterQuery(std::move(printer_query));
}
}
-
void OnDidScriptedPrint(scoped_refptr<printing::PrintQueriesQueue> queue,
std::unique_ptr<printing::PrinterQuery> printer_query,
printing::mojom::PrintManagerHost::ScriptedPrintCallback callback)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- printing::mojom::PrintPagesParamsPtr params = CreateEmptyPrintPagesParamsPtr();
+ auto params = printing::mojom::PrintPagesParams::New();
+ params->params = printing::mojom::PrintParams::New();
if (printer_query->last_status() == printing::mojom::ResultCode::kSuccess && printer_query->settings().dpi()) {
RenderParamsFromPrintSettings(printer_query->settings(), params->params.get());
params->params->document_cookie = printer_query->cookie();
@@ -583,21 +564,20 @@ void PrintViewManagerBaseQt::StopWorker(int documentCookie)
m_printerQueriesQueue->PopPrinterQuery(documentCookie);
}
-void PrintViewManagerBaseQt::UpdatePrintSettings(int32_t cookie, base::Value::Dict job_settings,
+void PrintViewManagerBaseQt::UpdatePrintSettings(base::Value::Dict job_settings,
UpdatePrintSettingsCallback callback)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
if (!job_settings.FindInt(printing::kSettingPrinterType)) {
- UpdatePrintSettingsReply(std::move(callback), nullptr, false);
+ std::move(callback).Run(nullptr);
return;
}
content::RenderFrameHost *render_frame_host =
print_manager_host_receivers_.GetCurrentTargetFrame();
- std::unique_ptr<printing::PrinterQuery> printer_query = m_printerQueriesQueue->PopPrinterQuery(cookie);
- if (!printer_query)
- printer_query = m_printerQueriesQueue->CreatePrinterQuery(content::GlobalRenderFrameHostId());
+ std::unique_ptr<printing::PrinterQuery> printer_query =
+ m_printerQueriesQueue->CreatePrinterQuery(content::GlobalRenderFrameHostId());
auto *printer_query_ptr = printer_query.get();
printer_query_ptr->SetSettings(
diff --git a/src/core/printing/print_view_manager_base_qt.h b/src/core/printing/print_view_manager_base_qt.h
index e8e59f8a5..d4b5bfe82 100644
--- a/src/core/printing/print_view_manager_base_qt.h
+++ b/src/core/printing/print_view_manager_base_qt.h
@@ -43,8 +43,7 @@ public:
void DidPrintDocument(printing::mojom::DidPrintDocumentParamsPtr params,
DidPrintDocumentCallback callback) override;
void GetDefaultPrintSettings(GetDefaultPrintSettingsCallback callback) override;
- void UpdatePrintSettings(int32_t cookie, base::Value::Dict job_settings,
- UpdatePrintSettingsCallback callback) override;
+ void UpdatePrintSettings(base::Value::Dict, UpdatePrintSettingsCallback) override;
void IsPrintingEnabled(IsPrintingEnabledCallback callback) override;
void ScriptedPrint(printing::mojom::ScriptedPrintParamsPtr,
printing::mojom::PrintManagerHost::ScriptedPrintCallback) override;
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
index 7561c5d79..42bb82205 100644
--- a/src/core/render_widget_host_view_qt.cpp
+++ b/src/core/render_widget_host_view_qt.cpp
@@ -980,7 +980,6 @@ void RenderWidgetHostViewQt::TakeFallbackContentFrom(content::RenderWidgetHostVi
CopyBackgroundColorIfPresentFrom(*viewQt);
m_delegatedFrameHost->TakeFallbackContentFrom(viewQt->m_delegatedFrameHost.get());
- host()->GetContentRenderingTimeoutFrom(viewQt->host());
}
void RenderWidgetHostViewQt::EnsureSurfaceSynchronizedForWebTest()
diff --git a/src/core/renderer/extensions/resource_request_policy_qt.cpp b/src/core/renderer/extensions/resource_request_policy_qt.cpp
index 21b7be4b6..a61e53310 100644
--- a/src/core/renderer/extensions/resource_request_policy_qt.cpp
+++ b/src/core/renderer/extensions/resource_request_policy_qt.cpp
@@ -27,8 +27,9 @@ ResourceRequestPolicyQt::ResourceRequestPolicyQt(Dispatcher *dispatcher)
void ResourceRequestPolicyQt::OnExtensionLoaded(const Extension &extension)
{
- if (WebAccessibleResourcesInfo::HasWebAccessibleResources(&extension)
- || WebviewInfo::HasWebviewAccessibleResources(extension, m_dispatcher->webview_partition_id())
+ if (WebAccessibleResourcesInfo::HasWebAccessibleResources(&extension) ||
+ WebviewInfo::HasWebviewAccessibleResources(extension,
+ m_dispatcher->webview_partition_id().value_or(std::string()))
// // Hosted app icons are accessible.
// // TODO(devlin): Should we incorporate this into
// // WebAccessibleResourcesInfo?
@@ -131,7 +132,9 @@ bool ResourceRequestPolicyQt::CanRequestResource(const GURL &resource_url,
// Disallow loading of extension resources which are not explicitly listed
// as web or WebView accessible if the manifest version is 2 or greater.
if (!WebAccessibleResourcesInfo::IsResourceWebAccessible(extension, resource_url.path(), initiator_origin) &&
- !WebviewInfo::IsResourceWebviewAccessible(extension, m_dispatcher->webview_partition_id(), resource_url.path()))
+ !WebviewInfo::IsResourceWebviewAccessible(extension,
+ m_dispatcher->webview_partition_id().value_or(std::string()),
+ resource_url.path()))
{
std::string message = base::StringPrintf(
"Denying load of %s. Resources must be listed in the "
diff --git a/src/core/version_ui_qt.cpp b/src/core/version_ui_qt.cpp
index 0208299eb..61a89596a 100644
--- a/src/core/version_ui_qt.cpp
+++ b/src/core/version_ui_qt.cpp
@@ -26,7 +26,7 @@ VersionUIQt::VersionUIQt(content::WebUI *web_ui) : content::WebUIController(web_
Profile *profile = Profile::FromWebUI(web_ui);
content::WebUIDataSource *html_source =
- content::WebUIDataSource::Create(chrome::kChromeUIVersionQtHost);
+ content::WebUIDataSource::CreateAndAdd(profile, chrome::kChromeUIVersionQtHost);
html_source->OverrideContentSecurityPolicy(
network::mojom::CSPDirectiveName::ScriptSrc,
"script-src chrome://resources 'self' 'unsafe-inline';");
@@ -51,7 +51,6 @@ VersionUIQt::VersionUIQt(content::WebUI *web_ui) : content::WebUIController(web_
command_line += " " + *iter;
html_source->AddString(kCommandLine, command_line);
#endif
- content::WebUIDataSource::Add(profile, html_source);
}
VersionUIQt::~VersionUIQt() { }
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index 95dd7e548..96607bd34 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -491,9 +491,6 @@ void WebContentsAdapter::initialize(content::SiteInstance *site)
webContents(), FaviconServiceFactoryQt::GetForBrowserContext(context), m_adapterClient);
AutofillClientQt::CreateForWebContents(webContents());
- autofill::ContentAutofillDriverFactory::CreateForWebContentsAndDelegate(
- webContents(), AutofillClientQt::FromWebContents(webContents()),
- base::BindRepeating(&autofill::BrowserDriverInitHook, AutofillClientQt::FromWebContents(webContents()), ""));
#if QT_CONFIG(webengine_printing_and_pdf) && QT_CONFIG(webengine_extensions)
pdf::PDFWebContentsHelper::CreateForWebContentsWithClient(