summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-22 14:18:16 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2021-01-13 16:11:59 +0100
commit7869ec5823da36a3ce33b379d3d664204756cad5 (patch)
tree45b692a4ed986b0a8932f2f6a183ed9408439e33 /src
parentffb13e6927ae14a7185bb45ee0dfd03973e5ebb0 (diff)
Adaptations for Chromium 86
Change-Id: I7e0ebecdbb68cfff0b574c966f3fa80d28680e1c Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Diffstat (limited to 'src')
-rw-r--r--src/core/accessibility_tree_formatter_qt.cpp6
-rw-r--r--src/core/api/core_api.pro1
-rw-r--r--src/core/browser_main_parts_qt.cpp4
-rw-r--r--src/core/browsing_data_remover_delegate_qt.cpp4
-rw-r--r--src/core/browsing_data_remover_delegate_qt.h2
-rw-r--r--src/core/clipboard_qt.cpp69
-rw-r--r--src/core/clipboard_qt.h45
-rw-r--r--src/core/common/extensions/extensions_client_qt.cpp12
-rw-r--r--src/core/common/extensions/extensions_client_qt.h10
-rw-r--r--src/core/content_browser_client_qt.cpp13
-rw-r--r--src/core/content_browser_client_qt.h2
-rw-r--r--src/core/content_main_delegate_qt.cpp5
-rw-r--r--src/core/desktop_screen_qt.cpp76
-rw-r--r--src/core/desktop_screen_qt.h27
-rw-r--r--src/core/file_picker_controller.cpp42
-rw-r--r--src/core/file_picker_controller.h18
-rw-r--r--src/core/net/cookie_monster_delegate_qt.cpp4
-rw-r--r--src/core/net/cookie_monster_delegate_qt.h2
-rw-r--r--src/core/net/custom_url_loader_factory.cpp6
-rw-r--r--src/core/net/proxying_url_loader_factory_qt.cpp6
-rw-r--r--src/core/net/system_network_context_manager.cpp2
-rw-r--r--src/core/ozone/gl_surface_egl_qt.cpp5
-rw-r--r--src/core/permission_manager_qt.cpp3
-rw-r--r--src/core/pref_service_adapter.cpp6
-rw-r--r--src/core/printing/print_view_manager_base_qt.cpp10
-rw-r--r--src/core/printing/print_view_manager_base_qt.h4
-rw-r--r--src/core/printing/print_view_manager_qt.cpp17
-rw-r--r--src/core/printing/print_view_manager_qt.h5
-rw-r--r--src/core/printing/printing_message_filter_qt.cpp41
-rw-r--r--src/core/profile_io_data_qt.cpp2
-rw-r--r--src/core/profile_io_data_qt.h2
-rw-r--r--src/core/qtwebengine_sources.gni1
-rw-r--r--src/core/quota_permission_context_qt.cpp18
-rw-r--r--src/core/quota_permission_context_qt.h2
-rw-r--r--src/core/quota_request_controller_impl.cpp7
-rw-r--r--src/core/render_widget_host_view_qt.cpp8
-rw-r--r--src/core/render_widget_host_view_qt.h4
-rw-r--r--src/core/renderer/content_renderer_client_qt.cpp12
-rw-r--r--src/core/renderer/content_renderer_client_qt.h3
-rw-r--r--src/core/renderer/render_frame_observer_qt.cpp2
-rw-r--r--src/core/renderer/render_frame_observer_qt.h2
-rw-r--r--src/core/renderer/user_resource_controller.cpp4
-rw-r--r--src/core/resource_bundle_qt.cpp4
-rw-r--r--src/core/type_conversion.h38
-rw-r--r--src/core/user_script.cpp4
-rw-r--r--src/core/web_contents_adapter.cpp22
-rw-r--r--src/core/web_contents_delegate_qt.cpp18
-rw-r--r--src/core/web_contents_delegate_qt.h6
-rw-r--r--src/core/web_engine_context.cpp6
-rw-r--r--src/core/web_engine_library_info.cpp5
-rw-r--r--src/webenginewidgets/api/qwebenginepage.cpp2
51 files changed, 281 insertions, 338 deletions
diff --git a/src/core/accessibility_tree_formatter_qt.cpp b/src/core/accessibility_tree_formatter_qt.cpp
index df652c6ab..56cec2feb 100644
--- a/src/core/accessibility_tree_formatter_qt.cpp
+++ b/src/core/accessibility_tree_formatter_qt.cpp
@@ -68,6 +68,7 @@ private:
const std::string GetAllowString() override;
const std::string GetDenyString() override;
const std::string GetDenyNodeString() override;
+ const std::string GetRunUntilEventString() override;
void RecursiveBuildAccessibilityTree(const content::BrowserAccessibility &node, base::DictionaryValue *dict) const;
void AddProperties(const BrowserAccessibility &node, base::DictionaryValue *dict) const;
base::string16 ProcessTreeForOutput(const base::DictionaryValue &node, base::DictionaryValue * = nullptr) override;
@@ -232,6 +233,11 @@ const std::string AccessibilityTreeFormatterQt::GetDenyNodeString()
return "@QT-DENY-NODE:";
}
+const std::string AccessibilityTreeFormatterQt::GetRunUntilEventString()
+{
+ return "@QT-RUN-UNTIL-EVENT:";
+}
+
#endif // QT_CONFIG(accessibility)
// static
diff --git a/src/core/api/core_api.pro b/src/core/api/core_api.pro
index d53fb6942..2ddd0d69f 100644
--- a/src/core/api/core_api.pro
+++ b/src/core/api/core_api.pro
@@ -26,6 +26,7 @@ CHROMIUM_SRC_DIR = $$QTWEBENGINE_ROOT/$$getChromiumSrcDir()
CHROMIUM_GEN_DIR = $$OUT_PWD/../$$getConfigDir()/gen
INCLUDEPATH += $$QTWEBENGINE_ROOT/src/core \
$$CHROMIUM_GEN_DIR \
+ $$CHROMIUM_SRC_DIR/third_party/abseil-cpp \
$$CHROMIUM_SRC_DIR
gcc: QMAKE_CXXFLAGS_WARN_ON = -Wno-unused-parameter
diff --git a/src/core/browser_main_parts_qt.cpp b/src/core/browser_main_parts_qt.cpp
index 9b8bbf91f..3ffff5778 100644
--- a/src/core/browser_main_parts_qt.cpp
+++ b/src/core/browser_main_parts_qt.cpp
@@ -41,9 +41,9 @@
#include "api/qwebenginemessagepumpscheduler_p.h"
-#include "base/message_loop/message_loop_current.h"
#include "base/message_loop/message_pump_for_ui.h"
#include "base/process/process.h"
+#include "base/task/current_thread.h"
#include "base/task/sequence_manager/sequence_manager_impl.h"
#include "base/task/sequence_manager/thread_controller_with_message_pump_impl.h"
#include "base/threading/thread_restrictions.h"
@@ -149,7 +149,7 @@ private:
void ensureDelegate()
{
if (!m_delegate) {
- auto seqMan = base::MessageLoopCurrent::GetCurrentSequenceManagerImpl();
+ auto seqMan = base::CurrentThread::Get()->GetCurrentSequenceManagerImpl();
m_delegate = static_cast<base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl *>(
seqMan->controller_.get());
}
diff --git a/src/core/browsing_data_remover_delegate_qt.cpp b/src/core/browsing_data_remover_delegate_qt.cpp
index 5b0adc343..6e79ab6c6 100644
--- a/src/core/browsing_data_remover_delegate_qt.cpp
+++ b/src/core/browsing_data_remover_delegate_qt.cpp
@@ -73,7 +73,7 @@ void BrowsingDataRemoverDelegateQt::RemoveEmbedderData(const base::Time &delete_
uint64_t remove_mask,
content::BrowsingDataFilterBuilder *filter_builder,
uint64_t origin_type_mask,
- base::OnceClosure callback)
+ base::OnceCallback<void(/*failed_data_types=*/uint64_t)> callback)
{
Q_UNUSED(delete_begin);
Q_UNUSED(delete_end);
@@ -83,7 +83,7 @@ void BrowsingDataRemoverDelegateQt::RemoveEmbedderData(const base::Time &delete_
if (remove_mask & content::BrowsingDataRemover::DATA_TYPE_CACHE)
web_cache::WebCacheManager::GetInstance()->ClearCache();
- std::move(callback).Run();
+ std::move(callback).Run(0);
}
std::vector<std::string> BrowsingDataRemoverDelegateQt::GetDomainsForDeferredCookieDeletion(uint64_t)
diff --git a/src/core/browsing_data_remover_delegate_qt.h b/src/core/browsing_data_remover_delegate_qt.h
index 2c3a718db..a10409f39 100644
--- a/src/core/browsing_data_remover_delegate_qt.h
+++ b/src/core/browsing_data_remover_delegate_qt.h
@@ -58,7 +58,7 @@ public:
uint64_t remove_mask,
content::BrowsingDataFilterBuilder *filter_builder,
uint64_t origin_type_mask,
- base::OnceClosure callback) override;
+ base::OnceCallback<void(/*failed_data_types=*/uint64_t)> callback) override;
std::vector<std::string> GetDomainsForDeferredCookieDeletion(uint64_t) override;
};
diff --git a/src/core/clipboard_qt.cpp b/src/core/clipboard_qt.cpp
index f47aa8b6c..e353ebc7c 100644
--- a/src/core/clipboard_qt.cpp
+++ b/src/core/clipboard_qt.cpp
@@ -106,7 +106,7 @@ Clipboard *Clipboard::Create()
namespace QtWebEngineCore {
-void ClipboardQt::WritePortableRepresentations(ui::ClipboardBuffer type, const ObjectMap &objects)
+void ClipboardQt::WritePortableRepresentations(ui::ClipboardBuffer type, const ObjectMap &objects, std::unique_ptr<ui::ClipboardDataEndpoint> data_src)
{
DCHECK(CalledOnValidThread());
DCHECK(IsSupportedClipboardBuffer(type));
@@ -125,12 +125,15 @@ void ClipboardQt::WritePortableRepresentations(ui::ClipboardBuffer type, const O
if (text_iter != objects.end()) {
// Copy text and SourceTag to the selection clipboard.
WritePortableRepresentations(ui::ClipboardBuffer::kSelection,
- ObjectMap(text_iter, text_iter + 1));
+ ObjectMap(text_iter, text_iter + 1),
+ std::move(data_src));
}
}
}
-void ClipboardQt::WritePlatformRepresentations(ui::ClipboardBuffer buffer, std::vector<ui::Clipboard::PlatformRepresentation> platform_representations)
+void ClipboardQt::WritePlatformRepresentations(ui::ClipboardBuffer buffer,
+ std::vector<ui::Clipboard::PlatformRepresentation> platform_representations,
+ std::unique_ptr<ui::ClipboardDataEndpoint> data_src)
{
DCHECK(CalledOnValidThread());
DCHECK(IsSupportedClipboardBuffer(buffer));
@@ -188,7 +191,9 @@ void ClipboardQt::WriteData(const ui::ClipboardFormatType &format, const char *d
getUncommittedData()->setData(QString::fromStdString(format.GetName()), QByteArray(data_data, data_len));
}
-bool ClipboardQt::IsFormatAvailable(const ui::ClipboardFormatType &format, ui::ClipboardBuffer type) const
+bool ClipboardQt::IsFormatAvailable(const ui::ClipboardFormatType &format,
+ ui::ClipboardBuffer type,
+ const ui::ClipboardDataEndpoint *data_dst) const
{
const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(
type == ui::ClipboardBuffer::kCopyPaste ? QClipboard::Clipboard : QClipboard::Selection);
@@ -201,7 +206,9 @@ void ClipboardQt::Clear(ui::ClipboardBuffer type)
: QClipboard::Selection);
}
-void ClipboardQt::ReadAvailableTypes(ui::ClipboardBuffer type, std::vector<base::string16> *types) const
+void ClipboardQt::ReadAvailableTypes(ui::ClipboardBuffer type,
+ const ui::ClipboardDataEndpoint *data_dst,
+ std::vector<base::string16> *types) const
{
if (!types) {
NOTREACHED();
@@ -223,7 +230,9 @@ void ClipboardQt::ReadAvailableTypes(ui::ClipboardBuffer type, std::vector<base:
ui::ReadCustomDataTypes(customData.constData(), customData.size(), types);
}
-void ClipboardQt::ReadText(ui::ClipboardBuffer type, base::string16 *result) const
+void ClipboardQt::ReadText(ui::ClipboardBuffer type,
+ const ui::ClipboardDataEndpoint *data_dst,
+ base::string16 *result) const
{
const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(
type == ui::ClipboardBuffer::kCopyPaste ? QClipboard::Clipboard : QClipboard::Selection);
@@ -231,7 +240,9 @@ void ClipboardQt::ReadText(ui::ClipboardBuffer type, base::string16 *result) con
*result = toString16(mimeData->text());
}
-void ClipboardQt::ReadAsciiText(ui::ClipboardBuffer type, std::string *result) const
+void ClipboardQt::ReadAsciiText(ui::ClipboardBuffer type,
+ const ui::ClipboardDataEndpoint *data_dst,
+ std::string *result) const
{
const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(
type == ui::ClipboardBuffer::kCopyPaste ? QClipboard::Clipboard : QClipboard::Selection);
@@ -239,7 +250,9 @@ void ClipboardQt::ReadAsciiText(ui::ClipboardBuffer type, std::string *result) c
*result = mimeData->text().toStdString();
}
-void ClipboardQt::ReadHTML(ui::ClipboardBuffer type, base::string16 *markup, std::string *src_url,
+void ClipboardQt::ReadHTML(ui::ClipboardBuffer type,
+ const ui::ClipboardDataEndpoint *data_dst,
+ base::string16 *markup, std::string *src_url,
uint32_t *fragment_start, uint32_t *fragment_end) const
{
markup->clear();
@@ -256,7 +269,9 @@ void ClipboardQt::ReadHTML(ui::ClipboardBuffer type, base::string16 *markup, std
*fragment_end = static_cast<uint32_t>(markup->length());
}
-void ClipboardQt::ReadRTF(ui::ClipboardBuffer type, std::string *result) const
+void ClipboardQt::ReadRTF(ui::ClipboardBuffer type,
+ const ui::ClipboardDataEndpoint *data_dst,
+ std::string *result) const
{
const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(
type == ui::ClipboardBuffer::kCopyPaste ? QClipboard::Clipboard : QClipboard::Selection);
@@ -266,7 +281,9 @@ void ClipboardQt::ReadRTF(ui::ClipboardBuffer type, std::string *result) const
*result = std::string(byteArray.constData(), byteArray.length());
}
-void ClipboardQt::ReadImage(ui::ClipboardBuffer type, ReadImageCallback callback) const
+void ClipboardQt::ReadImage(ui::ClipboardBuffer type,
+ const ui::ClipboardDataEndpoint *data_dst,
+ ReadImageCallback callback) const
{
const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(
type == ui::ClipboardBuffer::kCopyPaste ? QClipboard::Clipboard : QClipboard::Selection);
@@ -292,7 +309,9 @@ void ClipboardQt::ReadImage(ui::ClipboardBuffer type, ReadImageCallback callback
return std::move(callback).Run(bitmap);
}
-void ClipboardQt::ReadCustomData(ui::ClipboardBuffer clipboard_type, const base::string16 &type, base::string16 *result) const
+void ClipboardQt::ReadCustomData(ui::ClipboardBuffer clipboard_type, const base::string16 &type,
+ const ui::ClipboardDataEndpoint *data_dst,
+ base::string16 *result) const
{
const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(
clipboard_type == ui::ClipboardBuffer::kCopyPaste ? QClipboard::Clipboard : QClipboard::Selection);
@@ -302,12 +321,14 @@ void ClipboardQt::ReadCustomData(ui::ClipboardBuffer clipboard_type, const base:
ui::ReadCustomDataForType(customData.constData(), customData.size(), type, result);
}
-void ClipboardQt::ReadBookmark(base::string16 *title, std::string *url) const
+void ClipboardQt::ReadBookmark(const ui::ClipboardDataEndpoint *data_dst, base::string16 *title, std::string *url) const
{
NOTIMPLEMENTED();
}
-void ClipboardQt::ReadData(const ui::ClipboardFormatType &format, std::string *result) const
+void ClipboardQt::ReadData(const ui::ClipboardFormatType &format,
+ const ui::ClipboardDataEndpoint *data_dst,
+ std::string *result) const
{
const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData();
if (!mimeData)
@@ -322,17 +343,29 @@ uint64_t ClipboardQt::GetSequenceNumber(ui::ClipboardBuffer type) const
: QClipboard::Selection);
}
-std::vector<base::string16> ClipboardQt::ReadAvailablePlatformSpecificFormatNames(ui::ClipboardBuffer buffer) const
+void ClipboardQt::SetClipboardDlpController(std::unique_ptr<ui::ClipboardDlpController>)
+{
+ NOTIMPLEMENTED();
+}
+
+#if defined(USE_OZONE)
+bool ClipboardQt::IsSelectionBufferAvailable() const
+{
+ return QGuiApplication::clipboard()->supportsSelection();
+}
+#endif
+
+std::vector<base::string16> ClipboardQt::ReadAvailablePlatformSpecificFormatNames(ui::ClipboardBuffer buffer, const ui::ClipboardDataEndpoint *data_dst) const
{
// based on ClipboardAura
std::vector<base::string16> types;
- if (IsFormatAvailable(ui::ClipboardFormatType::GetPlainTextType(), buffer))
+ if (IsFormatAvailable(ui::ClipboardFormatType::GetPlainTextType(), buffer, data_dst))
types.push_back(base::UTF8ToUTF16(ui::ClipboardFormatType::GetPlainTextType().GetName()));
- if (IsFormatAvailable(ui::ClipboardFormatType::GetHtmlType(), buffer))
+ if (IsFormatAvailable(ui::ClipboardFormatType::GetHtmlType(), buffer, data_dst))
types.push_back(base::UTF8ToUTF16(ui::ClipboardFormatType::GetHtmlType().GetName()));
- if (IsFormatAvailable(ui::ClipboardFormatType::GetRtfType(), buffer))
+ if (IsFormatAvailable(ui::ClipboardFormatType::GetRtfType(), buffer, data_dst))
types.push_back(base::UTF8ToUTF16(ui::ClipboardFormatType::GetRtfType().GetName()));
- if (IsFormatAvailable(ui::ClipboardFormatType::GetBitmapType(), buffer))
+ if (IsFormatAvailable(ui::ClipboardFormatType::GetBitmapType(), buffer, data_dst))
types.push_back(base::UTF8ToUTF16(ui::kMimeTypePNG));
return types;
diff --git a/src/core/clipboard_qt.h b/src/core/clipboard_qt.h
index 79ffbb0b9..f079888f5 100644
--- a/src/core/clipboard_qt.h
+++ b/src/core/clipboard_qt.h
@@ -44,30 +44,43 @@
namespace QtWebEngineCore {
-class ClipboardQt : public ui::Clipboard {
+class ClipboardQt : public ui::Clipboard
+{
public:
uint64_t GetSequenceNumber(ui::ClipboardBuffer type) const override;
- bool IsFormatAvailable(const ui::ClipboardFormatType &format, ui::ClipboardBuffer type) const override;
+ bool IsFormatAvailable(const ui::ClipboardFormatType &format,
+ ui::ClipboardBuffer buffer,
+ const ui::ClipboardDataEndpoint *data_dst) const override;
void Clear(ui::ClipboardBuffer type) override;
- void ReadAvailableTypes(ui::ClipboardBuffer type, std::vector<base::string16> *types) const override;
- void ReadText(ui::ClipboardBuffer type, base::string16 *result) const override;
- void ReadAsciiText(ui::ClipboardBuffer type, std::string *result) const override;
- void ReadHTML(ui::ClipboardBuffer type, base::string16 *markup, std::string *src_url, uint32_t *fragment_start,
+ void ReadAvailableTypes(ui::ClipboardBuffer type,
+ const ui::ClipboardDataEndpoint *data_dst,
+ std::vector<base::string16> *types) const override;
+ void ReadText(ui::ClipboardBuffer type, const ui::ClipboardDataEndpoint *data_dst, base::string16 *result) const override;
+ void ReadAsciiText(ui::ClipboardBuffer type, const ui::ClipboardDataEndpoint *data_dst, std::string *result) const override;
+ void ReadHTML(ui::ClipboardBuffer type, const ui::ClipboardDataEndpoint *data_dst, 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;
- 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;
-
+ void ReadRTF(ui::ClipboardBuffer type, const ui::ClipboardDataEndpoint *data_dst, std::string *result) const override;
+ void ReadImage(ui::ClipboardBuffer buffer, const ui::ClipboardDataEndpoint *data_dst, ReadImageCallback callback) const override;
+ void ReadCustomData(ui::ClipboardBuffer clipboard_type, const base::string16 &type, const ui::ClipboardDataEndpoint *data_dst, base::string16 *result) const override;
+ void ReadBookmark(const ui::ClipboardDataEndpoint *data_dst, base::string16 *title, std::string *url) const override;
+ void ReadData(const ui::ClipboardFormatType &format, const ui::ClipboardDataEndpoint *data_dst, std::string *result) const override;
+ void SetClipboardDlpController(std::unique_ptr<ui::ClipboardDlpController>) override;
+#if defined(USE_OZONE)
+ bool IsSelectionBufferAvailable() const override;
+#endif
void OnPreShutdown() override {}
- std::vector<base::string16> ReadAvailablePlatformSpecificFormatNames(ui::ClipboardBuffer buffer) const override;
+ std::vector<base::string16> ReadAvailablePlatformSpecificFormatNames(ui::ClipboardBuffer buffer, const ui::ClipboardDataEndpoint *data_dst) const override;
protected:
- void WritePortableRepresentations(ui::ClipboardBuffer type, const ObjectMap &objects) override;
- void WritePlatformRepresentations(ui::ClipboardBuffer type,
- std::vector<ui::Clipboard::PlatformRepresentation> platform_representations) override;
+ void WritePortableRepresentations(
+ ui::ClipboardBuffer buffer,
+ const ObjectMap &objects,
+ std::unique_ptr<ui::ClipboardDataEndpoint> data_src) override;
+ void WritePlatformRepresentations(
+ ui::ClipboardBuffer buffer,
+ std::vector<Clipboard::PlatformRepresentation> platform_representations,
+ std::unique_ptr<ui::ClipboardDataEndpoint> data_src) override;
void WriteText(const char *text_data, size_t text_len) override;
void WriteHTML(const char *markup_data, size_t markup_len, const char *url_data, size_t url_len) override;
void WriteRTF(const char *rtf_data, size_t data_len) override;
diff --git a/src/core/common/extensions/extensions_client_qt.cpp b/src/core/common/extensions/extensions_client_qt.cpp
index dd1de1483..c4cc2321a 100644
--- a/src/core/common/extensions/extensions_client_qt.cpp
+++ b/src/core/common/extensions/extensions_client_qt.cpp
@@ -108,18 +108,18 @@ void ExtensionsClientQt::FilterHostPermissions(const URLPatternSet &hosts,
{
}
-// Replaces the scripting whitelist with |whitelist|. Used in the renderer{}
+// Replaces the scripting allowlist with |allowlist|. Used in the renderer{}
// only used for testing in the browser process.
-void ExtensionsClientQt::SetScriptingWhitelist(const ExtensionsClient::ScriptingWhitelist &whitelist)
+void ExtensionsClientQt::SetScriptingAllowlist(const ExtensionsClient::ScriptingAllowlist &allowlist)
{
- scripting_whitelist_ = whitelist;
+ scripting_allowlist_ = allowlist;
}
-// Return the whitelist of extensions that can run content scripts on
+// Return the allowlist of extensions that can run content scripts on
// any origin.
-const ExtensionsClient::ScriptingWhitelist &ExtensionsClientQt::GetScriptingWhitelist() const
+const ExtensionsClient::ScriptingAllowlist &ExtensionsClientQt::GetScriptingAllowlist() const
{
- return scripting_whitelist_;
+ return scripting_allowlist_;
}
// Get the set of chrome:// hosts that |extension| can run content scripts on.
diff --git a/src/core/common/extensions/extensions_client_qt.h b/src/core/common/extensions/extensions_client_qt.h
index e689f76b7..2466e14e3 100644
--- a/src/core/common/extensions/extensions_client_qt.h
+++ b/src/core/common/extensions/extensions_client_qt.h
@@ -87,13 +87,13 @@ public:
URLPatternSet *new_hosts,
PermissionIDSet *permissions) const override;
- // Replaces the scripting whitelist with |whitelist|. Used in the renderer;
+ // Replaces the scripting allowlist with |allowlist|. Used in the renderer;
// only used for testing in the browser process.
- void SetScriptingWhitelist(const ScriptingWhitelist &whitelist) override;
+ void SetScriptingAllowlist(const ScriptingAllowlist &allowlist) override;
- // Return the whitelist of extensions that can run content scripts on
+ // Return the allowlist of extensions that can run content scripts on
// any origin.
- const ScriptingWhitelist &GetScriptingWhitelist() const override;
+ const ScriptingAllowlist &GetScriptingAllowlist() const override;
// Get the set of chrome:// hosts that |extension| can run content scripts on.
URLPatternSet GetPermittedChromeSchemeHosts(const Extension *extension,
@@ -127,7 +127,7 @@ public:
static ExtensionsClientQt *GetInstance();
private:
- ScriptingWhitelist scripting_whitelist_;
+ ScriptingAllowlist scripting_allowlist_;
const ChromePermissionMessageProvider permission_message_provider_;
mutable GURL update_url_;
mutable GURL base_url_;
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp
index 9c5299565..84296b032 100644
--- a/src/core/content_browser_client_qt.cpp
+++ b/src/core/content_browser_client_qt.cpp
@@ -55,11 +55,7 @@
#include "components/navigation_interception/navigation_params.h"
#include "components/network_hints/browser/simple_network_hints_handler_impl.h"
#include "components/performance_manager/embedder/performance_manager_registry.h"
-#include "components/performance_manager/graph/process_node_impl.h"
-#include "components/performance_manager/performance_manager_impl.h"
-#include "components/performance_manager/public/mojom/coordination_unit.mojom.h"
#include "components/performance_manager/public/performance_manager.h"
-#include "components/performance_manager/render_process_user_data.h"
#include "components/spellcheck/spellcheck_buildflags.h"
#include "content/browser/renderer_host/render_view_host_delegate.h"
#include "content/browser/web_contents/web_contents_impl.h"
@@ -97,11 +93,11 @@
#include "qtwebengine/browser/qtwebengine_content_renderer_overlay_manifest.h"
#include "net/ssl/client_cert_identity.h"
#include "net/ssl/client_cert_store.h"
+#include "sandbox/policy/switches.h"
#include "services/network/network_service.h"
#include "services/network/public/cpp/features.h"
#include "services/service_manager/public/cpp/connector.h"
#include "services/service_manager/public/cpp/service.h"
-#include "services/service_manager/sandbox/switches.h"
#include "storage/browser/quota/quota_settings.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h"
#include "third_party/blink/public/common/loader/url_loader_throttle.h"
@@ -274,7 +270,7 @@ public:
}
void* GetHandle() override { return m_handle; }
- unsigned int CheckStickyGraphicsResetStatus() override
+ unsigned int CheckStickyGraphicsResetStatusImpl() override
{
#if QT_CONFIG(opengl)
if (QOpenGLContext *context = qt_gl_global_share_context()) {
@@ -287,7 +283,7 @@ public:
// We don't care about the rest, this context shouldn't be used except for its handle.
bool Initialize(gl::GLSurface *, const gl::GLContextAttribs &) override { Q_UNREACHABLE(); return false; }
- bool MakeCurrent(gl::GLSurface *) override { Q_UNREACHABLE(); return false; }
+ bool MakeCurrentImpl(gl::GLSurface *) override { Q_UNREACHABLE(); return false; }
void ReleaseCurrent(gl::GLSurface *) override { Q_UNREACHABLE(); }
bool IsCurrent(gl::GLSurface *) override { Q_UNREACHABLE(); return false; }
scoped_refptr<gl::GPUTimingClient> CreateGPUTimingClient() override
@@ -1098,6 +1094,7 @@ std::vector<base::FilePath> ContentBrowserClientQt::GetNetworkContextsParentDire
}
void ContentBrowserClientQt::RegisterNonNetworkNavigationURLLoaderFactories(int frame_tree_node_id,
+ base::UkmSourceId ukm_source_id,
NonNetworkURLLoaderFactoryMap *factories)
{
content::WebContents *web_contents = content::WebContents::FromFrameTreeNodeId(frame_tree_node_id);
@@ -1110,7 +1107,7 @@ void ContentBrowserClientQt::RegisterNonNetworkNavigationURLLoaderFactories(int
#if BUILDFLAG(ENABLE_EXTENSIONS)
factories->emplace(
extensions::kExtensionScheme,
- extensions::CreateExtensionNavigationURLLoaderFactory(profile,
+ extensions::CreateExtensionNavigationURLLoaderFactory(profile, ukm_source_id,
!!extensions::WebViewGuest::FromWebContents(web_contents)));
#endif
}
diff --git a/src/core/content_browser_client_qt.h b/src/core/content_browser_client_qt.h
index a78787c5c..bf2ebae36 100644
--- a/src/core/content_browser_client_qt.h
+++ b/src/core/content_browser_client_qt.h
@@ -250,7 +250,7 @@ public:
network::mojom::CertVerifierCreationParams *cert_verifier_creation_params) override;
std::vector<base::FilePath> GetNetworkContextsParentDirectory() override;
- void RegisterNonNetworkNavigationURLLoaderFactories(int frame_tree_node_id, NonNetworkURLLoaderFactoryMap *factories) override;
+ void RegisterNonNetworkNavigationURLLoaderFactories(int frame_tree_node_id, base::UkmSourceId ukm_source_id, NonNetworkURLLoaderFactoryMap *factories) override;
void RegisterNonNetworkSubresourceURLLoaderFactories(int render_process_id, int render_frame_id,
NonNetworkURLLoaderFactoryMap* factories) override;
void RegisterNonNetworkWorkerMainResourceURLLoaderFactories(content::BrowserContext* browser_context,
diff --git a/src/core/content_main_delegate_qt.cpp b/src/core/content_main_delegate_qt.cpp
index cf8582ef2..9971a4ac5 100644
--- a/src/core/content_main_delegate_qt.cpp
+++ b/src/core/content_main_delegate_qt.cpp
@@ -42,6 +42,7 @@
#include "base/command_line.h"
#include "base/i18n/rtl.h"
#include "base/logging.h"
+#include "base/no_destructor.h"
#include "base/path_service.h"
#include "base/strings/string_number_conversions.h"
#include "chrome/grit/generated_resources.h"
@@ -55,8 +56,8 @@
#include "ui/base/webui/jstemplate_builder.h"
#include "net/grit/net_resources.h"
#include "net/base/net_module.h"
+#include "sandbox/policy/switches.h"
#include "services/service_manager/embedder/switches.h"
-#include "services/service_manager/sandbox/switches.h"
#include "url/url_util_qt.h"
#include "content_client_qt.h"
@@ -260,7 +261,7 @@ content::ContentRendererClient *ContentMainDelegateQt::CreateContentRendererClie
#if defined(OS_LINUX)
base::CommandLine *parsedCommandLine = base::CommandLine::ForCurrentProcess();
std::string process_type = parsedCommandLine->GetSwitchValueASCII(switches::kProcessType);
- bool no_sandbox = parsedCommandLine->HasSwitch(service_manager::switches::kNoSandbox);
+ bool no_sandbox = parsedCommandLine->HasSwitch(sandbox::policy::switches::kNoSandbox);
// Reload locale if the renderer process is sandboxed
if (process_type == switches::kRendererProcess && !no_sandbox) {
diff --git a/src/core/desktop_screen_qt.cpp b/src/core/desktop_screen_qt.cpp
index a6734231f..1f715444b 100644
--- a/src/core/desktop_screen_qt.cpp
+++ b/src/core/desktop_screen_qt.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
@@ -40,82 +40,20 @@
#include "desktop_screen_qt.h"
#include "ui/display/display.h"
-#include "ui/gfx/geometry/point.h"
-
-#include <QtGlobal>
namespace QtWebEngineCore {
-gfx::Point DesktopScreenQt::GetCursorScreenPoint()
-{
- Q_UNREACHABLE();
- return gfx::Point();
-}
-
-bool DesktopScreenQt::IsWindowUnderCursor(gfx::NativeWindow)
-{
- Q_UNREACHABLE();
- return false;
-}
-
-gfx::NativeWindow DesktopScreenQt::GetWindowAtScreenPoint(const gfx::Point& point)
-{
- Q_UNREACHABLE();
- return gfx::NativeWindow();
-}
-
-int DesktopScreenQt::GetNumDisplays() const
-{
- Q_UNREACHABLE();
- return 0;
-}
-
-std::vector<display::Display>& DesktopScreenQt::GetAllDisplays() const
-{
- static std::vector<display::Display> empty;
- return empty;
-}
-
-display::Display DesktopScreenQt::GetDisplayNearestWindow(gfx::NativeWindow window) const
-{
- // RenderViewHostImpl::OnStartDragging uses this to determine
- // the scale factor for the view.
- return display::Display(0);
-}
-
-display::Display DesktopScreenQt::GetDisplayNearestPoint(const gfx::Point& point) const
+DesktopScreenQt::DesktopScreenQt()
{
- Q_UNREACHABLE();
- return display::Display();
+ ProcessDisplayChanged(display::Display::GetDefaultDisplay(), true /* is_primary */);
}
-display::Display DesktopScreenQt::GetDisplayMatching(const gfx::Rect& match_rect) const
-{
- Q_UNREACHABLE();
- return display::Display();
-}
-
-display::Display DesktopScreenQt::GetPrimaryDisplay() const
-{
- return display::Display(0);
-}
-
-void DesktopScreenQt::AddObserver(display::DisplayObserver *observer)
-{
- m_observers.insert(observer);
-}
-
-void DesktopScreenQt::RemoveObserver(display::DisplayObserver *observer)
-{
- m_observers.erase(observer);
-}
+DesktopScreenQt::~DesktopScreenQt()
+{}
-gfx::NativeWindow DesktopScreenQt::GetLocalProcessWindowAtPoint(
- const gfx::Point &point,
- const std::set<gfx::NativeWindow> &ignore)
+display::Display DesktopScreenQt::GetDisplayNearestWindow(gfx::NativeWindow /*window*/) const
{
- Q_UNREACHABLE();
- return gfx::NativeWindow();
+ return GetPrimaryDisplay();
}
} // namespace QtWebEngineCore
diff --git a/src/core/desktop_screen_qt.h b/src/core/desktop_screen_qt.h
index f6b252789..f47cfabbc 100644
--- a/src/core/desktop_screen_qt.h
+++ b/src/core/desktop_screen_qt.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
@@ -40,32 +40,17 @@
#ifndef DESKTOP_SCREEN_QT_H
#define DESKTOP_SCREEN_QT_H
-#include "ui/display/screen.h"
-
-#include <set>
+#include "ui/display/screen_base.h"
namespace QtWebEngineCore {
-class DesktopScreenQt : public display::Screen
+class DesktopScreenQt : public display::ScreenBase
{
public:
- // Overridden from gfx::Screen:
- gfx::Point GetCursorScreenPoint() override;
- bool IsWindowUnderCursor(gfx::NativeWindow) override;
- gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override;
- int GetNumDisplays() const override;
- std::vector<display::Display>& GetAllDisplays() const override;
- display::Display GetDisplayNearestWindow(gfx::NativeWindow window) const override;
- display::Display GetDisplayNearestPoint(const gfx::Point& point) const override;
- display::Display GetDisplayMatching(const gfx::Rect& match_rect) const override;
- display::Display GetPrimaryDisplay() const override;
- void AddObserver(display::DisplayObserver* observer) override;
- void RemoveObserver(display::DisplayObserver* observer) override;
+ DesktopScreenQt();
+ ~DesktopScreenQt() override;
- gfx::NativeWindow GetLocalProcessWindowAtPoint(const gfx::Point &point,
- const std::set<gfx::NativeWindow> &ignore) override;
-private:
- std::set<display::DisplayObserver *> m_observers;
+ display::Display GetDisplayNearestWindow(gfx::NativeWindow /*window*/) const override;
};
} // namespace QtWebEngineCore
diff --git a/src/core/file_picker_controller.cpp b/src/core/file_picker_controller.cpp
index 65e2c6f00..334321273 100644
--- a/src/core/file_picker_controller.cpp
+++ b/src/core/file_picker_controller.cpp
@@ -53,16 +53,32 @@
namespace QtWebEngineCore {
-FilePickerController::FilePickerController(FileChooserMode mode, std::unique_ptr<content::FileSelectListener> listener, const QString &defaultFileName, const QStringList &acceptedMimeTypes, QObject *parent)
+class FilePickerControllerPrivate {
+public:
+ FilePickerController::FileChooserMode mode;
+ scoped_refptr<content::FileSelectListener> listener;
+ QString defaultFileName;
+ QStringList acceptedMimeTypes;
+};
+
+FilePickerController *createFilePickerController(
+ FilePickerController::FileChooserMode mode, scoped_refptr<content::FileSelectListener> listener,
+ const QString &defaultFileName, const QStringList &acceptedMimeTypes, QObject *parent = nullptr)
+{
+ auto priv = new FilePickerControllerPrivate{mode, listener, defaultFileName, acceptedMimeTypes};
+ return new FilePickerController(priv, parent);
+}
+
+FilePickerController::FilePickerController(FilePickerControllerPrivate *priv, QObject *parent)
: QObject(parent)
- , m_defaultFileName(defaultFileName)
- , m_acceptedMimeTypes(acceptedMimeTypes)
- , m_listener(std::move(listener))
- , m_mode(mode)
+ , d_ptr(priv)
{
}
-FilePickerController::~FilePickerController() = default;
+FilePickerController::~FilePickerController()
+{
+ delete d_ptr;
+}
void FilePickerController::accepted(const QStringList &files)
{
@@ -178,7 +194,7 @@ ASSERT_ENUMS_MATCH(FilePickerController::Save, blink::mojom::FileChooserParams_M
void FilePickerController::filesSelectedInChooser(const QStringList &filesList)
{
QStringList files(filesList);
- if (this->m_mode == UploadFolder && !filesList.isEmpty()
+ if (d_ptr->mode == UploadFolder && !filesList.isEmpty()
&& QFileInfo(filesList.first()).isDir()) // Enumerate the directory
files = listRecursively(QDir(filesList.first()));
@@ -189,26 +205,26 @@ void FilePickerController::filesSelectedInChooser(const QStringList &filesList)
}
if (files.isEmpty())
- m_listener->FileSelectionCanceled();
+ d_ptr->listener->FileSelectionCanceled();
else
- m_listener->FileSelected(std::move(chooser_files),
+ d_ptr->listener->FileSelected(std::move(chooser_files),
/* FIXME? */ base::FilePath(),
- static_cast<blink::mojom::FileChooserParams::Mode>(this->m_mode));
+ static_cast<blink::mojom::FileChooserParams::Mode>(d_ptr->mode));
}
QStringList FilePickerController::acceptedMimeTypes() const
{
- return m_acceptedMimeTypes;
+ return d_ptr->acceptedMimeTypes;
}
FilePickerController::FileChooserMode FilePickerController::mode() const
{
- return m_mode;
+ return d_ptr->mode;
}
QString FilePickerController::defaultFileName() const
{
- return m_defaultFileName;
+ return d_ptr->defaultFileName;
}
QStringList FilePickerController::nameFilters(const QStringList &acceptedMimeTypes)
diff --git a/src/core/file_picker_controller.h b/src/core/file_picker_controller.h
index 0b680161a..0b84c889e 100644
--- a/src/core/file_picker_controller.h
+++ b/src/core/file_picker_controller.h
@@ -53,17 +53,12 @@
#include "qtwebenginecoreglobal_p.h"
-#include <memory>
-
#include <QObject>
#include <QStringList>
-namespace content {
- class FileSelectListener;
-}
-
namespace QtWebEngineCore {
+class FilePickerControllerPrivate;
class Q_WEBENGINECORE_PRIVATE_EXPORT FilePickerController : public QObject {
Q_OBJECT
public:
@@ -74,8 +69,9 @@ public:
Save
};
- FilePickerController(FileChooserMode mode, std::unique_ptr<content::FileSelectListener> listener, const QString &defaultFileName, const QStringList &acceptedMimeTypes, QObject * = 0);
+ FilePickerController(FilePickerControllerPrivate *priv, QObject *parent = nullptr);
~FilePickerController() override;
+
QStringList acceptedMimeTypes() const;
QString defaultFileName() const;
FileChooserMode mode() const;
@@ -89,13 +85,9 @@ public Q_SLOTS:
private:
void filesSelectedInChooser(const QStringList &filesList);
- QString m_defaultFileName;
- QStringList m_acceptedMimeTypes;
- std::unique_ptr<content::FileSelectListener> m_listener;
- FileChooserMode m_mode;
-
+ FilePickerControllerPrivate *d_ptr;
};
-} // namespace
+} // namespace QtWebEngineCore
#endif // FILE_PICKER_CONTROLLER_H
diff --git a/src/core/net/cookie_monster_delegate_qt.cpp b/src/core/net/cookie_monster_delegate_qt.cpp
index 3d3403a54..792d34373 100644
--- a/src/core/net/cookie_monster_delegate_qt.cpp
+++ b/src/core/net/cookie_monster_delegate_qt.cpp
@@ -273,10 +273,10 @@ void CookieMonsterDelegateQt::GetAllCookiesCallbackOnUIThread(qint64 callbackId,
m_client->d_func()->onGetAllCallbackResult(callbackId, rawCookies);
}
-void CookieMonsterDelegateQt::SetCookieCallbackOnUIThread(qint64 callbackId, net::CookieInclusionStatus status)
+void CookieMonsterDelegateQt::SetCookieCallbackOnUIThread(qint64 callbackId, net::CookieAccessResult status)
{
if (m_client)
- m_client->d_func()->onSetCallbackResult(callbackId, status.IsInclude());
+ m_client->d_func()->onSetCallbackResult(callbackId, status.status.IsInclude());
}
void CookieMonsterDelegateQt::DeleteCookiesCallbackOnUIThread(qint64 callbackId, uint numCookies)
diff --git a/src/core/net/cookie_monster_delegate_qt.h b/src/core/net/cookie_monster_delegate_qt.h
index 6e9007443..fe1ed5be6 100644
--- a/src/core/net/cookie_monster_delegate_qt.h
+++ b/src/core/net/cookie_monster_delegate_qt.h
@@ -120,7 +120,7 @@ public:
private:
void GetAllCookiesCallbackOnUIThread(qint64 callbackId, const net::CookieList &cookies);
- void SetCookieCallbackOnUIThread(qint64 callbackId, net::CookieInclusionStatus status);
+ void SetCookieCallbackOnUIThread(qint64 callbackId, net::CookieAccessResult status);
void DeleteCookiesCallbackOnUIThread(qint64 callbackId, uint numCookies);
};
diff --git a/src/core/net/custom_url_loader_factory.cpp b/src/core/net/custom_url_loader_factory.cpp
index 26436f36a..43facd30c 100644
--- a/src/core/net/custom_url_loader_factory.cpp
+++ b/src/core/net/custom_url_loader_factory.cpp
@@ -288,9 +288,9 @@ private:
if (!m_redirect.is_empty()) {
m_head->content_length = m_head->encoded_body_length = -1;
- net::URLRequest::FirstPartyURLPolicy first_party_url_policy =
- m_request.update_first_party_url_on_redirect ? net::URLRequest::UPDATE_FIRST_PARTY_URL_ON_REDIRECT
- : net::URLRequest::NEVER_CHANGE_FIRST_PARTY_URL;
+ net::RedirectInfo::FirstPartyURLPolicy first_party_url_policy =
+ m_request.update_first_party_url_on_redirect ? net::RedirectInfo::FirstPartyURLPolicy::UPDATE_URL_ON_REDIRECT
+ : net::RedirectInfo::FirstPartyURLPolicy::NEVER_CHANGE_URL;
net::RedirectInfo redirectInfo = net::RedirectInfo::ComputeRedirectInfo(
m_request.method, m_request.url,
m_request.site_for_cookies,
diff --git a/src/core/net/proxying_url_loader_factory_qt.cpp b/src/core/net/proxying_url_loader_factory_qt.cpp
index f63e78861..dfc17e440 100644
--- a/src/core/net/proxying_url_loader_factory_qt.cpp
+++ b/src/core/net/proxying_url_loader_factory_qt.cpp
@@ -308,9 +308,9 @@ void InterceptedRequest::ContinueAfterIntercept()
}
if (info.shouldRedirectRequest) {
- net::URLRequest::FirstPartyURLPolicy first_party_url_policy =
- request_.update_first_party_url_on_redirect ? net::URLRequest::UPDATE_FIRST_PARTY_URL_ON_REDIRECT
- : net::URLRequest::NEVER_CHANGE_FIRST_PARTY_URL;
+ net::RedirectInfo::FirstPartyURLPolicy first_party_url_policy =
+ request_.update_first_party_url_on_redirect ? net::RedirectInfo::FirstPartyURLPolicy::UPDATE_URL_ON_REDIRECT
+ : net::RedirectInfo::FirstPartyURLPolicy::NEVER_CHANGE_URL;
net::RedirectInfo redirectInfo = net::RedirectInfo::ComputeRedirectInfo(
request_.method, request_.url, request_.site_for_cookies,
first_party_url_policy, request_.referrer_policy, request_.referrer.spec(),
diff --git a/src/core/net/system_network_context_manager.cpp b/src/core/net/system_network_context_manager.cpp
index affc228cf..99a207c0e 100644
--- a/src/core/net/system_network_context_manager.cpp
+++ b/src/core/net/system_network_context_manager.cpp
@@ -101,7 +101,7 @@ network::mojom::HttpAuthDynamicParamsPtr CreateHttpAuthDynamicParams()
network::mojom::HttpAuthDynamicParamsPtr auth_dynamic_params = network::mojom::HttpAuthDynamicParams::New();
auto *command_line = base::CommandLine::ForCurrentProcess();
- auth_dynamic_params->server_allowlist = command_line->GetSwitchValueASCII(switches::kAuthServerWhitelist);
+ auth_dynamic_params->server_allowlist = command_line->GetSwitchValueASCII(switches::kAuthServerAllowlist);
// auth_dynamic_params->delegate_allowlist = command_line->GetSwitchValueASCII(switches::kAuthNegotiateDelegateWhitelist);
// auth_dynamic_params->enable_negotiate_port = command_line->HasSwitch(switches::kEnableAuthNegotiatePort);
diff --git a/src/core/ozone/gl_surface_egl_qt.cpp b/src/core/ozone/gl_surface_egl_qt.cpp
index 4a168ce3c..c4910fddb 100644
--- a/src/core/ozone/gl_surface_egl_qt.cpp
+++ b/src/core/ozone/gl_surface_egl_qt.cpp
@@ -186,6 +186,11 @@ bool GLSurfaceEGL::IsANGLEPowerPreferenceSupported()
return false;
}
+bool GLSurfaceEGL::IsDisplaySemaphoreShareGroupSupported()
+{
+ return false;
+}
+
void GLSurfaceEGL::ShutdownOneOff()
{
}
diff --git a/src/core/permission_manager_qt.cpp b/src/core/permission_manager_qt.cpp
index a1b481946..c79a7ae45 100644
--- a/src/core/permission_manager_qt.cpp
+++ b/src/core/permission_manager_qt.cpp
@@ -86,6 +86,9 @@ static ProfileAdapter::PermissionType toQt(content::PermissionType type)
case content::PermissionType::AR:
case content::PermissionType::VR:
case content::PermissionType::STORAGE_ACCESS_GRANT:
+ case content::PermissionType::CAMERA_PAN_TILT_ZOOM: // FIXME: This one seems to be checked together with webrtc
+ case content::PermissionType::WINDOW_PLACEMENT:
+ case content::PermissionType::FONT_ACCESS:
case content::PermissionType::NUM:
LOG(INFO) << "Unsupported permission type: " << static_cast<int>(type);
break;
diff --git a/src/core/pref_service_adapter.cpp b/src/core/pref_service_adapter.cpp
index 65dfb73ee..ff653c066 100644
--- a/src/core/pref_service_adapter.cpp
+++ b/src/core/pref_service_adapter.cpp
@@ -101,7 +101,7 @@ void PrefServiceAdapter::setup(const ProfileAdapter &profileAdapter)
registry->RegisterStringPref(language::prefs::kAcceptLanguages, std::string());
registry->RegisterListPref(spellcheck::prefs::kSpellCheckDictionaries);
registry->RegisterListPref(spellcheck::prefs::kSpellCheckForcedDictionaries);
- registry->RegisterListPref(spellcheck::prefs::kSpellCheckBlacklistedDictionaries);
+ registry->RegisterListPref(spellcheck::prefs::kSpellCheckBlocklistedDictionaries);
registry->RegisterStringPref(spellcheck::prefs::kSpellCheckDictionary, std::string());
registry->RegisterBooleanPref(spellcheck::prefs::kSpellCheckEnable, false);
registry->RegisterBooleanPref(spellcheck::prefs::kSpellCheckUseSpellingService, false);
@@ -120,8 +120,8 @@ void PrefServiceAdapter::setup(const ProfileAdapter &profileAdapter)
registry->RegisterBooleanPref(extensions::pref_names::kStorageGarbageCollect, false);
registry->RegisterListPref(extensions::pref_names::kAllowedInstallSites);
registry->RegisterStringPref(extensions::pref_names::kLastChromeVersion, std::string());
- registry->RegisterListPref(extensions::pref_names::kNativeMessagingBlacklist);
- registry->RegisterListPref(extensions::pref_names::kNativeMessagingWhitelist);
+ registry->RegisterListPref(extensions::pref_names::kNativeMessagingBlocklist);
+ registry->RegisterListPref(extensions::pref_names::kNativeMessagingAllowlist);
registry->RegisterBooleanPref(extensions::pref_names::kNativeMessagingUserLevelHosts, true);
#endif // BUILDFLAG(ENABLE_EXTENSIONS)
diff --git a/src/core/printing/print_view_manager_base_qt.cpp b/src/core/printing/print_view_manager_base_qt.cpp
index 0c49a7bbc..0f7ec1c70 100644
--- a/src/core/printing/print_view_manager_base_qt.cpp
+++ b/src/core/printing/print_view_manager_base_qt.cpp
@@ -48,9 +48,9 @@
#include "web_engine_context.h"
#include "base/memory/ref_counted_memory.h"
-#include "base/message_loop/message_loop_current.h"
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
+#include "base/task/current_thread.h"
#include "base/task/post_task.h"
#include "base/timer/timer.h"
#include "base/values.h"
@@ -149,7 +149,7 @@ printing::PrintedDocument *PrintViewManagerBaseQt::GetDocument(int cookie)
// IPC handlers
void PrintViewManagerBaseQt::OnDidPrintDocument(content::RenderFrameHost* /*render_frame_host*/,
- const PrintHostMsg_DidPrintDocument_Params &params,
+ const printing::mojom::DidPrintDocumentParams &params,
std::unique_ptr<DelayedFrameDispatchHelper> helper)
{
printing::PrintedDocument *document = GetDocument(params.document_cookie);
@@ -157,13 +157,13 @@ void PrintViewManagerBaseQt::OnDidPrintDocument(content::RenderFrameHost* /*rend
return;
const auto &content = params.content;
- if (!content.metafile_data_region.IsValid()) {
+ if (!content->metafile_data_region.IsValid()) {
NOTREACHED() << "invalid memory handle";
web_contents()->Stop();
return;
}
- auto data = base::RefCountedSharedMemoryMapping::CreateFromWholeRegion(content.metafile_data_region);
+ auto data = base::RefCountedSharedMemoryMapping::CreateFromWholeRegion(content->metafile_data_region);
if (!data) {
NOTREACHED() << "couldn't map";
web_contents()->Stop();
@@ -457,7 +457,7 @@ bool PrintViewManagerBaseQt::RunInnerMessageLoop() {
// Need to enable recursive task.
{
- base::MessageLoopCurrent::ScopedNestableTaskAllower allow;
+ base::CurrentThread::ScopedNestableTaskAllower allow;
run_loop.Run();
}
diff --git a/src/core/printing/print_view_manager_base_qt.h b/src/core/printing/print_view_manager_base_qt.h
index 1217e8c11..8d6c3fc7a 100644
--- a/src/core/printing/print_view_manager_base_qt.h
+++ b/src/core/printing/print_view_manager_base_qt.h
@@ -51,8 +51,6 @@
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
-struct PrintHostMsg_DidPrintDocument_Params;
-
namespace base {
class RefCountedBytes;
}
@@ -100,7 +98,7 @@ protected:
// printing::PrintManager implementation:
void OnDidPrintDocument(content::RenderFrameHost *render_frame_host,
- const PrintHostMsg_DidPrintDocument_Params &params,
+ const printing::mojom::DidPrintDocumentParams &params,
std::unique_ptr<DelayedFrameDispatchHelper> helper) override;
void OnGetDefaultPrintSettings(content::RenderFrameHost* render_frame_host,
IPC::Message* reply_msg) override;
diff --git a/src/core/printing/print_view_manager_qt.cpp b/src/core/printing/print_view_manager_qt.cpp
index 617bc9ed3..5d9e1bf7a 100644
--- a/src/core/printing/print_view_manager_qt.cpp
+++ b/src/core/printing/print_view_manager_qt.cpp
@@ -162,14 +162,14 @@ static base::DictionaryValue *createPrintSettingsFromQPageLayout(const QPageLayo
marginsDict->SetInteger(printing::kSettingMarginRight, pageMarginsInPoints.right());
printSettings->Set(printing::kSettingMarginsCustom, std::move(marginsDict));
- printSettings->SetInteger(printing::kSettingMarginsType, printing::CUSTOM_MARGINS);
+ printSettings->SetInteger(printing::kSettingMarginsType, (int)printing::mojom::MarginType::kCustomMargins);
// pageSizeInMillimeter is in portrait orientation. Transpose it if necessary.
printSettings->SetBoolean(printing::kSettingLandscape, pageLayout.orientation() == QPageLayout::Landscape);
} else {
// QPrinter will handle margins
pageSizeInMillimeter = pageLayout.paintRect(QPageLayout::Millimeter);
- printSettings->SetInteger(printing::kSettingMarginsType, printing::NO_MARGINS);
+ printSettings->SetInteger(printing::kSettingMarginsType, (int)printing::mojom::MarginType::kNoMargins);
// pageSizeInMillimeter already contains the orientation.
printSettings->SetBoolean(printing::kSettingLandscape, false);
@@ -261,10 +261,9 @@ bool PrintViewManagerQt::PrintToPDFInternal(const QPageLayout &pageLayout,
m_printSettings.reset(createPrintSettingsFromQPageLayout(pageLayout, useCustomMargins));
m_printSettings->SetBoolean(printing::kSettingShouldPrintBackgrounds,
- web_contents()->GetRenderViewHost()->
- GetWebkitPreferences().should_print_backgrounds);
+ web_contents()->GetOrCreateWebPreferences().should_print_backgrounds);
m_printSettings->SetInteger(printing::kSettingColor,
- printInColor ? printing::COLOR : printing::GRAYSCALE);
+ int(printInColor ? printing::mojom::ColorModel::kColor : printing::mojom::ColorModel::kGrayscale));
if (web_contents()->IsCrashed())
return false;
@@ -356,7 +355,7 @@ void PrintViewManagerQt::OnRequestPrintPreview(
}
void PrintViewManagerQt::OnMetafileReadyForPrinting(content::RenderFrameHost* rfh,
- const PrintHostMsg_DidPreviewDocument_Params& params,
+ const printing::mojom::DidPreviewDocumentParams& params,
const PrintHostMsg_PreviewIds &ids)
{
StopWorker(params.document_cookie);
@@ -369,11 +368,11 @@ void PrintViewManagerQt::OnMetafileReadyForPrinting(content::RenderFrameHost* rf
resetPdfState();
if (!pdf_print_callback.is_null()) {
- QSharedPointer<QByteArray> data_array = GetStdVectorFromHandle(params.content.metafile_data_region);
+ QSharedPointer<QByteArray> data_array = GetStdVectorFromHandle(params.content->metafile_data_region);
base::PostTask(FROM_HERE, {content::BrowserThread::UI},
base::BindOnce(pdf_print_callback, data_array));
} else {
- scoped_refptr<base::RefCountedBytes> data_bytes = GetBytesFromHandle(params.content.metafile_data_region);
+ scoped_refptr<base::RefCountedBytes> data_bytes = GetBytesFromHandle(params.content->metafile_data_region);
base::PostTask(FROM_HERE, {base::ThreadPool(), base::MayBlock()},
base::BindOnce(&SavePdfFile, data_bytes, pdfOutputPath, pdf_save_callback));
}
@@ -411,7 +410,7 @@ void PrintViewManagerQt::RenderProcessGone(base::TerminationStatus status)
}
void PrintViewManagerQt::OnDidPreviewPage(content::RenderFrameHost* rfh,
- const PrintHostMsg_DidPreviewPage_Params& params,
+ const printing::mojom::DidPreviewPageParams &params,
const PrintHostMsg_PreviewIds& ids)
{
// just consume the message, this is just for sending 'page-preview-ready' for webui
diff --git a/src/core/printing/print_view_manager_qt.h b/src/core/printing/print_view_manager_qt.h
index 06c2f47ea..1c1b7558c 100644
--- a/src/core/printing/print_view_manager_qt.h
+++ b/src/core/printing/print_view_manager_qt.h
@@ -62,7 +62,6 @@
#include <QSharedPointer>
struct PrintHostMsg_RequestPrintPreview_Params;
-struct PrintHostMsg_DidPreviewDocument_Params;
namespace content {
class RenderViewHost;
@@ -122,12 +121,12 @@ protected:
void OnDidShowPrintDialog();
void OnRequestPrintPreview(const PrintHostMsg_RequestPrintPreview_Params&);
void OnMetafileReadyForPrinting(content::RenderFrameHost* rfh,
- const PrintHostMsg_DidPreviewDocument_Params& params,
+ const printing::mojom::DidPreviewDocumentParams& params,
const PrintHostMsg_PreviewIds &ids);
void OnSetupScriptedPrintPreview(content::RenderFrameHost* rfh,
IPC::Message* reply_msg);
void OnDidPreviewPage(content::RenderFrameHost* rfh,
- const PrintHostMsg_DidPreviewPage_Params& params,
+ const printing::mojom::DidPreviewPageParams& params,
const PrintHostMsg_PreviewIds& ids);
void OnShowScriptedPrintPreview(content::RenderFrameHost* rfh,
bool source_is_modifiable);
diff --git a/src/core/printing/printing_message_filter_qt.cpp b/src/core/printing/printing_message_filter_qt.cpp
index 5b9228d20..c95e334d8 100644
--- a/src/core/printing/printing_message_filter_qt.cpp
+++ b/src/core/printing/printing_message_filter_qt.cpp
@@ -106,7 +106,7 @@ void PrintingMessageFilterQt::OnGetDefaultPrintSettings(IPC::Message* reply_msg)
printing::PrinterQuery::GetSettingsAskParam::DEFAULTS,
0,
false,
- printing::DEFAULT_MARGINS,
+ printing::mojom::MarginType::kDefaultMargins,
false,
false,
base::BindOnce(&PrintingMessageFilterQt::OnGetDefaultPrintSettingsReply,
@@ -115,28 +115,25 @@ void PrintingMessageFilterQt::OnGetDefaultPrintSettings(IPC::Message* reply_msg)
reply_msg));
}
-void PrintingMessageFilterQt::OnGetDefaultPrintSettingsReply(
- std::unique_ptr<printing::PrinterQuery> printer_query,
- IPC::Message* reply_msg) {
- PrintMsg_Print_Params params;
- if (!printer_query.get() ||
- printer_query->last_status() != printing::PrintingContext::OK) {
- params.Reset();
- } else {
- RenderParamsFromPrintSettings(printer_query->settings(), &params);
- params.document_cookie = printer_query->cookie();
- }
- PrintHostMsg_GetDefaultPrintSettings::WriteReplyParams(reply_msg, params);
- Send(reply_msg);
- // If printing was enabled.
- if (printer_query.get()) {
- // If user hasn't cancelled.
- if (printer_query->cookie() && printer_query->settings().dpi()) {
- queue_->QueuePrinterQuery(std::move(printer_query));
- } else {
- printer_query->StopWorker();
+void PrintingMessageFilterQt::OnGetDefaultPrintSettingsReply(std::unique_ptr<printing::PrinterQuery> printer_query,
+ IPC::Message *reply_msg)
+{
+ printing::mojom::PrintParams params;
+ if (printer_query && printer_query->last_status() == printing::PrintingContext::OK) {
+ printing::RenderParamsFromPrintSettings(printer_query->settings(), &params);
+ params.document_cookie = printer_query->cookie();
+ }
+ PrintHostMsg_GetDefaultPrintSettings::WriteReplyParams(reply_msg, params);
+ Send(reply_msg);
+ // If printing was enabled.
+ if (printer_query) {
+ // If user hasn't cancelled.
+ if (printer_query->cookie() && printer_query->settings().dpi()) {
+ queue_->QueuePrinterQuery(std::move(printer_query));
+ } else {
+ printer_query->StopWorker();
+ }
}
- }
}
void PrintingMessageFilterQt::OnScriptedPrint(
diff --git a/src/core/profile_io_data_qt.cpp b/src/core/profile_io_data_qt.cpp
index 5bf8eb266..68e674f01 100644
--- a/src/core/profile_io_data_qt.cpp
+++ b/src/core/profile_io_data_qt.cpp
@@ -160,7 +160,7 @@ BrowsingDataRemoverObserverQt::BrowsingDataRemoverObserverQt(ProfileIODataQt *pr
{
}
-void BrowsingDataRemoverObserverQt::OnBrowsingDataRemoverDone()
+void BrowsingDataRemoverObserverQt::OnBrowsingDataRemoverDone(uint64_t)
{
Q_ASSERT(m_profileIOData->m_clearHttpCacheInProgress);
m_profileIOData->removeBrowsingDataRemoverObserver();
diff --git a/src/core/profile_io_data_qt.h b/src/core/profile_io_data_qt.h
index 3eb3856df..f2a6a7822 100644
--- a/src/core/profile_io_data_qt.h
+++ b/src/core/profile_io_data_qt.h
@@ -70,7 +70,7 @@ class BrowsingDataRemoverObserverQt : public content::BrowsingDataRemover::Obser
public:
BrowsingDataRemoverObserverQt(ProfileIODataQt *profileIOData);
- void OnBrowsingDataRemoverDone() override;
+ void OnBrowsingDataRemoverDone(uint64_t) override;
private:
ProfileIODataQt *m_profileIOData;
diff --git a/src/core/qtwebengine_sources.gni b/src/core/qtwebengine_sources.gni
index cbe51d052..39c670224 100644
--- a/src/core/qtwebengine_sources.gni
+++ b/src/core/qtwebengine_sources.gni
@@ -181,6 +181,7 @@ source_set("qtwebengine_sources") {
deps += [
"//pdf",
"//pdf:buildflags",
+ "//pdf:pdf_ppapi",
"//components/pdf/browser:browser",
"//components/pdf/renderer:renderer",
"//components/printing/browser",
diff --git a/src/core/quota_permission_context_qt.cpp b/src/core/quota_permission_context_qt.cpp
index c7f1e856c..549414d33 100644
--- a/src/core/quota_permission_context_qt.cpp
+++ b/src/core/quota_permission_context_qt.cpp
@@ -61,7 +61,7 @@ void QuotaPermissionContextQt::RequestQuotaPermission(const StorageQuotaParams &
if (params.storage_type != blink::mojom::StorageType::kPersistent) {
// For now we only support requesting quota with this interface
// for Persistent storage type.
- std::move(callback).Run(QUOTA_PERMISSION_RESPONSE_DISALLOW);
+ dispatchCallbackOnIOThread(std::move(callback), QUOTA_PERMISSION_RESPONSE_DISALLOW);
return;
}
@@ -74,16 +74,26 @@ void QuotaPermissionContextQt::RequestQuotaPermission(const StorageQuotaParams &
}
RenderFrameHost *renderFrameHost = RenderFrameHost::FromID(render_process_id, params.render_frame_id);
- if (!renderFrameHost)
+ if (!renderFrameHost) {
+ LOG(WARNING) << "Attempt to request quota from frameless renderer: "
+ << render_process_id << "," << params.render_frame_id;
+ dispatchCallbackOnIOThread(std::move(callback), QUOTA_PERMISSION_RESPONSE_CANCELLED);
return;
+ }
WebContents *webContents = WebContents::FromRenderFrameHost(renderFrameHost);
- if (!webContents)
+ if (!webContents) {
+ LOG(ERROR) << "Attempt to request quota from frame missing webcontents";
+ dispatchCallbackOnIOThread(std::move(callback), QUOTA_PERMISSION_RESPONSE_CANCELLED);
return;
+ }
WebContentsAdapterClient *client = WebContentsViewQt::from(static_cast<content::WebContentsImpl *>(webContents)->GetView())->client();
- if (!client)
+ if (!client) {
+ LOG(ERROR) << "Attempt to request quota from content missing webcontents client";
+ dispatchCallbackOnIOThread(std::move(callback), QUOTA_PERMISSION_RESPONSE_CANCELLED);
return;
+ }
QWebEngineQuotaRequest request(
QSharedPointer<QuotaRequestControllerImpl>::create(this, params, std::move(callback)));
diff --git a/src/core/quota_permission_context_qt.h b/src/core/quota_permission_context_qt.h
index 6d678c92a..528928c1a 100644
--- a/src/core/quota_permission_context_qt.h
+++ b/src/core/quota_permission_context_qt.h
@@ -42,8 +42,6 @@
#include "content/public/browser/quota_permission_context.h"
-#include <QtCore/qcompilerdetection.h> // Needed for override
-
namespace QtWebEngineCore {
class QuotaPermissionContextQt : public content::QuotaPermissionContext {
diff --git a/src/core/quota_request_controller_impl.cpp b/src/core/quota_request_controller_impl.cpp
index 514b85954..ea2526d45 100644
--- a/src/core/quota_request_controller_impl.cpp
+++ b/src/core/quota_request_controller_impl.cpp
@@ -55,17 +55,18 @@ QuotaRequestControllerImpl::QuotaRequestControllerImpl(QuotaPermissionContextQt
QuotaRequestControllerImpl::~QuotaRequestControllerImpl()
{
- reject();
+ if (m_callback)
+ m_context->dispatchCallbackOnIOThread(std::move(m_callback), content::QuotaPermissionContext::QUOTA_PERMISSION_RESPONSE_CANCELLED);
}
void QuotaRequestControllerImpl::accepted()
{
- m_context->dispatchCallbackOnIOThread(std::move(m_callback), QuotaPermissionContextQt::QUOTA_PERMISSION_RESPONSE_ALLOW);
+ m_context->dispatchCallbackOnIOThread(std::move(m_callback), content::QuotaPermissionContext::QUOTA_PERMISSION_RESPONSE_ALLOW);
}
void QuotaRequestControllerImpl::rejected()
{
- m_context->dispatchCallbackOnIOThread(std::move(m_callback), QuotaPermissionContextQt::QUOTA_PERMISSION_RESPONSE_DISALLOW);
+ m_context->dispatchCallbackOnIOThread(std::move(m_callback), content::QuotaPermissionContext::QUOTA_PERMISSION_RESPONSE_DISALLOW);
}
} // namespace QtWebEngineCore
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
index 93281f4c9..a76896c00 100644
--- a/src/core/render_widget_host_view_qt.cpp
+++ b/src/core/render_widget_host_view_qt.cpp
@@ -260,9 +260,9 @@ private:
const QTouchEvent::TouchPoint& touchPoint(size_t i) const { return touchPoints[i].second; }
};
-static content::ScreenInfo screenInfoFromQScreen(QScreen *screen)
+static blink::ScreenInfo screenInfoFromQScreen(QScreen *screen)
{
- content::ScreenInfo r;
+ blink::ScreenInfo r;
if (screen) {
r.device_scale_factor = screen->devicePixelRatio();
r.depth_per_component = 8;
@@ -758,7 +758,7 @@ void RenderWidgetHostViewQt::DisplayTooltipText(const base::string16 &tooltip_te
m_adapterClient->setToolTip(toQt(tooltip_text));
}
-void RenderWidgetHostViewQt::GetScreenInfo(content::ScreenInfo *results)
+void RenderWidgetHostViewQt::GetScreenInfo(blink::ScreenInfo *results)
{
*results = m_screenInfo;
}
@@ -1048,7 +1048,7 @@ void RenderWidgetHostViewQt::visualPropertiesChanged()
m_windowRectInDips = toGfx(m_delegate->windowGeometry());
QWindow *window = m_delegate->window();
- content::ScreenInfo oldScreenInfo = m_screenInfo;
+ blink::ScreenInfo oldScreenInfo = m_screenInfo;
m_screenInfo = screenInfoFromQScreen(window ? window->screen() : nullptr);
if (m_viewRectInDips != oldViewRect || m_windowRectInDips != oldWindowRect)
diff --git a/src/core/render_widget_host_view_qt.h b/src/core/render_widget_host_view_qt.h
index d69b86cd9..496a643ad 100644
--- a/src/core/render_widget_host_view_qt.h
+++ b/src/core/render_widget_host_view_qt.h
@@ -158,7 +158,7 @@ public:
viz::ScopedSurfaceIdAllocator DidUpdateVisualProperties(const cc::RenderFrameMetadata &metadata) override;
void OnDidUpdateVisualPropertiesComplete(const cc::RenderFrameMetadata &metadata);
- void GetScreenInfo(content::ScreenInfo *results) override;
+ void GetScreenInfo(blink::ScreenInfo *results) override;
gfx::Rect GetBoundsInRootWindow() override;
void ProcessAckedTouchEvent(const content::TouchEventWithLatencyInfo &touch,
blink::mojom::InputEventResultState ack_result) override;
@@ -252,7 +252,7 @@ private:
gfx::Rect m_viewRectInDips;
// Geometry of the window, including frame, in screen DIPs.
gfx::Rect m_windowRectInDips;
- content::ScreenInfo m_screenInfo;
+ blink::ScreenInfo m_screenInfo;
scoped_refptr<base::SingleThreadTaskRunner> m_taskRunner;
diff --git a/src/core/renderer/content_renderer_client_qt.cpp b/src/core/renderer/content_renderer_client_qt.cpp
index 4a420c14e..818b3c8f4 100644
--- a/src/core/renderer/content_renderer_client_qt.cpp
+++ b/src/core/renderer/content_renderer_client_qt.cpp
@@ -50,7 +50,6 @@
#include "components/cdm/renderer/external_clear_key_key_system_properties.h"
#include "components/cdm/renderer/widevine_key_system_properties.h"
#include "components/error_page/common/error.h"
-#include "components/error_page/common/error_page_params.h"
#include "components/error_page/common/localized_error.h"
#include "components/network_hints/renderer/web_prescient_networking_impl.h"
#if QT_CONFIG(webengine_printing_and_pdf)
@@ -103,7 +102,6 @@
#include "services/service_manager/public/cpp/binder_registry.h"
#include "services/service_manager/public/cpp/connector.h"
-#include "services/service_manager/public/cpp/service_binding.h"
#include "components/grit/components_resources.h"
@@ -304,8 +302,7 @@ void ContentRendererClientQt::GetNavigationErrorStringsInternal(content::RenderF
error_page::LocalizedError::GetPageState(
error.reason(), error.domain(), error.url(), isPost, false,
error.stale_copy_in_cache(), false,
- RenderConfiguration::is_incognito_process(), false, false, false, locale,
- std::unique_ptr<error_page::ErrorPageParams>());
+ RenderConfiguration::is_incognito_process(), false, false, false, locale);
resourceId = IDR_NET_ERROR_HTML;
@@ -389,13 +386,6 @@ content::BrowserPluginDelegate *ContentRendererClientQt::CreateBrowserPluginDele
#endif
}
-void ContentRendererClientQt::BindReceiverOnMainThread(mojo::GenericPendingReceiver receiver)
-{
- std::string interface_name = *receiver.interface_name();
- auto pipe = receiver.PassPipe();
- m_registry.TryBindInterface(interface_name, &pipe);
-}
-
void ContentRendererClientQt::GetInterface(const std::string &interface_name, mojo::ScopedMessagePipeHandle interface_pipe)
{
content::RenderThread::Get()->BindHostReceiver(mojo::GenericPendingReceiver(interface_name, std::move(interface_pipe)));
diff --git a/src/core/renderer/content_renderer_client_qt.h b/src/core/renderer/content_renderer_client_qt.h
index 2e2643f6d..bac723a4c 100644
--- a/src/core/renderer/content_renderer_client_qt.h
+++ b/src/core/renderer/content_renderer_client_qt.h
@@ -127,7 +127,6 @@ public:
GURL *new_url,
bool *attach_same_site_cookies) override;
- void BindReceiverOnMainThread(mojo::GenericPendingReceiver receiver) override;
bool RequiresWebComponentsV0(const GURL &url) override;
#if BUILDFLAG(ENABLE_PLUGINS)
@@ -154,8 +153,6 @@ private:
QScopedPointer<SpellCheck> m_spellCheck;
#endif
- service_manager::BinderRegistry m_registry;
-
DISALLOW_COPY_AND_ASSIGN(ContentRendererClientQt);
};
diff --git a/src/core/renderer/render_frame_observer_qt.cpp b/src/core/renderer/render_frame_observer_qt.cpp
index cc01acec6..fd900c292 100644
--- a/src/core/renderer/render_frame_observer_qt.cpp
+++ b/src/core/renderer/render_frame_observer_qt.cpp
@@ -77,7 +77,7 @@ void RenderFrameObserverQt::DidCreatePepperPlugin(content::RendererPpapiHost *ho
}
#endif
-void RenderFrameObserverQt::FrameDetached()
+void RenderFrameObserverQt::WillDetach()
{
m_isFrameDetached = true;
}
diff --git a/src/core/renderer/render_frame_observer_qt.h b/src/core/renderer/render_frame_observer_qt.h
index 6bdf4ad23..237185f8c 100644
--- a/src/core/renderer/render_frame_observer_qt.h
+++ b/src/core/renderer/render_frame_observer_qt.h
@@ -68,7 +68,7 @@ public:
void DidCreatePepperPlugin(content::RendererPpapiHost *host) override;
#endif
void OnDestruct() override;
- void FrameDetached() override;
+ void WillDetach() override;
bool isFrameDetached() const;
diff --git a/src/core/renderer/user_resource_controller.cpp b/src/core/renderer/user_resource_controller.cpp
index 0c807d07a..c7b220fe6 100644
--- a/src/core/renderer/user_resource_controller.cpp
+++ b/src/core/renderer/user_resource_controller.cpp
@@ -153,7 +153,7 @@ private:
void DidCommitProvisionalLoad(ui::PageTransition transition) override;
void DidFinishDocumentLoad() override;
void DidFinishLoad() override;
- void FrameDetached() override;
+ void WillDetach() override;
void OnDestruct() override;
void AddScript(const QtWebEngineCore::UserScriptData &data) override;
void RemoveScript(const QtWebEngineCore::UserScriptData &data) override;
@@ -274,7 +274,7 @@ void UserResourceController::RenderFrameObserverHelper::DidFinishLoad()
QtWebEngineCore::UserScriptData::AfterLoad));
}
-void UserResourceController::RenderFrameObserverHelper::FrameDetached()
+void UserResourceController::RenderFrameObserverHelper::WillDetach()
{
m_runner.reset();
}
diff --git a/src/core/resource_bundle_qt.cpp b/src/core/resource_bundle_qt.cpp
index dbcd66f26..d31b4d2e4 100644
--- a/src/core/resource_bundle_qt.cpp
+++ b/src/core/resource_bundle_qt.cpp
@@ -42,7 +42,7 @@
#include "base/metrics/histogram_macros.h"
#include "base/notreached.h"
#include "content/public/common/content_switches.h"
-#include "services/service_manager/sandbox/switches.h"
+#include "sandbox/policy/switches.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/data_pack.h"
#include "ui/base/resource/resource_bundle.h"
@@ -77,7 +77,7 @@ bool ResourceBundle::LocaleDataPakExists(const std::string& locale)
#if defined(OS_LINUX)
base::CommandLine *parsed_command_line = base::CommandLine::ForCurrentProcess();
std::string process_type = parsed_command_line->GetSwitchValueASCII(switches::kProcessType);
- bool no_sandbox = parsed_command_line->HasSwitch(service_manager::switches::kNoSandbox);
+ bool no_sandbox = parsed_command_line->HasSwitch(sandbox::policy::switches::kNoSandbox);
if (process_type == switches::kRendererProcess && !no_sandbox) {
// The Renderer Process is sandboxed thus only one locale is available in it.
// The particular one is passed by the --lang command line option.
diff --git a/src/core/type_conversion.h b/src/core/type_conversion.h
index f09fd3fa3..1152ed9a9 100644
--- a/src/core/type_conversion.h
+++ b/src/core/type_conversion.h
@@ -52,7 +52,6 @@
#include <base/strings/nullable_string16.h>
#include "base/files/file_path.h"
#include "base/time/time.h"
-#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"
@@ -261,43 +260,6 @@ inline base::FilePath toFilePath(const QString &str)
return base::FilePath(toFilePathString(str));
}
-template <typename T>
-inline T fileListingHelper(const QString &)
-// Clang is still picky about this though it should be supported eventually.
-// See http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#941
-#ifndef Q_CC_CLANG
-= delete;
-#else
-{ return T(); }
-#endif
-
-template <>
-inline content::FileChooserFileInfo fileListingHelper<content::FileChooserFileInfo>(const QString &file)
-{
- content::FileChooserFileInfo choose_file;
- base::FilePath fp(toFilePath(file));
- choose_file.file_path = fp;
- choose_file.display_name = fp.BaseName().value();
- return choose_file;
-}
-
-template <>
-inline base::FilePath fileListingHelper<base::FilePath>(const QString &file)
-{
- return base::FilePath(toFilePathString(file));
-}
-
-
-template <typename T>
-inline std::vector<T> toVector(const QStringList &fileList)
-{
- std::vector<T> selectedFiles;
- selectedFiles.reserve(fileList.size());
- for (const QString &file : fileList)
- selectedFiles.push_back(fileListingHelper<T>(file));
- return selectedFiles;
-}
-
int flagsFromModifiers(Qt::KeyboardModifiers modifiers);
inline QStringList fromVector(const std::vector<base::string16> &vector)
diff --git a/src/core/user_script.cpp b/src/core/user_script.cpp
index 3f6721eca..f4daaf7c6 100644
--- a/src/core/user_script.cpp
+++ b/src/core/user_script.cpp
@@ -234,10 +234,10 @@ void UserScript::parseMetadataHeader()
line = base::StringPiece(script_text.data() + line_start, line_end - line_start);
if (!in_metadata) {
- if (line.starts_with(kUserScriptBegin))
+ if (base::StartsWith(line, kUserScriptBegin))
in_metadata = true;
} else {
- if (line.starts_with(kUserScriptEnd))
+ if (base::StartsWith(line, kUserScriptEnd))
break;
std::string value;
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index 44c4b5f37..df98337a1 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -62,6 +62,7 @@
#include "base/command_line.h"
#include "base/run_loop.h"
+#include "base/task/current_thread.h"
#include "base/task/post_task.h"
#include "base/task/sequence_manager/sequence_manager_impl.h"
#include "base/task/sequence_manager/thread_controller_with_message_pump_impl.h"
@@ -1057,13 +1058,10 @@ void WebContentsAdapter::runJavaScript(const QString &javaScript, quint32 worldI
content::RenderViewHost *rvh = m_webContents->GetRenderViewHost();
Q_ASSERT(rvh);
// static_cast<content::RenderFrameHostImpl *>(rvh->GetMainFrame())->NotifyUserActivation();
- if (worldId == 0) {
+ if (worldId == 0)
rvh->GetMainFrame()->ExecuteJavaScript(toString16(javaScript), base::NullCallback());
- return;
- }
-
- content::RenderFrameHost::JavaScriptResultCallback callback = base::BindOnce(&callbackOnEvaluateJS, m_adapterClient, CallbackDirectory::NoCallbackId);
- rvh->GetMainFrame()->ExecuteJavaScriptInIsolatedWorld(toString16(javaScript), std::move(callback), worldId);
+ else
+ rvh->GetMainFrame()->ExecuteJavaScriptInIsolatedWorld(toString16(javaScript), base::NullCallback(), worldId);
}
quint64 WebContentsAdapter::runJavaScriptCallbackResult(const QString &javaScript, quint32 worldId)
@@ -1094,10 +1092,10 @@ quint64 WebContentsAdapter::fetchDocumentInnerText()
return m_nextRequestId++;
}
-void WebContentsAdapter::updateWebPreferences(const content::WebPreferences & webPreferences)
+void WebContentsAdapter::updateWebPreferences(const content::WebPreferences &webPreferences)
{
CHECK_INITIALIZED();
- m_webContents->GetRenderViewHost()->UpdateWebkitPreferences(webPreferences);
+ m_webContents->SetWebPreferences(webPreferences);
// In case of updating preferences during navigation, there might be a pending RVH what will
// be active on successful navigation.
@@ -1105,7 +1103,7 @@ void WebContentsAdapter::updateWebPreferences(const content::WebPreferences & we
if (pendingRFH) {
content::RenderViewHost *pendingRVH = pendingRFH->GetRenderViewHost();
Q_ASSERT(pendingRVH);
- pendingRVH->UpdateWebkitPreferences(webPreferences);
+ static_cast<content::RenderViewHostImpl*>(pendingRVH)->SendWebPreferencesToRenderer();
}
}
@@ -1528,7 +1526,7 @@ void WebContentsAdapter::startDragging(QObject *dragSource, const content::DropD
}
{
- base::MessageLoopCurrent::ScopedNestableTaskAllower allow;
+ base::CurrentThread::ScopedNestableTaskAllower allow;
drag->exec(allowedActions);
}
@@ -1672,7 +1670,7 @@ void WebContentsAdapter::waitForUpdateDragActionCalled()
const qint64 timeout = 3000;
QElapsedTimer t;
t.start();
- auto seqMan = base::MessageLoopCurrent::GetCurrentSequenceManagerImpl();
+ auto seqMan = base::CurrentThread::GetCurrentSequenceManagerImpl();
base::MessagePump::Delegate *delegate =
static_cast<base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl *>(
seqMan->controller_.get());
@@ -2055,6 +2053,6 @@ ASSERT_ENUMS_MATCH(ReferrerPolicy::OriginWhenCrossOrigin, network::mojom::Referr
//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)
+ASSERT_ENUMS_MATCH(ReferrerPolicy::Last, network::mojom::ReferrerPolicy::kMaxValue)
} // namespace QtWebEngineCore
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index 436906072..6fc94a8a8 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -604,8 +604,10 @@ ASSERT_ENUMS_MATCH(FilePickerController::OpenMultiple, blink::mojom::FileChooser
ASSERT_ENUMS_MATCH(FilePickerController::UploadFolder, blink::mojom::FileChooserParams::Mode::kUploadFolder)
ASSERT_ENUMS_MATCH(FilePickerController::Save, blink::mojom::FileChooserParams::Mode::kSave)
+extern FilePickerController *createFilePickerController(FilePickerController::FileChooserMode mode, scoped_refptr<content::FileSelectListener> listener, const QString &defaultFileName, const QStringList &acceptedMimeTypes, QObject *parent = nullptr);
+
void WebContentsDelegateQt::RunFileChooser(content::RenderFrameHost * /*frameHost*/,
- std::unique_ptr<content::FileSelectListener> listener,
+ scoped_refptr<content::FileSelectListener> listener,
const blink::mojom::FileChooserParams& params)
{
QStringList acceptedMimeTypes;
@@ -613,8 +615,8 @@ void WebContentsDelegateQt::RunFileChooser(content::RenderFrameHost * /*frameHos
for (std::vector<base::string16>::const_iterator it = params.accept_types.begin(); it < params.accept_types.end(); ++it)
acceptedMimeTypes.append(toQt(*it));
- m_filePickerController.reset(new FilePickerController(static_cast<FilePickerController::FileChooserMode>(params.mode),
- std::move(listener), toQt(params.default_file_name.value()), acceptedMimeTypes));
+ m_filePickerController.reset(createFilePickerController(static_cast<FilePickerController::FileChooserMode>(params.mode),
+ listener, toQt(params.default_file_name.value()), acceptedMimeTypes));
// Defer the call to not block base::MessageLoop::RunTask with modal dialogs.
QTimer::singleShot(0, [this] () {
@@ -795,9 +797,9 @@ bool WebContentsDelegateQt::CheckMediaAccessPermission(content::RenderFrameHost
}
}
-void WebContentsDelegateQt::RegisterProtocolHandler(content::WebContents *webContents, const std::string &protocol, const GURL &url, bool)
+void WebContentsDelegateQt::RegisterProtocolHandler(content::RenderFrameHost *frameHost, const std::string &protocol, const GURL &url, bool)
{
- content::BrowserContext *context = webContents->GetBrowserContext();
+ content::BrowserContext *context = frameHost->GetBrowserContext();
if (context->IsOffTheRecord())
return;
@@ -810,13 +812,13 @@ void WebContentsDelegateQt::RegisterProtocolHandler(content::WebContents *webCon
return;
QWebEngineRegisterProtocolHandlerRequest request(
- QSharedPointer<RegisterProtocolHandlerRequestControllerImpl>::create(webContents, handler));
+ QSharedPointer<RegisterProtocolHandlerRequestControllerImpl>::create(content::WebContents::FromRenderFrameHost(frameHost), handler));
m_viewClient->runRegisterProtocolHandlerRequest(std::move(request));
}
-void WebContentsDelegateQt::UnregisterProtocolHandler(content::WebContents *webContents, const std::string &protocol, const GURL &url, bool)
+void WebContentsDelegateQt::UnregisterProtocolHandler(content::RenderFrameHost *frameHost, const std::string &protocol, const GURL &url, bool)
{
- content::BrowserContext* context = webContents->GetBrowserContext();
+ content::BrowserContext* context = frameHost->GetBrowserContext();
if (context->IsOffTheRecord())
return;
diff --git a/src/core/web_contents_delegate_qt.h b/src/core/web_contents_delegate_qt.h
index 56a4393a6..1b071b7d9 100644
--- a/src/core/web_contents_delegate_qt.h
+++ b/src/core/web_contents_delegate_qt.h
@@ -133,7 +133,7 @@ public:
void ExitFullscreenModeForTab(content::WebContents*) override;
bool IsFullscreenForTabOrPending(const content::WebContents* web_contents) override;
void RunFileChooser(content::RenderFrameHost* render_frame_host,
- std::unique_ptr<content::FileSelectListener> listener,
+ scoped_refptr<content::FileSelectListener> listener,
const blink::mojom::FileChooserParams& params) override;
bool DidAddMessageToConsole(content::WebContents *source, blink::mojom::ConsoleMessageLevel log_level,
const base::string16 &message, int32_t line_no, const base::string16 &source_id) override;
@@ -146,8 +146,8 @@ public:
void RequestToLockMouse(content::WebContents *web_contents, bool user_gesture, bool last_unlocked_by_target) override;
void BeforeUnloadFired(content::WebContents* tab, bool proceed, bool* proceed_to_fire_unload) override;
bool CheckMediaAccessPermission(content::RenderFrameHost* render_frame_host, const GURL& security_origin, blink::mojom::MediaStreamType type) override;
- void RegisterProtocolHandler(content::WebContents* web_contents, const std::string& protocol, const GURL& url, bool user_gesture) override;
- void UnregisterProtocolHandler(content::WebContents* web_contents, const std::string& protocol, const GURL& url, bool user_gesture) override;
+ void RegisterProtocolHandler(content::RenderFrameHost* frame_host, const std::string& protocol, const GURL& url, bool user_gesture) override;
+ void UnregisterProtocolHandler(content::RenderFrameHost* frame_host, const std::string& protocol, const GURL& url, bool user_gesture) override;
bool TakeFocus(content::WebContents *source, bool reverse) override;
void ContentsZoomChange(bool zoom_in) override;
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 3696e4865..e451ed547 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -88,10 +88,10 @@
#include "mojo/core/embedder/embedder.h"
#include "net/base/port_util.h"
#include "ppapi/buildflags/buildflags.h"
+#include "sandbox/policy/switches.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/network_switches.h"
#include "services/network/public/mojom/network_context.mojom.h"
-#include "services/service_manager/sandbox/switches.h"
#include "services/tracing/public/cpp/trace_startup.h"
#include "services/tracing/public/cpp/tracing_features.h"
#include "third_party/blink/public/common/features.h"
@@ -585,10 +585,10 @@ WebEngineContext::WebEngineContext()
bool disable_sandbox = qEnvironmentVariableIsSet(kDisableSandboxEnv);
if (!disable_sandbox) {
#if defined(Q_OS_LINUX)
- parsedCommandLine->AppendSwitch(service_manager::switches::kDisableSetuidSandbox);
+ parsedCommandLine->AppendSwitch(sandbox::policy::switches::kDisableSetuidSandbox);
#endif
} else {
- parsedCommandLine->AppendSwitch(service_manager::switches::kNoSandbox);
+ parsedCommandLine->AppendSwitch(sandbox::policy::switches::kNoSandbox);
qInfo() << "Sandboxing disabled by user.";
}
diff --git a/src/core/web_engine_library_info.cpp b/src/core/web_engine_library_info.cpp
index 99369e57f..2d710322e 100644
--- a/src/core/web_engine_library_info.cpp
+++ b/src/core/web_engine_library_info.cpp
@@ -45,9 +45,10 @@
#include "base/files/file_util.h"
#include "components/spellcheck/spellcheck_buildflags.h"
#include "content/public/common/content_paths.h"
+#include "sandbox/policy/switches.h"
#include "ui/base/ui_base_paths.h"
#include "ui/base/ui_base_switches.h"
-#include "services/service_manager/sandbox/switches.h"
+
#include "type_conversion.h"
#include <QByteArray>
@@ -184,7 +185,7 @@ QString subProcessPath()
#if defined(OS_WIN)
base::CommandLine *parsedCommandLine = base::CommandLine::ForCurrentProcess();
- if (!parsedCommandLine->HasSwitch(service_manager::switches::kNoSandbox)) {
+ if (!parsedCommandLine->HasSwitch(sandbox::policy::switches::kNoSandbox)) {
if (WebEngineLibraryInfo::isUNCPath(processPath) || WebEngineLibraryInfo::isRemoteDrivePath(processPath))
qCritical("Can not launch QtWebEngineProcess from network path if sandbox is enabled: %s.", processPath.toUtf8().constData());
}
diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp
index 72311f1a8..f6e4e9f9b 100644
--- a/src/webenginewidgets/api/qwebenginepage.cpp
+++ b/src/webenginewidgets/api/qwebenginepage.cpp
@@ -2218,7 +2218,7 @@ QWebEnginePage *QWebEnginePage::createWindow(WebWindowType type)
if (newView)
return newView->page();
}
- return 0;
+ return nullptr;
}
/*!