summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config.tests/winversion/winversion.cpp2
m---------src/3rdparty0
-rw-r--r--src/core/authentication_dialog_controller.cpp9
-rw-r--r--src/core/browser_main_parts_qt.cpp8
-rw-r--r--src/core/client_cert_select_controller.cpp2
-rw-r--r--src/core/compositor/compositor.cpp19
-rw-r--r--src/core/compositor/compositor.h1
-rw-r--r--src/core/compositor/compositor_resource_fence.cpp2
-rw-r--r--src/core/compositor/compositor_resource_tracker.cpp8
-rw-r--r--src/core/compositor/content_gpu_client_qt.cpp4
-rw-r--r--src/core/compositor/delegated_frame_node.cpp5
-rw-r--r--src/core/config/common.pri9
-rw-r--r--src/core/config/mac_osx.pri2
-rw-r--r--src/core/configure.json4
-rw-r--r--src/core/content_browser_client_qt.cpp39
-rw-r--r--src/core/content_browser_client_qt.h1
-rw-r--r--src/core/content_client_qt.cpp5
-rw-r--r--src/core/content_client_qt.h3
-rw-r--r--src/core/content_main_delegate_qt.cpp8
-rw-r--r--src/core/devtools_frontend_qt.cpp6
-rw-r--r--src/core/file_picker_controller.cpp37
-rw-r--r--src/core/file_picker_controller.h12
-rw-r--r--src/core/media_capture_devices_dispatcher.cpp15
-rw-r--r--src/core/net/cookie_monster_delegate_qt.cpp47
-rw-r--r--src/core/net/network_delegate_qt.cpp30
-rw-r--r--src/core/net/network_delegate_qt.h4
-rw-r--r--src/core/net/url_request_context_getter_qt.cpp6
-rw-r--r--src/core/net/url_request_custom_job.cpp20
-rw-r--r--src/core/net/url_request_custom_job_delegate.cpp31
-rw-r--r--src/core/ozone/gl_surface_egl_qt.cpp18
-rw-r--r--src/core/ozone/gl_surface_qt.cpp4
-rw-r--r--src/core/ozone/gl_surface_wgl_qt.cpp4
-rw-r--r--src/core/permission_manager_qt.cpp1
-rw-r--r--src/core/printing/print_view_manager_base_qt.cpp19
-rw-r--r--src/core/printing/print_view_manager_qt.cpp74
-rw-r--r--src/core/profile_io_data_qt.cpp31
-rw-r--r--src/core/qtwebengine.gni5
-rw-r--r--src/core/quota_permission_context_qt.cpp18
-rw-r--r--src/core/qwebengineclientcertificatestore.cpp2
-rw-r--r--src/core/render_widget_host_view_qt.cpp8
-rw-r--r--src/core/render_widget_host_view_qt.h1
-rw-r--r--src/core/renderer/content_renderer_client_qt.cpp3
-rw-r--r--src/core/renderer/content_settings_observer_qt.cpp4
-rw-r--r--src/core/renderer/content_settings_observer_qt.h4
-rw-r--r--src/core/renderer/user_resource_controller.cpp8
-rw-r--r--src/core/renderer/web_channel_ipc_transport.cpp10
-rw-r--r--src/core/renderer_host/pepper/pepper_isolated_file_system_message_filter.cpp4
-rw-r--r--src/core/resource_bundle_qt.cpp1
-rw-r--r--src/core/service/service_qt.cpp10
-rw-r--r--src/core/type_conversion.cpp2
-rw-r--r--src/core/web_contents_adapter.cpp19
-rw-r--r--src/core/web_contents_delegate_qt.cpp20
-rw-r--r--src/core/web_contents_delegate_qt.h6
-rw-r--r--src/core/web_contents_view_qt.cpp7
-rw-r--r--src/core/web_contents_view_qt.h20
-rw-r--r--src/core/web_engine_context.cpp34
-rw-r--r--src/core/web_engine_context.h5
-rw-r--r--src/core/web_engine_context_threads.cpp11
-rw-r--r--tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp5
-rw-r--r--tests/auto/quick/qmltests/data/tst_findText.qml4
-rw-r--r--tests/auto/quick/qquickwebengineview/BLACKLIST5
-rw-r--r--tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp2
-rw-r--r--tests/auto/widgets/origins/tst_origins.cpp25
-rw-r--r--tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp1
-rw-r--r--tests/auto/widgets/qwebengineview/BLACKLIST3
-rw-r--r--tests/auto/widgets/qwebengineview/resources/image2.pngbin0 -> 14743 bytes
-rw-r--r--tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp2
-rw-r--r--tests/auto/widgets/qwebengineview/tst_qwebengineview.qrc1
-rwxr-xr-xtools/scripts/take_snapshot.py235
-rw-r--r--tools/scripts/version_resolver.py5
70 files changed, 528 insertions, 452 deletions
diff --git a/config.tests/winversion/winversion.cpp b/config.tests/winversion/winversion.cpp
index 4d117b945..e9a4cff59 100644
--- a/config.tests/winversion/winversion.cpp
+++ b/config.tests/winversion/winversion.cpp
@@ -26,7 +26,7 @@
**
****************************************************************************/
-#if !defined(__clang__) && _MSC_FULL_VER < 191125507
+#if !defined(__clang__) && _MSC_FULL_VER < 191426428
#error unsupported Visual Studio version
#endif
diff --git a/src/3rdparty b/src/3rdparty
-Subproject 323b45aa242e0b4e75689d67418ec124ba1ca81
+Subproject 699b8faf01aeae266d38a915c02fe955e1f4c4e
diff --git a/src/core/authentication_dialog_controller.cpp b/src/core/authentication_dialog_controller.cpp
index bd23d1768..1133b0bc1 100644
--- a/src/core/authentication_dialog_controller.cpp
+++ b/src/core/authentication_dialog_controller.cpp
@@ -40,7 +40,9 @@
#include "authentication_dialog_controller.h"
#include "authentication_dialog_controller_p.h"
+#include "base/task/post_task.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/browser_task_traits.h"
namespace QtWebEngineCore {
@@ -51,9 +53,10 @@ AuthenticationDialogControllerPrivate::AuthenticationDialogControllerPrivate(Log
void AuthenticationDialogControllerPrivate::dialogFinished(bool accepted, const QString &user, const QString &password)
{
- content::BrowserThread::PostTask(
- content::BrowserThread::IO, FROM_HERE,
- base::Bind(&LoginDelegateQt::sendAuthToRequester, loginDelegate, accepted, user, password));
+ base::PostTaskWithTraits(
+ FROM_HERE, {content::BrowserThread::IO},
+ base::BindOnce(&LoginDelegateQt::sendAuthToRequester,
+ loginDelegate, accepted, user, password));
}
AuthenticationDialogController::AuthenticationDialogController(AuthenticationDialogControllerPrivate *dd)
diff --git a/src/core/browser_main_parts_qt.cpp b/src/core/browser_main_parts_qt.cpp
index 056d6fda8..cfe9ea8bb 100644
--- a/src/core/browser_main_parts_qt.cpp
+++ b/src/core/browser_main_parts_qt.cpp
@@ -283,11 +283,9 @@ void BrowserMainPartsQt::ServiceManagerConnectionStarted(content::ServiceManager
{
ServiceQt::GetInstance()->InitConnector();
connection->GetConnector()->StartService(service_manager::Identity("qtwebengine"));
- if (resource_coordinator::IsResourceCoordinatorEnabled()) {
- m_processResourceCoordinator = std::make_unique<resource_coordinator::ProcessResourceCoordinator>(connection->GetConnector());
- m_processResourceCoordinator->SetLaunchTime(base::Time::Now());
- m_processResourceCoordinator->SetPID(base::Process::Current().Pid());
- }
+ m_processResourceCoordinator = std::make_unique<resource_coordinator::ProcessResourceCoordinator>(connection->GetConnector());
+ m_processResourceCoordinator->SetLaunchTime(base::Time::Now());
+ m_processResourceCoordinator->SetPID(base::Process::Current().Pid());
}
} // namespace QtWebEngineCore
diff --git a/src/core/client_cert_select_controller.cpp b/src/core/client_cert_select_controller.cpp
index 2ff598445..0baaf2bc5 100644
--- a/src/core/client_cert_select_controller.cpp
+++ b/src/core/client_cert_select_controller.cpp
@@ -48,6 +48,8 @@
#include "type_conversion.h"
+#include <QDebug>
+
QT_BEGIN_NAMESPACE
using namespace QtWebEngineCore;
diff --git a/src/core/compositor/compositor.cpp b/src/core/compositor/compositor.cpp
index 258fb47b4..0660c155b 100644
--- a/src/core/compositor/compositor.cpp
+++ b/src/core/compositor/compositor.cpp
@@ -42,7 +42,9 @@
#include "compositor_resource_tracker.h"
#include "delegated_frame_node.h"
+#include "base/task/post_task.h"
#include "components/viz/common/resources/returned_resource.h"
+#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "services/viz/public/interfaces/compositing/compositor_frame_sink.mojom.h"
@@ -54,11 +56,10 @@ Compositor::Compositor(content::RenderWidgetHost *host)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- base::SingleThreadTaskRunner *taskRunner =
- content::BrowserThread::GetTaskRunnerForThread(content::BrowserThread::UI).get();
+ m_taskRunner = base::CreateSingleThreadTaskRunnerWithTraits({content::BrowserThread::UI});
m_beginFrameSource =
std::make_unique<viz::DelayBasedBeginFrameSource>(
- std::make_unique<viz::DelayBasedTimeSource>(taskRunner),
+ std::make_unique<viz::DelayBasedTimeSource>(m_taskRunner.get()),
viz::BeginFrameSource::kNotRestartableId);
}
@@ -127,18 +128,16 @@ QSGNode *Compositor::updatePaintNode(QSGNode *oldNode, RenderWidgetHostViewQtDel
m_updatePaintNodeShouldCommit = false;
if (m_committedFrame.metadata.request_presentation_feedback)
- content::BrowserThread::PostTask(
- content::BrowserThread::UI, FROM_HERE,
- base::BindOnce(&Compositor::sendPresentationFeedback, m_weakPtrFactory.GetWeakPtr(), m_committedFrame.metadata.frame_token));
-
+ m_taskRunner->PostTask(FROM_HERE,
+ base::BindOnce(&Compositor::sendPresentationFeedback, m_weakPtrFactory.GetWeakPtr(),
+ m_committedFrame.metadata.frame_token));
m_resourceTracker->commitResources();
frameNode->commit(m_pendingFrame, m_committedFrame, m_resourceTracker.get(), viewDelegate);
m_committedFrame = std::move(m_pendingFrame);
m_pendingFrame = viz::CompositorFrame();
- content::BrowserThread::PostTask(
- content::BrowserThread::UI, FROM_HERE,
- base::BindOnce(&Compositor::notifyFrameCommitted, m_weakPtrFactory.GetWeakPtr()));
+ m_taskRunner->PostTask(FROM_HERE,
+ base::BindOnce(&Compositor::notifyFrameCommitted, m_weakPtrFactory.GetWeakPtr()));
return frameNode;
}
diff --git a/src/core/compositor/compositor.h b/src/core/compositor/compositor.h
index 5efe419cc..69f4a530c 100644
--- a/src/core/compositor/compositor.h
+++ b/src/core/compositor/compositor.h
@@ -118,6 +118,7 @@ private:
bool m_updatePaintNodeShouldCommit = false;
bool m_needsBeginFrames = false;
+ scoped_refptr<base::SingleThreadTaskRunner> m_taskRunner;
base::WeakPtrFactory<Compositor> m_weakPtrFactory{this};
DISALLOW_COPY_AND_ASSIGN(Compositor);
diff --git a/src/core/compositor/compositor_resource_fence.cpp b/src/core/compositor/compositor_resource_fence.cpp
index 4efed00d3..7fc5fbfb2 100644
--- a/src/core/compositor/compositor_resource_fence.cpp
+++ b/src/core/compositor/compositor_resource_fence.cpp
@@ -39,7 +39,7 @@
#include "compositor_resource_fence.h"
-#include <ui/gl/gl_context.h>
+#include "ui/gl/gl_context.h"
#include <QtGui/qopenglcontext.h>
diff --git a/src/core/compositor/compositor_resource_tracker.cpp b/src/core/compositor/compositor_resource_tracker.cpp
index 90f98191c..6530f3249 100644
--- a/src/core/compositor/compositor_resource_tracker.cpp
+++ b/src/core/compositor/compositor_resource_tracker.cpp
@@ -44,10 +44,12 @@
#include "web_engine_context.h"
#include "base/message_loop/message_loop.h"
+#include "base/task/post_task.h"
#include "components/viz/common/quads/compositor_frame.h"
#include "components/viz/common/resources/returned_resource.h"
#include "components/viz/service/display_embedder/server_shared_bitmap_manager.h"
#include "content/browser/browser_main_loop.h"
+#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/gpu/content_gpu_client.h"
#include "gpu/command_buffer/service/mailbox_manager.h"
@@ -181,7 +183,7 @@ quint32 CompositorResourceTracker::consumeMailbox(const gpu::MailboxHolder &mail
bool CompositorResourceTracker::scheduleUpdateMailbox(CompositorResource *resource)
{
#if QT_CONFIG(opengl)
- gpu::SyncPointManager *syncPointManager = WebEngineContext::current()->syncPointManager();
+ gpu::SyncPointManager *syncPointManager = WebEngineContext::syncPointManager();
DCHECK(syncPointManager);
return syncPointManager->WaitOutOfOrder(
resource->mailbox_holder.sync_token,
@@ -241,8 +243,8 @@ void CompositorResourceTracker::updateMailboxes(std::vector<CompositorResource *
void CompositorResourceTracker::scheduleRunSubmitCallback()
{
- content::BrowserThread::PostTask(
- content::BrowserThread::UI, FROM_HERE,
+ base::PostTaskWithTraits(
+ FROM_HERE, { content::BrowserThread::UI },
base::BindOnce(&CompositorResourceTracker::runSubmitCallback,
m_weakPtrFactory.GetWeakPtr()));
}
diff --git a/src/core/compositor/content_gpu_client_qt.cpp b/src/core/compositor/content_gpu_client_qt.cpp
index 0317b503a..f934979a0 100644
--- a/src/core/compositor/content_gpu_client_qt.cpp
+++ b/src/core/compositor/content_gpu_client_qt.cpp
@@ -53,9 +53,7 @@ ContentGpuClientQt::~ContentGpuClientQt()
gpu::SyncPointManager *ContentGpuClientQt::GetSyncPointManager()
{
- WebEngineContext *current = WebEngineContext::current();
- Q_ASSERT(current);
- return current->syncPointManager();
+ return WebEngineContext::syncPointManager();
}
} // namespace
diff --git a/src/core/compositor/delegated_frame_node.cpp b/src/core/compositor/delegated_frame_node.cpp
index a4fcf8daf..e2b6714a1 100644
--- a/src/core/compositor/delegated_frame_node.cpp
+++ b/src/core/compositor/delegated_frame_node.cpp
@@ -952,8 +952,9 @@ void DelegatedFrameNode::handleQuad(
MailboxTexture *texture = static_cast<MailboxTexture *>(
initAndHoldTexture(resource, quad->ShouldDrawWithBlending(), apiDelegate, GL_TEXTURE_EXTERNAL_OES));
- nodeHandler->setupStreamVideoNode(texture, toQt(squad->rect), toQt(squad->matrix.matrix()),
- currentLayerChain);
+ QMatrix4x4 qMatrix;
+ convertToQt(squad->matrix.matrix(), qMatrix);
+ nodeHandler->setupStreamVideoNode(texture, toQt(squad->rect), qMatrix, currentLayerChain);
break;
#endif // GL_OES_EGL_image_external
#endif // QT_NO_OPENGL
diff --git a/src/core/config/common.pri b/src/core/config/common.pri
index ddb4ca4bf..be57942d2 100644
--- a/src/core/config/common.pri
+++ b/src/core/config/common.pri
@@ -4,6 +4,7 @@ QT_FOR_CONFIG += webenginecore
gn_args += \
use_qt=true \
+ closure_compile=false \
is_component_build=false \
is_shared=true \
enable_message_center=false \
@@ -11,15 +12,17 @@ gn_args += \
enable_nacl=false \
enable_remoting=false \
enable_reporting=false \
+ enable_swiftshader=false \
+ enable_web_auth=false \
enable_web_speech=false \
enable_widevine=true \
has_native_accessibility=false \
use_allocator_shim=false \
use_allocator=\"none\" \
+ use_custom_libcxx=false \
v8_use_external_startup_data=false \
- treat_warnings_as_errors=false \
- enable_swiftshader=false \
- use_custom_libcxx=false
+ toolkit_views=false \
+ treat_warnings_as_errors=false
!win32: gn_args += \
use_jumbo_build=true \
diff --git a/src/core/config/mac_osx.pri b/src/core/config/mac_osx.pri
index 4426901cf..e49df90e7 100644
--- a/src/core/config/mac_osx.pri
+++ b/src/core/config/mac_osx.pri
@@ -28,8 +28,6 @@ gn_args += \
clang_use_chrome_plugins=false \
mac_deployment_target=\"$${QMAKE_MACOSX_DEPLOYMENT_TARGET}\" \
mac_sdk_min=\"$${QMAKE_MAC_SDK_VERSION}\" \
- mac_views_browser=false \
- toolkit_views=false \
use_external_popup_menu=false
qtConfig(webengine-spellchecker) {
diff --git a/src/core/configure.json b/src/core/configure.json
index 4d2555dd2..755a525a8 100644
--- a/src/core/configure.json
+++ b/src/core/configure.json
@@ -84,9 +84,9 @@
]
},
"webengine-harfbuzz": {
- "label": "harfbuzz >= 1.4.2",
+ "label": "harfbuzz >= 2.0.0",
"sources": [
- { "type": "pkgConfig", "args": "harfbuzz >= 1.4.2" }
+ { "type": "pkgConfig", "args": "harfbuzz >= 2.0.0" }
]
},
"webengine-glib": {
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp
index 3fbea5a9f..98262570c 100644
--- a/src/core/content_browser_client_qt.cpp
+++ b/src/core/content_browser_client_qt.cpp
@@ -42,12 +42,16 @@
#include "base/json/json_reader.h"
#include "base/memory/ptr_util.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/message_loop/message_loop.h"
+#include "base/task/post_task.h"
+#include "base/threading/thread_restrictions.h"
#if QT_CONFIG(webengine_spellchecker)
#include "chrome/browser/spellchecker/spell_check_host_chrome_impl.h"
#endif
#include "components/network_hints/browser/network_hints_message_filter.h"
#include "content/browser/renderer_host/render_view_host_delegate.h"
#include "content/common/url_schemes.h"
+#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/client_certificate_delegate.h"
@@ -236,10 +240,10 @@ void ContentBrowserClientQt::RenderProcessWillLaunch(content::RenderProcessHost*
{
const int id = host->GetID();
Profile *profile = Profile::FromBrowserContext(host->GetBrowserContext());
- content::BrowserThread::PostTaskAndReplyWithResult(
- content::BrowserThread::IO, FROM_HERE,
- base::Bind(&net::URLRequestContextGetter::GetURLRequestContext, base::Unretained(profile->GetRequestContext())),
- base::Bind(&ContentBrowserClientQt::AddNetworkHintsMessageFilter, base::Unretained(this), id));
+ base::PostTaskWithTraitsAndReplyWithResult(
+ FROM_HERE, {content::BrowserThread::IO},
+ base::BindOnce(&net::URLRequestContextGetter::GetURLRequestContext, base::Unretained(profile->GetRequestContext())),
+ base::BindOnce(&ContentBrowserClientQt::AddNetworkHintsMessageFilter, base::Unretained(this), id));
// FIXME: Add a settings variable to enable/disable the file scheme.
content::ChildProcessSecurityPolicy::GetInstance()->GrantRequestScheme(id, url::kFileScheme);
@@ -597,11 +601,18 @@ void ContentBrowserClientQt::AddNetworkHintsMessageFilter(int render_process_id,
if (!host)
return;
- content::BrowserMessageFilter *network_hints_message_filter(
- new network_hints::NetworkHintsMessageFilter(context->host_resolver()));
+ content::BrowserMessageFilter *network_hints_message_filter =
+ new network_hints::NetworkHintsMessageFilter(render_process_id);
host->AddFilter(network_hints_message_filter);
}
+bool ContentBrowserClientQt::ShouldEnableStrictSiteIsolation()
+{
+ // mirroring AwContentBrowserClient, CastContentBrowserClient and
+ // HeadlessContentBrowserClient
+ return false;
+}
+
bool ContentBrowserClientQt::AllowGetCookie(const GURL &url,
const GURL &first_party,
const net::CookieList & /*cookie_list*/,
@@ -694,15 +705,13 @@ bool ContentBrowserClientQt::HandleExternalProtocol(
Q_UNUSED(child_id);
Q_UNUSED(navigation_data);
- content::BrowserThread::PostTask(
- content::BrowserThread::UI,
- FROM_HERE,
- base::BindOnce(&LaunchURL,
- url,
- web_contents_getter,
- page_transition,
- is_main_frame,
- has_user_gesture));
+ base::PostTaskWithTraits(FROM_HERE, {content::BrowserThread::UI},
+ base::BindOnce(&LaunchURL,
+ url,
+ web_contents_getter,
+ page_transition,
+ is_main_frame,
+ has_user_gesture));
return true;
}
diff --git a/src/core/content_browser_client_qt.h b/src/core/content_browser_client_qt.h
index 4a192818b..9e503cace 100644
--- a/src/core/content_browser_client_qt.h
+++ b/src/core/content_browser_client_qt.h
@@ -135,6 +135,7 @@ public:
bool user_gesture,
bool opener_suppressed,
bool* no_javascript_access) override;
+ bool ShouldEnableStrictSiteIsolation() override;
bool AllowGetCookie(const GURL& url,
const GURL& first_party,
diff --git a/src/core/content_client_qt.cpp b/src/core/content_client_qt.cpp
index def017916..41e3f7f6c 100644
--- a/src/core/content_client_qt.cpp
+++ b/src/core/content_client_qt.cpp
@@ -390,6 +390,11 @@ base::RefCountedMemory *ContentClientQt::GetDataResourceBytes(int resource_id) c
return ui::ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id);
}
+gfx::Image &ContentClientQt::GetNativeImageNamed(int resource_id) const
+{
+ return ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id);
+}
+
base::string16 ContentClientQt::GetLocalizedString(int message_id) const
{
return l10n_util::GetStringUTF16(message_id);
diff --git a/src/core/content_client_qt.h b/src/core/content_client_qt.h
index fbafa6a4b..c3feded00 100644
--- a/src/core/content_client_qt.h
+++ b/src/core/content_client_qt.h
@@ -58,7 +58,8 @@ public:
std::vector<media::CdmHostFilePath> *cdm_host_file_paths) override;
base::StringPiece GetDataResource(int, ui::ScaleFactor) const override;
- base::RefCountedMemory* GetDataResourceBytes(int resource_id) const override;
+ base::RefCountedMemory* GetDataResourceBytes(int resource_id) const override;
+ gfx::Image &GetNativeImageNamed(int resource_id) const override;
std::string GetUserAgent() const override { return getUserAgent(); }
base::string16 GetLocalizedString(int message_id) const override;
std::string GetProduct() const override;
diff --git a/src/core/content_main_delegate_qt.cpp b/src/core/content_main_delegate_qt.cpp
index 52895e312..dc32bb8c1 100644
--- a/src/core/content_main_delegate_qt.cpp
+++ b/src/core/content_main_delegate_qt.cpp
@@ -45,6 +45,7 @@
#include "base/path_service.h"
#include "base/strings/string_number_conversions.h"
#include "chrome/grit/generated_resources.h"
+#include "content/public/browser/browser_main_runner.h"
#include "content/public/common/content_paths.h"
#include "content/public/common/content_switches.h"
#include "ui/base/l10n/l10n_util.h"
@@ -72,6 +73,10 @@
#include <QtCore/qcoreapplication.h>
+namespace content {
+ContentClient *GetContentClient();
+}
+
namespace QtWebEngineCore {
// The logic of this function is based on chrome/common/net/net_resource_provider.cc
@@ -228,7 +233,8 @@ bool ContentMainDelegateQt::BasicStartupComplete(int *exit_code)
#if QT_CONFIG(webengine_spellchecker)
SafeOverridePath(base::DIR_APP_DICTIONARIES, WebEngineLibraryInfo::getPath(base::DIR_APP_DICTIONARIES));
#endif
- SetContentClient(new ContentClientQt);
+ if (!content::GetContentClient())
+ content::SetContentClient(new ContentClientQt);
url::CustomScheme::LoadSchemes(base::CommandLine::ForCurrentProcess());
diff --git a/src/core/devtools_frontend_qt.cpp b/src/core/devtools_frontend_qt.cpp
index 7a6635f17..40e30e008 100644
--- a/src/core/devtools_frontend_qt.cpp
+++ b/src/core/devtools_frontend_qt.cpp
@@ -56,11 +56,13 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/task/post_task.h"
#include "base/values.h"
#include "chrome/common/url_constants.h"
#include "components/prefs/in_memory_pref_store.h"
#include "components/prefs/json_pref_store.h"
#include "content/public/browser/browser_context.h"
+#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_handle.h"
@@ -140,8 +142,8 @@ int ResponseWriter::Write(net::IOBuffer *buffer, int num_bytes, net::CompletionO
base::Value *id = new base::Value(stream_id_);
base::Value *chunkValue = new base::Value(chunk);
- content::BrowserThread::PostTask(
- content::BrowserThread::UI, FROM_HERE,
+ base::PostTaskWithTraits(
+ FROM_HERE, {content::BrowserThread::UI},
base::BindOnce(&DevToolsFrontendQt::CallClientFunction,
shell_devtools_, "DevToolsAPI.streamWrite",
base::Owned(id), base::Owned(chunkValue), nullptr));
diff --git a/src/core/file_picker_controller.cpp b/src/core/file_picker_controller.cpp
index 3ded5ec41..a495ce6f2 100644
--- a/src/core/file_picker_controller.cpp
+++ b/src/core/file_picker_controller.cpp
@@ -41,6 +41,7 @@
#include "type_conversion.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/web_contents/web_contents_impl.h"
+#include "content/public/browser/file_select_listener.h"
#include <QFileInfo>
#include <QDir>
@@ -49,18 +50,20 @@
namespace QtWebEngineCore {
-FilePickerController::FilePickerController(FileChooserMode mode, content::RenderFrameHost *frameHost, const QString &defaultFileName, const QStringList &acceptedMimeTypes, QObject *parent)
+FilePickerController::FilePickerController(FileChooserMode mode, std::unique_ptr<content::FileSelectListener> listener, const QString &defaultFileName, const QStringList &acceptedMimeTypes, QObject *parent)
: QObject(parent)
, m_defaultFileName(defaultFileName)
, m_acceptedMimeTypes(acceptedMimeTypes)
- , m_frameHost(frameHost)
+ , m_listener(std::move(listener))
, m_mode(mode)
{
}
+FilePickerController::~FilePickerController() = default;
+
void FilePickerController::accepted(const QStringList &files)
{
- FilePickerController::filesSelectedInChooser(files, m_frameHost);
+ FilePickerController::filesSelectedInChooser(files);
}
void FilePickerController::accepted(const QVariant &files)
@@ -77,12 +80,12 @@ void FilePickerController::accepted(const QVariant &files)
qWarning("An unhandled type '%s' was provided in FilePickerController::accepted(QVariant)", files.typeName());
}
- FilePickerController::filesSelectedInChooser(stringList, m_frameHost);
+ FilePickerController::filesSelectedInChooser(stringList);
}
void FilePickerController::rejected()
{
- FilePickerController::filesSelectedInChooser(QStringList(), m_frameHost);
+ FilePickerController::filesSelectedInChooser(QStringList());
}
static QStringList listRecursively(const QDir &dir)
@@ -99,19 +102,29 @@ static QStringList listRecursively(const QDir &dir)
return ret;
}
-ASSERT_ENUMS_MATCH(FilePickerController::Open, content::FileChooserParams::Open)
-ASSERT_ENUMS_MATCH(FilePickerController::OpenMultiple, content::FileChooserParams::OpenMultiple)
-ASSERT_ENUMS_MATCH(FilePickerController::UploadFolder, content::FileChooserParams::UploadFolder)
-ASSERT_ENUMS_MATCH(FilePickerController::Save, content::FileChooserParams::Save)
+ASSERT_ENUMS_MATCH(FilePickerController::Open, blink::mojom::FileChooserParams_Mode::kOpen)
+ASSERT_ENUMS_MATCH(FilePickerController::OpenMultiple, blink::mojom::FileChooserParams_Mode::kOpenMultiple)
+ASSERT_ENUMS_MATCH(FilePickerController::UploadFolder, blink::mojom::FileChooserParams_Mode::kUploadFolder)
+ASSERT_ENUMS_MATCH(FilePickerController::Save, blink::mojom::FileChooserParams_Mode::kSave)
-void FilePickerController::filesSelectedInChooser(const QStringList &filesList, content::RenderFrameHost *frameHost)
+void FilePickerController::filesSelectedInChooser(const QStringList &filesList)
{
- Q_ASSERT(frameHost);
QStringList files(filesList);
if (this->m_mode == UploadFolder && !filesList.isEmpty()
&& QFileInfo(filesList.first()).isDir()) // Enumerate the directory
files = listRecursively(QDir(filesList.first()));
- frameHost->FilesSelectedInChooser(toVector<content::FileChooserFileInfo>(files), static_cast<content::FileChooserParams::Mode>(this->m_mode));
+
+ std::vector<blink::mojom::FileChooserFileInfoPtr> chooser_files;
+ for (const auto &file : qAsConst(files)) {
+ chooser_files.push_back(blink::mojom::FileChooserFileInfo::NewNativeFile(
+ blink::mojom::NativeFileInfo::New(toFilePath(file), base::string16())));
+ }
+
+ if (files.isEmpty())
+ m_listener->FileSelectionCanceled();
+ else
+ m_listener->FileSelected(std::move(chooser_files),
+ static_cast<blink::mojom::FileChooserParams::Mode>(this->m_mode));
}
QStringList FilePickerController::acceptedMimeTypes() const
diff --git a/src/core/file_picker_controller.h b/src/core/file_picker_controller.h
index 7507cf358..613d3ad9b 100644
--- a/src/core/file_picker_controller.h
+++ b/src/core/file_picker_controller.h
@@ -52,11 +52,14 @@
#define FILE_PICKER_CONTROLLER_H
#include "qtwebenginecoreglobal_p.h"
+
+#include <memory>
+
#include <QObject>
#include <QStringList>
namespace content {
- class RenderFrameHost;
+ class FileSelectListener;
}
namespace QtWebEngineCore {
@@ -71,7 +74,8 @@ public:
Save
};
- FilePickerController(FileChooserMode mode, content::RenderFrameHost *contents, const QString &defaultFileName, const QStringList &acceptedMimeTypes, QObject * = 0);
+ FilePickerController(FileChooserMode mode, std::unique_ptr<content::FileSelectListener> listener, const QString &defaultFileName, const QStringList &acceptedMimeTypes, QObject * = 0);
+ ~FilePickerController() override;
QStringList acceptedMimeTypes() const;
QString defaultFileName() const;
FileChooserMode mode() const;
@@ -82,10 +86,10 @@ public Q_SLOTS:
void rejected();
private:
- void filesSelectedInChooser(const QStringList &filesList, content::RenderFrameHost *contents);
+ void filesSelectedInChooser(const QStringList &filesList);
QString m_defaultFileName;
QStringList m_acceptedMimeTypes;
- content::RenderFrameHost *m_frameHost;
+ std::unique_ptr<content::FileSelectListener> m_listener;
FileChooserMode m_mode;
};
diff --git a/src/core/media_capture_devices_dispatcher.cpp b/src/core/media_capture_devices_dispatcher.cpp
index 4dd933753..a0b19cad3 100644
--- a/src/core/media_capture_devices_dispatcher.cpp
+++ b/src/core/media_capture_devices_dispatcher.cpp
@@ -233,8 +233,9 @@ void MediaCaptureDevicesDispatcher::handleMediaAccessPermissionResponse(content:
// Post a task to process next queued request. It has to be done
// asynchronously to make sure that calling infobar is not destroyed until
// after this function returns.
- BrowserThread::PostTask(
- BrowserThread::UI, FROM_HERE, base::BindOnce(&MediaCaptureDevicesDispatcher::ProcessQueuedAccessRequest, base::Unretained(this), webContents));
+ base::PostTaskWithTraits(FROM_HERE, {BrowserThread::UI},
+ base::BindOnce(&MediaCaptureDevicesDispatcher::ProcessQueuedAccessRequest,
+ base::Unretained(this), webContents));
}
std::move(callback).Run(devices, devices.empty() ? content::MEDIA_DEVICE_INVALID_STATE : content::MEDIA_DEVICE_OK,
@@ -393,12 +394,10 @@ void MediaCaptureDevicesDispatcher::getDefaultDevices(const std::string &audioDe
void MediaCaptureDevicesDispatcher::OnMediaRequestStateChanged(int render_process_id, int render_frame_id, int page_request_id, const GURL &security_origin, content::MediaStreamType stream_type, content::MediaRequestState state)
{
DCHECK_CURRENTLY_ON(BrowserThread::IO);
- BrowserThread::PostTask(
- BrowserThread::UI, FROM_HERE,
- base::Bind(
- &MediaCaptureDevicesDispatcher::updateMediaRequestStateOnUIThread,
- base::Unretained(this), render_process_id, render_frame_id,
- page_request_id, security_origin, stream_type, state));
+ base::PostTaskWithTraits(FROM_HERE, {BrowserThread::UI},
+ base::BindOnce(&MediaCaptureDevicesDispatcher::updateMediaRequestStateOnUIThread,
+ base::Unretained(this), render_process_id, render_frame_id,
+ page_request_id, security_origin, stream_type, state));
}
void MediaCaptureDevicesDispatcher::updateMediaRequestStateOnUIThread(int render_process_id,
diff --git a/src/core/net/cookie_monster_delegate_qt.cpp b/src/core/net/cookie_monster_delegate_qt.cpp
index bb89e9e5f..3253b08b9 100644
--- a/src/core/net/cookie_monster_delegate_qt.cpp
+++ b/src/core/net/cookie_monster_delegate_qt.cpp
@@ -41,6 +41,8 @@
#include "base/bind.h"
#include "base/memory/ptr_util.h"
+#include "base/task/post_task.h"
+#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "net/cookies/cookie_util.h"
@@ -87,8 +89,8 @@ void CookieMonsterDelegateQt::getAllCookies(quint64 callbackId)
net::CookieMonster::GetCookieListCallback callback =
base::BindOnce(&CookieMonsterDelegateQt::GetAllCookiesCallbackOnIOThread, this, callbackId);
- content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE,
- base::BindOnce(&CookieMonsterDelegateQt::GetAllCookiesOnIOThread, this, std::move(callback)));
+ base::PostTaskWithTraits(FROM_HERE, {content::BrowserThread::IO},
+ base::BindOnce(&CookieMonsterDelegateQt::GetAllCookiesOnIOThread, this, std::move(callback)));
}
void CookieMonsterDelegateQt::GetAllCookiesOnIOThread(net::CookieMonster::GetCookieListCallback callback)
@@ -108,9 +110,9 @@ void CookieMonsterDelegateQt::setCookie(quint64 callbackId, const QNetworkCookie
GURL gurl = origin.isEmpty() ? sourceUrlForCookie(cookie) : toGurl(origin);
- content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE,
- base::BindOnce(&CookieMonsterDelegateQt::SetCookieOnIOThread, this,
- gurl, cookie.toRawForm().toStdString(), std::move(callback)));
+ base::PostTaskWithTraits(FROM_HERE, {content::BrowserThread::IO},
+ base::BindOnce(&CookieMonsterDelegateQt::SetCookieOnIOThread, this,
+ gurl, cookie.toRawForm().toStdString(), std::move(callback)));
}
void CookieMonsterDelegateQt::SetCookieOnIOThread(
@@ -131,9 +133,9 @@ void CookieMonsterDelegateQt::deleteCookie(const QNetworkCookie &cookie, const Q
GURL gurl = origin.isEmpty() ? sourceUrlForCookie(cookie) : toGurl(origin);
- content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE,
- base::BindOnce(&CookieMonsterDelegateQt::DeleteCookieOnIOThread, this,
- gurl, cookie.name().toStdString()));
+ base::PostTaskWithTraits(FROM_HERE, {content::BrowserThread::IO},
+ base::BindOnce(&CookieMonsterDelegateQt::DeleteCookieOnIOThread, this,
+ gurl, cookie.name().toStdString()));
}
void CookieMonsterDelegateQt::DeleteCookieOnIOThread(const GURL& url, const std::string& cookie_name)
@@ -149,8 +151,8 @@ void CookieMonsterDelegateQt::deleteSessionCookies(quint64 callbackId)
net::CookieMonster::DeleteCallback callback =
base::BindOnce(&CookieMonsterDelegateQt::DeleteCookiesCallbackOnIOThread, this, callbackId);
- content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE,
- base::BindOnce(&CookieMonsterDelegateQt::DeleteSessionCookiesOnIOThread, this, std::move(callback)));
+ base::PostTaskWithTraits(FROM_HERE, {content::BrowserThread::IO},
+ base::BindOnce(&CookieMonsterDelegateQt::DeleteSessionCookiesOnIOThread, this, std::move(callback)));
}
void CookieMonsterDelegateQt::DeleteSessionCookiesOnIOThread(net::CookieMonster::DeleteCallback callback)
@@ -166,8 +168,8 @@ void CookieMonsterDelegateQt::deleteAllCookies(quint64 callbackId)
net::CookieMonster::DeleteCallback callback =
base::BindOnce(&CookieMonsterDelegateQt::DeleteCookiesCallbackOnIOThread, this, callbackId);
- content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE,
- base::BindOnce(&CookieMonsterDelegateQt::DeleteAllOnIOThread, this, std::move(callback)));
+ base::PostTaskWithTraits(FROM_HERE, {content::BrowserThread::IO},
+ base::BindOnce(&CookieMonsterDelegateQt::DeleteAllOnIOThread, this, std::move(callback)));
}
void CookieMonsterDelegateQt::DeleteAllOnIOThread(net::CookieMonster::DeleteCallback callback)
@@ -238,26 +240,23 @@ void CookieMonsterDelegateQt::GetAllCookiesCallbackOnIOThread(qint64 callbackId,
for (auto &&cookie : cookies)
rawCookies += toQt(cookie).toRawForm() % QByteArrayLiteral("\n");
- content::BrowserThread::PostTask(
- content::BrowserThread::UI,
- FROM_HERE,
- base::BindOnce(&CookieMonsterDelegateQt::GetAllCookiesCallbackOnUIThread, this, callbackId, rawCookies));
+ base::PostTaskWithTraits(
+ FROM_HERE, {content::BrowserThread::UI},
+ base::BindOnce(&CookieMonsterDelegateQt::GetAllCookiesCallbackOnUIThread, this, callbackId, rawCookies));
}
void CookieMonsterDelegateQt::SetCookieCallbackOnIOThread(qint64 callbackId, bool success)
{
- content::BrowserThread::PostTask(
- content::BrowserThread::UI,
- FROM_HERE,
- base::BindOnce(&CookieMonsterDelegateQt::SetCookieCallbackOnUIThread, this, callbackId, success));
+ base::PostTaskWithTraits(
+ FROM_HERE, {content::BrowserThread::UI},
+ base::BindOnce(&CookieMonsterDelegateQt::SetCookieCallbackOnUIThread, this, callbackId, success));
}
void CookieMonsterDelegateQt::DeleteCookiesCallbackOnIOThread(qint64 callbackId, uint numCookies)
{
- content::BrowserThread::PostTask(
- content::BrowserThread::UI,
- FROM_HERE,
- base::BindOnce(&CookieMonsterDelegateQt::DeleteCookiesCallbackOnUIThread, this, callbackId, numCookies));
+ base::PostTaskWithTraits(
+ FROM_HERE, {content::BrowserThread::UI},
+ base::BindOnce(&CookieMonsterDelegateQt::DeleteCookiesCallbackOnUIThread, this, callbackId, numCookies));
}
void CookieMonsterDelegateQt::GetAllCookiesCallbackOnUIThread(qint64 callbackId, const QByteArray &cookies)
diff --git a/src/core/net/network_delegate_qt.cpp b/src/core/net/network_delegate_qt.cpp
index be31b6104..73f3ff818 100644
--- a/src/core/net/network_delegate_qt.cpp
+++ b/src/core/net/network_delegate_qt.cpp
@@ -39,16 +39,19 @@
#include "network_delegate_qt.h"
-#include "profile_adapter.h"
+#include "base/task/post_task.h"
#include "content/browser/web_contents/web_contents_impl.h"
+#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/resource_request_info.h"
-#include "cookie_monster_delegate_qt.h"
-#include "ui/base/page_transition_types.h"
-#include "profile_io_data_qt.h"
#include "net/base/load_flags.h"
#include "net/url_request/url_request.h"
+#include "ui/base/page_transition_types.h"
+
+#include "profile_adapter.h"
+#include "cookie_monster_delegate_qt.h"
+#include "profile_io_data_qt.h"
#include "qwebengineurlrequestinfo.h"
#include "qwebengineurlrequestinfo_p.h"
#include "qwebengineurlrequestinterceptor.h"
@@ -119,10 +122,10 @@ public:
m_request->SetUserData(UserData::key, std::make_unique<UserData>(this));
- content::BrowserThread::PostTask(
- content::BrowserThread::UI,
+ base::PostTaskWithTraits(
FROM_HERE,
- base::Bind(&URLRequestNotification::notify, base::Unretained(this)));
+ {content::BrowserThread::UI},
+ base::BindOnce(&URLRequestNotification::notify, base::Unretained(this)));
}
private:
@@ -185,9 +188,9 @@ private:
}
// Run the callback on the IO thread.
- content::BrowserThread::PostTask(
- content::BrowserThread::IO,
+ base::PostTaskWithTraits(
FROM_HERE,
+ {content::BrowserThread::IO},
base::BindOnce(&URLRequestNotification::complete, base::Unretained(this), error));
}
@@ -315,13 +318,18 @@ void NetworkDelegateQt::OnCompleted(net::URLRequest */*request*/, bool /*started
bool NetworkDelegateQt::OnCanSetCookie(const net::URLRequest& request,
const net::CanonicalCookie & /*cookie*/,
- net::CookieOptions*)
+ net::CookieOptions*,
+ bool allowedFromCaller)
{
+ if (!allowedFromCaller)
+ return false;
return canSetCookies(request.site_for_cookies(), request.url(), std::string());
}
-bool NetworkDelegateQt::OnCanGetCookies(const net::URLRequest& request, const net::CookieList&)
+bool NetworkDelegateQt::OnCanGetCookies(const net::URLRequest& request, const net::CookieList&, bool allowedFromCaller)
{
+ if (!allowedFromCaller)
+ return false;
return canGetCookies(request.site_for_cookies(), request.url());
}
diff --git a/src/core/net/network_delegate_qt.h b/src/core/net/network_delegate_qt.h
index e4ff196aa..842af5006 100644
--- a/src/core/net/network_delegate_qt.h
+++ b/src/core/net/network_delegate_qt.h
@@ -62,7 +62,7 @@ public:
// net::NetworkDelegate implementation
int OnBeforeURLRequest(net::URLRequest* request, net::CompletionOnceCallback callback, GURL* new_url) override;
void OnURLRequestDestroyed(net::URLRequest* request) override;
- bool OnCanSetCookie(const net::URLRequest& request, const net::CanonicalCookie& cookie, net::CookieOptions* options) override;
+ bool OnCanSetCookie(const net::URLRequest& request, const net::CanonicalCookie& cookie, net::CookieOptions* options, bool) override;
int OnBeforeStartTransaction(net::URLRequest *request, const net::CompletionOnceCallback callback, net::HttpRequestHeaders *headers) override;
void OnBeforeSendHeaders(net::URLRequest* request, const net::ProxyInfo& proxy_info,
const net::ProxyRetryInfoMap& proxy_retry_info, net::HttpRequestHeaders* headers) override;
@@ -75,7 +75,7 @@ public:
void OnCompleted(net::URLRequest *request, bool started, int net_error) override;
void OnPACScriptError(int, const base::string16&) override;
net::NetworkDelegate::AuthRequiredResponse OnAuthRequired(net::URLRequest*, const net::AuthChallengeInfo&, AuthCallback, net::AuthCredentials*) override;
- bool OnCanGetCookies(const net::URLRequest&, const net::CookieList&) override;
+ bool OnCanGetCookies(const net::URLRequest&, const net::CookieList&, bool) override;
bool OnCanAccessFile(const net::URLRequest&, const base::FilePath&, const base::FilePath&) const override;
bool OnCanEnablePrivacyMode(const GURL&, const GURL&) const override;
bool OnAreExperimentalCookieFeaturesEnabled() const override;
diff --git a/src/core/net/url_request_context_getter_qt.cpp b/src/core/net/url_request_context_getter_qt.cpp
index 636d27358..6081a5e9f 100644
--- a/src/core/net/url_request_context_getter_qt.cpp
+++ b/src/core/net/url_request_context_getter_qt.cpp
@@ -40,6 +40,10 @@
#include "url_request_context_getter_qt.h"
#include "profile_io_data_qt.h"
+#include "base/task/post_task.h"
+#include "content/public/browser/browser_task_traits.h"
+#include "content/public/browser/browser_thread.h"
+
namespace QtWebEngineCore {
URLRequestContextGetterQt::URLRequestContextGetterQt(ProfileIODataQt *data)
@@ -59,7 +63,7 @@ net::URLRequestContext *URLRequestContextGetterQt::GetURLRequestContext()
scoped_refptr<base::SingleThreadTaskRunner> URLRequestContextGetterQt::GetNetworkTaskRunner() const
{
- return content::BrowserThread::GetTaskRunnerForThread(content::BrowserThread::IO);
+ return base::CreateSingleThreadTaskRunnerWithTraits({content::BrowserThread::IO});
}
} // namespace QtWebEngineCore
diff --git a/src/core/net/url_request_custom_job.cpp b/src/core/net/url_request_custom_job.cpp
index d371c7bff..edea155a1 100644
--- a/src/core/net/url_request_custom_job.cpp
+++ b/src/core/net/url_request_custom_job.cpp
@@ -39,6 +39,9 @@
#include "url_request_custom_job.h"
#include "url_request_custom_job_proxy.h"
+
+#include "base/task/post_task.h"
+#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "net/base/io_buffer.h"
@@ -68,17 +71,16 @@ URLRequestCustomJob::~URLRequestCustomJob()
if (m_device && m_device->isOpen())
m_device->close();
m_device = nullptr;
- content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE,
- base::Bind(&URLRequestCustomJobProxy::release,
- m_proxy));
+ base::PostTaskWithTraits(FROM_HERE, {content::BrowserThread::UI},
+ base::BindOnce(&URLRequestCustomJobProxy::release, m_proxy));
}
void URLRequestCustomJob::Start()
{
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
- content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE,
- base::Bind(&URLRequestCustomJobProxy::initialize,
- m_proxy, request()->url(), request()->method(), request()->initiator()));
+ base::PostTaskWithTraits(FROM_HERE, {content::BrowserThread::UI},
+ base::BindOnce(&URLRequestCustomJobProxy::initialize,
+ m_proxy, request()->url(), request()->method(), request()->initiator()));
}
void URLRequestCustomJob::Kill()
@@ -94,9 +96,9 @@ void URLRequestCustomJob::Kill()
m_pendingReadPos = 0;
}
m_device = nullptr;
- content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE,
- base::Bind(&URLRequestCustomJobProxy::release,
- m_proxy));
+ base::PostTaskWithTraits(FROM_HERE, {content::BrowserThread::UI},
+ base::BindOnce(&URLRequestCustomJobProxy::release,
+ m_proxy));
URLRequestJob::Kill();
}
diff --git a/src/core/net/url_request_custom_job_delegate.cpp b/src/core/net/url_request_custom_job_delegate.cpp
index 338bd7137..d968dd341 100644
--- a/src/core/net/url_request_custom_job_delegate.cpp
+++ b/src/core/net/url_request_custom_job_delegate.cpp
@@ -40,9 +40,12 @@
#include "url_request_custom_job_delegate.h"
#include "url_request_custom_job_proxy.h"
-#include "type_conversion.h"
-#include "net/base/net_errors.h"
+#include "base/task/post_task.h"
+#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
+#include "net/base/net_errors.h"
+
+#include "type_conversion.h"
#include <QByteArray>
@@ -82,28 +85,27 @@ void URLRequestCustomJobDelegate::reply(const QByteArray &contentType, QIODevice
{
if (device)
QObject::connect(device, &QIODevice::readyRead, this, &URLRequestCustomJobDelegate::slotReadyRead);
- content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE,
- base::Bind(&URLRequestCustomJobProxy::reply,
- m_proxy,contentType.toStdString(),device));
+ base::PostTaskWithTraits(FROM_HERE, {content::BrowserThread::IO},
+ base::BindOnce(&URLRequestCustomJobProxy::reply,
+ m_proxy,contentType.toStdString(),device));
}
void URLRequestCustomJobDelegate::slotReadyRead()
{
- content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE,
- base::Bind(&URLRequestCustomJobProxy::readyRead, m_proxy));
+ base::PostTaskWithTraits(FROM_HERE, {content::BrowserThread::IO},
+ base::BindOnce(&URLRequestCustomJobProxy::readyRead, m_proxy));
}
void URLRequestCustomJobDelegate::abort()
{
- content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE,
- base::Bind(&URLRequestCustomJobProxy::abort, m_proxy));
+ base::PostTaskWithTraits(FROM_HERE, {content::BrowserThread::IO},
+ base::BindOnce(&URLRequestCustomJobProxy::abort, m_proxy));
}
void URLRequestCustomJobDelegate::redirect(const QUrl &url)
{
- content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE,
- base::Bind(&URLRequestCustomJobProxy::redirect,
- m_proxy, toGurl(url)));
+ base::PostTaskWithTraits(FROM_HERE, {content::BrowserThread::IO},
+ base::BindOnce(&URLRequestCustomJobProxy::redirect, m_proxy, toGurl(url)));
}
void URLRequestCustomJobDelegate::fail(Error error)
@@ -129,9 +131,8 @@ void URLRequestCustomJobDelegate::fail(Error error)
break;
}
if (net_error) {
- content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE,
- base::Bind(&URLRequestCustomJobProxy::fail,
- m_proxy, net_error));
+ base::PostTaskWithTraits(FROM_HERE, {content::BrowserThread::IO},
+ base::BindOnce(&URLRequestCustomJobProxy::fail, m_proxy, net_error));
}
}
diff --git a/src/core/ozone/gl_surface_egl_qt.cpp b/src/core/ozone/gl_surface_egl_qt.cpp
index 9fe5985ce..8715a5095 100644
--- a/src/core/ozone/gl_surface_egl_qt.cpp
+++ b/src/core/ozone/gl_surface_egl_qt.cpp
@@ -44,9 +44,9 @@
#include "gl_context_qt.h"
#include "ozone/gl_surface_egl_qt.h"
-#include "ui/gl/gl_surface_egl.h"
#if !defined(OS_MACOSX)
#include "ui/gl/egl_util.h"
+#include "ui/gl/gl_surface_egl.h"
#include "ui/gl/init/gl_factory.h"
// From ANGLE's egl/eglext.h.
@@ -302,10 +302,6 @@ void* GLSurfacelessQtEGL::GetShareHandle()
return NULL;
}
-} // namespace gl
-#endif // !defined(OS_MACOSX)
-
-namespace gl {
std::string DriverEGL::GetPlatformExtensions()
{
EGLDisplay display = GLContextHelper::getEGLDisplay();
@@ -317,3 +313,15 @@ std::string DriverEGL::GetPlatformExtensions()
return str ? std::string(str) : "";
}
} // namespace gl
+#else
+namespace gl {
+struct GL_EXPORT DriverEGL {
+ static std::string GetPlatformExtensions();
+};
+
+std::string DriverEGL::GetPlatformExtensions()
+{
+ return "";
+}
+} // namespace gl
+#endif // !defined(OS_MACOSX)
diff --git a/src/core/ozone/gl_surface_qt.cpp b/src/core/ozone/gl_surface_qt.cpp
index 7cde289ae..551ba888c 100644
--- a/src/core/ozone/gl_surface_qt.cpp
+++ b/src/core/ozone/gl_surface_qt.cpp
@@ -64,7 +64,6 @@
#include "ozone/gl_surface_wgl_qt.h"
#include "gpu/ipc/service/direct_composition_surface_win.h"
-#include "ui/gl/gl_context_wgl.h"
#include "ui/gl/vsync_provider_win.h"
#endif
@@ -141,9 +140,6 @@ bool InitializeGLOneOffPlatform()
{
VSyncProviderWin::InitializeOneOff();
- if (GetGLImplementation() == kGLImplementationOSMesaGL)
- return false;
-
if (GetGLImplementation() == kGLImplementationEGLGLES2)
return GLSurfaceEGLQt::InitializeOneOff();
diff --git a/src/core/ozone/gl_surface_wgl_qt.cpp b/src/core/ozone/gl_surface_wgl_qt.cpp
index 7c9e87b86..ac27a9c20 100644
--- a/src/core/ozone/gl_surface_wgl_qt.cpp
+++ b/src/core/ozone/gl_surface_wgl_qt.cpp
@@ -37,9 +37,9 @@
**
****************************************************************************/
-#if defined(OS_WIN)
-
#include "gl_surface_wgl_qt.h"
+
+#if defined(OS_WIN)
#include "ui/gl/gl_surface_wgl.h"
namespace gl {
diff --git a/src/core/permission_manager_qt.cpp b/src/core/permission_manager_qt.cpp
index 895fe89e6..b6d055e27 100644
--- a/src/core/permission_manager_qt.cpp
+++ b/src/core/permission_manager_qt.cpp
@@ -72,6 +72,7 @@ ProfileAdapter::PermissionType toQt(content::PermissionType type)
case content::PermissionType::CLIPBOARD_READ:
case content::PermissionType::CLIPBOARD_WRITE:
case content::PermissionType::PAYMENT_HANDLER:
+ case content::PermissionType::BACKGROUND_FETCH:
case content::PermissionType::NUM:
break;
}
diff --git a/src/core/printing/print_view_manager_base_qt.cpp b/src/core/printing/print_view_manager_base_qt.cpp
index 625ec3a49..1a16be69e 100644
--- a/src/core/printing/print_view_manager_base_qt.cpp
+++ b/src/core/printing/print_view_manager_base_qt.cpp
@@ -52,6 +52,7 @@
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
+#include "base/task/post_task.h"
#include "base/timer/timer.h"
#include "base/values.h"
#include "chrome/browser/chrome_notification_types.h"
@@ -59,6 +60,7 @@
#include "chrome/browser/printing/print_job_manager.h"
#include "chrome/browser/printing/printer_query.h"
#include "components/printing/common/print_messages.h"
+#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_view_host.h"
@@ -155,21 +157,19 @@ void PrintViewManagerBaseQt::OnDidPrintDocument(content::RenderFrameHost* /*rend
return;
const PrintHostMsg_DidPrintContent_Params &content = params.content;
- if (!base::SharedMemory::IsHandleValid(content.metafile_data_handle)) {
+ if (!content.metafile_data_region.IsValid()) {
NOTREACHED() << "invalid memory handle";
web_contents()->Stop();
return;
}
- std::unique_ptr<base::SharedMemory> shared_buf =
- std::make_unique<base::SharedMemory>(content.metafile_data_handle, true);
- if (!shared_buf->Map(content.data_size)) {
+ auto data = base::RefCountedSharedMemoryMapping::CreateFromWholeRegion(content.metafile_data_region);
+ if (!data) {
NOTREACHED() << "couldn't map";
web_contents()->Stop();
return;
}
- auto data = base::MakeRefCounted<base::RefCountedSharedMemory>(
- std::move(shared_buf), content.data_size);
+
PrintDocument(document, data, params.page_size, params.content_area,
params.physical_offsets);
}
@@ -516,9 +516,8 @@ void PrintViewManagerBaseQt::ReleasePrinterQuery()
printerQuery = m_printerQueriesQueue->PopPrinterQuery(cookie);
if (!printerQuery.get())
return;
- content::BrowserThread::PostTask(
- content::BrowserThread::IO, FROM_HERE,
- base::BindOnce(&printing::PrinterQuery::StopWorker, printerQuery.get()));
+ base::PostTaskWithTraits(FROM_HERE, {content::BrowserThread::IO},
+ base::BindOnce(&printing::PrinterQuery::StopWorker, printerQuery.get()));
}
// Originally from print_preview_message_handler.cc:
@@ -528,7 +527,7 @@ void PrintViewManagerBaseQt::StopWorker(int documentCookie) {
scoped_refptr<printing::PrinterQuery> printer_query =
m_printerQueriesQueue->PopPrinterQuery(documentCookie);
if (printer_query.get()) {
- content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE,
+ base::PostTaskWithTraits(FROM_HERE, {content::BrowserThread::IO},
base::BindOnce(&printing::PrinterQuery::StopWorker, printer_query));
}
}
diff --git a/src/core/printing/print_view_manager_qt.cpp b/src/core/printing/print_view_manager_qt.cpp
index 61be7f0f6..e88f48624 100644
--- a/src/core/printing/print_view_manager_qt.cpp
+++ b/src/core/printing/print_view_manager_qt.cpp
@@ -59,6 +59,7 @@
#include "components/printing/common/print_messages.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/web_contents/web_contents_impl.h"
+#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/common/web_preferences.h"
@@ -70,31 +71,25 @@ namespace {
static const qreal kMicronsToMillimeter = 1000.0f;
-static QSharedPointer<QByteArray>
-GetByteArrayFromHandle(base::SharedMemoryHandle handle, uint32_t data_size)
+static QSharedPointer<QByteArray> GetStdVectorFromHandle(const base::ReadOnlySharedMemoryRegion &handle)
{
- std::unique_ptr<base::SharedMemory> shared_buf(
- new base::SharedMemory(handle, true));
-
- if (!shared_buf->Map(data_size)) {
+ base::ReadOnlySharedMemoryMapping map = handle.Map();
+ if (!map.IsValid())
return QSharedPointer<QByteArray>(new QByteArray);
- }
- char* data = static_cast<char*>(shared_buf->memory());
- return QSharedPointer<QByteArray>(new QByteArray(data, data_size));
+ const char* data = static_cast<const char*>(map.memory());
+ return QSharedPointer<QByteArray>(new QByteArray(data, map.size()));
}
static scoped_refptr<base::RefCountedBytes>
-GetBytesFromHandle(base::SharedMemoryHandle handle, uint32_t data_size)
+GetBytesFromHandle(const base::ReadOnlySharedMemoryRegion &handle)
{
- std::unique_ptr<base::SharedMemory> shared_buf(new base::SharedMemory(handle, true));
-
- if (!shared_buf->Map(data_size)) {
+ base::ReadOnlySharedMemoryMapping map = handle.Map();
+ if (!map.IsValid())
return nullptr;
- }
- unsigned char* data = static_cast<unsigned char*>(shared_buf->memory());
- std::vector<unsigned char> dataVector(data, data + data_size);
+ const unsigned char* data = static_cast<const unsigned char*>(map.memory());
+ std::vector<unsigned char> dataVector(data, data + map.size());
return base::RefCountedBytes::TakeVector(&dataVector);
}
@@ -112,9 +107,8 @@ static void SavePdfFile(scoped_refptr<base::RefCountedBytes> data,
base::File file(path,
base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE);
bool success = file.IsValid() && metafile.SaveTo(&file);
- content::BrowserThread::PostTask(content::BrowserThread::UI,
- FROM_HERE,
- base::Bind(saveCallback, success));
+ base::PostTaskWithTraits(FROM_HERE, {content::BrowserThread::UI},
+ base::BindOnce(saveCallback, success));
}
static base::DictionaryValue *createPrintSettings()
@@ -220,16 +214,16 @@ void PrintViewManagerQt::PrintToPDFFileWithCallback(const QPageLayout &pageLayou
return;
if (m_printSettings || !filePath.length()) {
- content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE,
- base::Bind(callback, false));
+ base::PostTaskWithTraits(FROM_HERE, {content::BrowserThread::UI},
+ base::BindOnce(callback, false));
return;
}
m_pdfOutputPath = toFilePath(filePath);
m_pdfSaveCallback = callback;
if (!PrintToPDFInternal(pageLayout, printInColor)) {
- content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE,
- base::Bind(callback, false));
+ base::PostTaskWithTraits(FROM_HERE, {content::BrowserThread::UI},
+ base::BindOnce(callback, false));
resetPdfState();
}
}
@@ -244,16 +238,15 @@ void PrintViewManagerQt::PrintToPDFWithCallback(const QPageLayout &pageLayout,
// If there already is a pending print in progress, don't try starting another one.
if (m_printSettings) {
- content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE,
- base::Bind(callback, QSharedPointer<QByteArray>()));
+ base::PostTaskWithTraits(FROM_HERE, {content::BrowserThread::UI},
+ base::BindOnce(callback, QSharedPointer<QByteArray>()));
return;
}
m_pdfPrintCallback = callback;
if (!PrintToPDFInternal(pageLayout, printInColor, useCustomMargins)) {
- content::BrowserThread::PostTask(content::BrowserThread::UI,
- FROM_HERE,
- base::Bind(callback, QSharedPointer<QByteArray>()));
+ base::PostTaskWithTraits(FROM_HERE, {content::BrowserThread::UI},
+ base::BindOnce(callback, QSharedPointer<QByteArray>()));
resetPdfState();
}
@@ -356,21 +349,18 @@ void PrintViewManagerQt::OnMetafileReadyForPrinting(content::RenderFrameHost* rf
StopWorker(params.document_cookie);
// Create local copies so we can reset the state and take a new pdf print job.
- base::Callback<void(QSharedPointer<QByteArray>)> pdf_print_callback = m_pdfPrintCallback;
- base::Callback<void(bool)> pdf_save_callback = m_pdfSaveCallback;
+ PrintToPDFCallback pdf_print_callback = std::move(m_pdfPrintCallback);
+ PrintToPDFFileCallback pdf_save_callback = std::move(m_pdfSaveCallback);
base::FilePath pdfOutputPath = m_pdfOutputPath;
resetPdfState();
if (!pdf_print_callback.is_null()) {
- QSharedPointer<QByteArray> data_array = GetByteArrayFromHandle(params.content.metafile_data_handle,
- params.content.data_size);
- content::BrowserThread::PostTask(content::BrowserThread::UI,
- FROM_HERE,
- base::Bind(pdf_print_callback, data_array));
+ QSharedPointer<QByteArray> data_array = GetStdVectorFromHandle(params.content.metafile_data_region);
+ base::PostTaskWithTraits(FROM_HERE, {content::BrowserThread::UI},
+ base::BindOnce(pdf_print_callback, data_array));
} else {
- scoped_refptr<base::RefCountedBytes> data_bytes
- = GetBytesFromHandle(params.content.metafile_data_handle, params.content.data_size);
+ scoped_refptr<base::RefCountedBytes> data_bytes = GetBytesFromHandle(params.content.metafile_data_region);
base::PostTaskWithTraits(FROM_HERE, {base::MayBlock()},
base::BindOnce(&SavePdfFile, data_bytes, pdfOutputPath, pdf_save_callback));
}
@@ -390,9 +380,8 @@ void PrintViewManagerQt::DidStartLoading()
void PrintViewManagerQt::NavigationStopped()
{
if (!m_pdfPrintCallback.is_null()) {
- content::BrowserThread::PostTask(content::BrowserThread::UI,
- FROM_HERE,
- base::Bind(m_pdfPrintCallback, QSharedPointer<QByteArray>()));
+ base::PostTaskWithTraits(FROM_HERE, {content::BrowserThread::UI},
+ base::BindOnce(m_pdfPrintCallback, QSharedPointer<QByteArray>()));
}
resetPdfState();
PrintViewManagerBaseQt::NavigationStopped();
@@ -402,9 +391,8 @@ void PrintViewManagerQt::RenderProcessGone(base::TerminationStatus status)
{
PrintViewManagerBaseQt::RenderProcessGone(status);
if (!m_pdfPrintCallback.is_null()) {
- content::BrowserThread::PostTask(content::BrowserThread::UI,
- FROM_HERE,
- base::Bind(m_pdfPrintCallback, QSharedPointer<QByteArray>()));
+ base::PostTaskWithTraits(FROM_HERE, {content::BrowserThread::UI},
+ base::BindOnce(m_pdfPrintCallback, QSharedPointer<QByteArray>()));
}
resetPdfState();
}
diff --git a/src/core/profile_io_data_qt.cpp b/src/core/profile_io_data_qt.cpp
index ef9c67b78..20754ed7a 100644
--- a/src/core/profile_io_data_qt.cpp
+++ b/src/core/profile_io_data_qt.cpp
@@ -42,6 +42,7 @@
#include "base/task/post_task.h"
#include "components/certificate_transparency/ct_known_logs.h"
#include "components/network_session_configurator/common/network_features.h"
+#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/browsing_data_remover.h"
#include "content/public/browser/cookie_store_factory.h"
@@ -110,8 +111,6 @@ static bool doNetworkSessionParamsMatch(const net::HttpNetworkSession::Params &f
return false;
if (first.enable_channel_id != second.enable_channel_id)
return false;
- if (first.enable_token_binding != second.enable_token_binding)
- return false;
return true;
}
@@ -333,7 +332,7 @@ void ProfileIODataQt::generateStorage()
scoped_refptr<base::SequencedTaskRunner> background_task_runner(
base::CreateSequencedTaskRunnerWithTraits(
{base::MayBlock(),
- base::TaskPriority::BACKGROUND,
+ base::TaskPriority::BEST_EFFORT,
base::TaskShutdownBehavior::BLOCK_SHUTDOWN}));
m_transportSecurityPersister =
std::make_unique<net::TransportSecurityPersister>(
@@ -644,12 +643,12 @@ void ProfileIODataQt::updateStorageSettings()
m_proxyConfigService =
new ProxyConfigServiceQt(
net::ProxyResolutionService::CreateSystemProxyConfigService(
- content::BrowserThread::GetTaskRunnerForThread(content::BrowserThread::IO)));
+ base::CreateSingleThreadTaskRunnerWithTraits({content::BrowserThread::IO})));
//pass interface to io thread
m_proxyResolverFactoryInterface = ChromeMojoProxyResolverFactory::CreateWithStrongBinding().PassInterface();
if (m_initialized)
- content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE,
- base::Bind(&ProfileIODataQt::generateAllStorage, m_weakPtr));
+ base::PostTaskWithTraits(FROM_HERE, {content::BrowserThread::IO},
+ base::BindOnce(&ProfileIODataQt::generateAllStorage, m_weakPtr));
}
}
@@ -664,8 +663,8 @@ void ProfileIODataQt::updateCookieStore()
if (m_initialized && !m_updateAllStorage && !m_updateCookieStore) {
m_updateCookieStore = true;
m_updateHttpCache = true;
- content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE,
- base::Bind(&ProfileIODataQt::generateCookieStore, m_weakPtr));
+ base::PostTaskWithTraits(FROM_HERE, {content::BrowserThread::IO},
+ base::BindOnce(&ProfileIODataQt::generateCookieStore, m_weakPtr));
}
}
@@ -678,8 +677,8 @@ void ProfileIODataQt::updateUserAgent()
if (m_initialized && !m_updateAllStorage && !m_updateUserAgent) {
m_updateUserAgent = true;
- content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE,
- base::Bind(&ProfileIODataQt::generateUserAgent, m_weakPtr));
+ base::PostTaskWithTraits(FROM_HERE, {content::BrowserThread::IO},
+ base::BindOnce(&ProfileIODataQt::generateUserAgent, m_weakPtr));
}
}
@@ -702,8 +701,8 @@ void ProfileIODataQt::updateHttpCache()
if (m_initialized && !m_updateAllStorage && !m_updateHttpCache) {
m_updateHttpCache = true;
- content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE,
- base::Bind(&ProfileIODataQt::generateHttpCache, m_weakPtr));
+ base::PostTaskWithTraits(FROM_HERE, {content::BrowserThread::IO},
+ base::BindOnce(&ProfileIODataQt::generateHttpCache, m_weakPtr));
}
}
@@ -716,8 +715,8 @@ void ProfileIODataQt::updateJobFactory()
if (m_initialized && !m_updateJobFactory) {
m_updateJobFactory = true;
- content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE,
- base::Bind(&ProfileIODataQt::regenerateJobFactory, m_weakPtr));
+ base::PostTaskWithTraits(FROM_HERE, {content::BrowserThread::IO},
+ base::BindOnce(&ProfileIODataQt::regenerateJobFactory, m_weakPtr));
}
}
@@ -765,8 +764,8 @@ void ProfileIODataQt::updateUsedForGlobalCertificateVerification()
m_useForGlobalCertificateVerification = m_profileAdapter->isUsedForGlobalCertificateVerification();
if (m_useForGlobalCertificateVerification)
- content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE,
- base::Bind(&ProfileIODataQt::setGlobalCertificateVerification, m_weakPtr));
+ base::PostTaskWithTraits(FROM_HERE, {content::BrowserThread::IO},
+ base::BindOnce(&ProfileIODataQt::setGlobalCertificateVerification, m_weakPtr));
}
} // namespace QtWebEngineCore
diff --git a/src/core/qtwebengine.gni b/src/core/qtwebengine.gni
index e4b165c6d..3ae2b999c 100644
--- a/src/core/qtwebengine.gni
+++ b/src/core/qtwebengine.gni
@@ -34,6 +34,7 @@ deps = [
"//skia",
"//third_party/blink/public:blink",
"//ui/accessibility",
+ "//ui/gl",
"//qtwebengine/browser:interfaces",
":qtwebengine_sources",
":qtwebengine_resources"
@@ -47,6 +48,10 @@ if (is_linux && !is_desktop_linux) {
deps += [ "//ui/events/ozone:events_ozone_evdev"]
}
+if (use_xscrnsaver) {
+ deps += [ "//ui/base/x" ]
+}
+
if (use_ozone) {
deps += [
"//ui/ozone/common"
diff --git a/src/core/quota_permission_context_qt.cpp b/src/core/quota_permission_context_qt.cpp
index cb1467364..a502e7fc8 100644
--- a/src/core/quota_permission_context_qt.cpp
+++ b/src/core/quota_permission_context_qt.cpp
@@ -39,7 +39,9 @@
#include "quota_permission_context_qt.h"
+#include "base/task/post_task.h"
#include "content/browser/web_contents/web_contents_impl.h"
+#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_frame_host.h"
#include "quota_request_controller_impl.h"
@@ -64,10 +66,10 @@ void QuotaPermissionContextQt::RequestQuotaPermission(const StorageQuotaParams &
}
if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) {
- content::BrowserThread::PostTask(
- content::BrowserThread::UI, FROM_HERE,
- base::Bind(&QuotaPermissionContextQt::RequestQuotaPermission, this,
- params, render_process_id, callback));
+ base::PostTaskWithTraits(
+ FROM_HERE, {content::BrowserThread::UI},
+ base::BindOnce(&QuotaPermissionContextQt::RequestQuotaPermission, this,
+ params, render_process_id, callback));
return;
}
@@ -95,10 +97,10 @@ void QuotaPermissionContextQt::dispatchCallbackOnIOThread(const PermissionCallba
return;
if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)) {
- content::BrowserThread::PostTask(
- content::BrowserThread::IO, FROM_HERE,
- base::Bind(&QuotaPermissionContextQt::dispatchCallbackOnIOThread,
- this, callback, response));
+ base::PostTaskWithTraits(
+ FROM_HERE, {content::BrowserThread::IO},
+ base::BindOnce(&QuotaPermissionContextQt::dispatchCallbackOnIOThread,
+ this, callback, response));
return;
}
diff --git a/src/core/qwebengineclientcertificatestore.cpp b/src/core/qwebengineclientcertificatestore.cpp
index fb6cba78f..173d81fc3 100644
--- a/src/core/qwebengineclientcertificatestore.cpp
+++ b/src/core/qwebengineclientcertificatestore.cpp
@@ -43,7 +43,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "base/callback_forward.h"
#include "net/ssl/client_cert_store.h"
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
index 3c7a63bb6..66276ea6c 100644
--- a/src/core/render_widget_host_view_qt.cpp
+++ b/src/core/render_widget_host_view_qt.cpp
@@ -49,9 +49,9 @@
#include "web_event_factory.h"
#include "components/viz/common/surfaces/frame_sink_id_allocator.h"
-#include "content/browser/accessibility/browser_accessibility_state_impl.h"
-#include "content/browser/frame_host/render_frame_host_impl.h"
#include "content/browser/frame_host/frame_tree.h"
+#include "content/browser/frame_host/render_frame_host_impl.h"
+#include "content/browser/renderer_host/render_view_host_delegate.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/common/content_switches_internal.h"
#include "content/browser/renderer_host/render_widget_host_input_event_router.h"
@@ -64,7 +64,7 @@
#include "ui/events/gesture_detection/gesture_provider_config_helper.h"
#include "ui/events/gesture_detection/motion_event.h"
#include "ui/gfx/geometry/size_conversions.h"
-
+#include "ui/gfx/image/image_skia.h"
#if defined(USE_OZONE)
#include "ui/base/clipboard/scoped_clipboard_writer.h"
#endif
@@ -1149,7 +1149,7 @@ float RenderWidgetHostViewQt::dpiScale() const
bool RenderWidgetHostViewQt::IsPopup() const
{
- return popup_type_ != blink::kWebPopupTypeNone;
+ return widget_type_ == content::WidgetType::kPopup;
}
void RenderWidgetHostViewQt::handleMouseEvent(QMouseEvent* event)
diff --git a/src/core/render_widget_host_view_qt.h b/src/core/render_widget_host_view_qt.h
index caafba430..30a1550e9 100644
--- a/src/core/render_widget_host_view_qt.h
+++ b/src/core/render_widget_host_view_qt.h
@@ -50,7 +50,6 @@
#include "content/browser/renderer_host/input/mouse_wheel_phase_handler.h"
#include "content/browser/renderer_host/render_widget_host_view_base.h"
#include "content/browser/renderer_host/text_input_manager.h"
-#include "content/common/view_messages.h"
#include "gpu/ipc/common/gpu_messages.h"
#include "ui/events/gesture_detection/filtered_gesture_provider.h"
#include "qtwebenginecoreglobal_p.h"
diff --git a/src/core/renderer/content_renderer_client_qt.cpp b/src/core/renderer/content_renderer_client_qt.cpp
index 35fc47eb0..5aaf7ab7b 100644
--- a/src/core/renderer/content_renderer_client_qt.cpp
+++ b/src/core/renderer/content_renderer_client_qt.cpp
@@ -137,7 +137,8 @@ void ContentRendererClientQt::RenderThreadStarted()
// Allow XMLHttpRequests from qrc to file.
blink::WebURL qrc(blink::KURL("qrc:"));
blink::WebString file(blink::WebString::FromASCII("file"));
- blink::WebSecurityPolicy::AddOriginAccessAllowListEntry(qrc, file, blink::WebString(), true);
+ blink::WebSecurityPolicy::AddOriginAccessAllowListEntry(qrc, file, blink::WebString(), true,
+ network::mojom::CORSOriginAccessMatchPriority::kDefaultPriority);
}
void ContentRendererClientQt::RenderViewCreated(content::RenderView* render_view)
diff --git a/src/core/renderer/content_settings_observer_qt.cpp b/src/core/renderer/content_settings_observer_qt.cpp
index 045098457..c1495e1fe 100644
--- a/src/core/renderer/content_settings_observer_qt.cpp
+++ b/src/core/renderer/content_settings_observer_qt.cpp
@@ -93,8 +93,8 @@ bool ContentSettingsObserverQt::OnMessageReceived(const IPC::Message& message)
return handled;
}
-void ContentSettingsObserverQt::DidCommitProvisionalLoad(bool /*is_new_navigation*/,
- bool is_same_document_navigation)
+void ContentSettingsObserverQt::DidCommitProvisionalLoad(bool is_same_document_navigation,
+ ui::PageTransition /*transition*/)
{
blink::WebLocalFrame* frame = render_frame()->GetWebFrame();
if (frame->Parent())
diff --git a/src/core/renderer/content_settings_observer_qt.h b/src/core/renderer/content_settings_observer_qt.h
index 981655f20..a9bee3d2d 100644
--- a/src/core/renderer/content_settings_observer_qt.h
+++ b/src/core/renderer/content_settings_observer_qt.h
@@ -80,8 +80,8 @@ private:
// RenderFrameObserver implementation:
bool OnMessageReceived(const IPC::Message &message) override;
- void DidCommitProvisionalLoad(bool is_new_navigation,
- bool is_same_document_navigation) override;
+ void DidCommitProvisionalLoad(bool is_same_document_navigation,
+ ui::PageTransition transition) override;
void OnDestruct() override;
// Message handlers.
diff --git a/src/core/renderer/user_resource_controller.cpp b/src/core/renderer/user_resource_controller.cpp
index 920fda72e..46f5de2c2 100644
--- a/src/core/renderer/user_resource_controller.cpp
+++ b/src/core/renderer/user_resource_controller.cpp
@@ -103,7 +103,7 @@ static bool scriptMatchesURL(const UserScriptData &scriptData, const GURL &url)
matchFound = false;
for (auto it = scriptData.urlPatterns.begin(), end = scriptData.urlPatterns.end(); it != end; ++it) {
URLPattern urlPattern(validUserScriptSchemes());
- if (urlPattern.Parse(*it) == URLPattern::PARSE_SUCCESS && urlPattern.MatchesURL(url))
+ if (urlPattern.Parse(*it) == URLPattern::ParseResult::kSuccess && urlPattern.MatchesURL(url))
matchFound = true;
}
if (!matchFound)
@@ -137,7 +137,7 @@ public:
private:
// RenderFrameObserver implementation.
- void DidCommitProvisionalLoad(bool is_new_navigation, bool is_same_document_navigation) override;
+ void DidCommitProvisionalLoad(bool is_same_document_navigation, ui::PageTransition transition) override;
void DidClearWindowObject() override;
void DidFinishDocumentLoad() override;
void DidFinishLoad() override;
@@ -230,8 +230,8 @@ UserResourceController::RenderViewObserverHelper::RenderViewObserverHelper(conte
{
}
-void UserResourceController::RenderFrameObserverHelper::DidCommitProvisionalLoad(bool /* is_new_navigation */,
- bool is_same_document_navigation)
+void UserResourceController::RenderFrameObserverHelper::DidCommitProvisionalLoad(bool is_same_document_navigation,
+ ui::PageTransition /*transitionbool*/)
{
if (is_same_document_navigation)
return;
diff --git a/src/core/renderer/web_channel_ipc_transport.cpp b/src/core/renderer/web_channel_ipc_transport.cpp
index 1f496e810..f1da8289a 100644
--- a/src/core/renderer/web_channel_ipc_transport.cpp
+++ b/src/core/renderer/web_channel_ipc_transport.cpp
@@ -137,6 +137,8 @@ void WebChannelTransport::NativeQtSendMessage(gin::Arguments *args)
args->ThrowTypeError("Missing argument");
return;
}
+ v8::Isolate *isolate = blink::MainThreadIsolate();
+ v8::HandleScope handleScope(isolate);
if (!jsonValue->IsString()) {
args->ThrowTypeError("Expected string");
@@ -144,10 +146,10 @@ void WebChannelTransport::NativeQtSendMessage(gin::Arguments *args)
}
v8::Local<v8::String> jsonString = v8::Local<v8::String>::Cast(jsonValue);
- QByteArray json(jsonString->Utf8Length(), 0);
- jsonString->WriteUtf8(json.data(), json.size(),
- nullptr,
- v8::String::REPLACE_INVALID_UTF8);
+ QByteArray json(jsonString->Utf8Length(isolate), 0);
+ jsonString->WriteUtf8(isolate,
+ json.data(), json.size(),
+ nullptr, v8::String::REPLACE_INVALID_UTF8);
QJsonParseError error;
QJsonDocument doc = QJsonDocument::fromJson(json, &error);
diff --git a/src/core/renderer_host/pepper/pepper_isolated_file_system_message_filter.cpp b/src/core/renderer_host/pepper/pepper_isolated_file_system_message_filter.cpp
index 2c8b1246a..5d7c3973f 100644
--- a/src/core/renderer_host/pepper/pepper_isolated_file_system_message_filter.cpp
+++ b/src/core/renderer_host/pepper/pepper_isolated_file_system_message_filter.cpp
@@ -45,8 +45,10 @@
#include "pepper_isolated_file_system_message_filter.h"
#include "base/macros.h"
+#include "base/task/post_task.h"
#include "chrome/common/chrome_switches.h"
#include "content/public/browser/browser_ppapi_host.h"
+#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/render_view_host.h"
@@ -83,7 +85,7 @@ scoped_refptr<base::TaskRunner> PepperIsolatedFileSystemMessageFilter::OverrideT
{
// In order to reach ExtensionSystem, we need to get ProfileManager first.
// ProfileManager lives in UI thread, so we need to do this in UI thread.
- return content::BrowserThread::GetTaskRunnerForThread(content::BrowserThread::UI);
+ return base::CreateSingleThreadTaskRunnerWithTraits({content::BrowserThread::UI});
}
int32_t PepperIsolatedFileSystemMessageFilter::OnResourceMessageReceived(const IPC::Message& msg, ppapi::host::HostMessageContext *context)
diff --git a/src/core/resource_bundle_qt.cpp b/src/core/resource_bundle_qt.cpp
index 428faa34e..dc7507f34 100644
--- a/src/core/resource_bundle_qt.cpp
+++ b/src/core/resource_bundle_qt.cpp
@@ -71,6 +71,7 @@ gfx::Image& ResourceBundle::GetNativeImageNamed(int resource_id)
return GetEmptyImage();
}
+// static
bool ResourceBundle::LocaleDataPakExists(const std::string& locale)
{
#if defined(OS_LINUX)
diff --git a/src/core/service/service_qt.cpp b/src/core/service/service_qt.cpp
index 30ed269e8..bb842232c 100644
--- a/src/core/service/service_qt.cpp
+++ b/src/core/service/service_qt.cpp
@@ -45,7 +45,9 @@
#include "service_qt.h"
#include "base/no_destructor.h"
+#include "base/task/post_task.h"
#include "components/spellcheck/spellcheck_buildflags.h"
+#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/content_browser_client.h"
#include "services/service_manager/public/cpp/binder_registry.h"
@@ -82,10 +84,10 @@ private:
ServiceQt::IOThreadContext::IOThreadContext()
{
- scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner =
- content::BrowserThread::GetTaskRunnerForThread(content::BrowserThread::UI);
#if BUILDFLAG(ENABLE_SPELLCHECK)
- m_registry_with_source_info.AddInterface(base::Bind(&SpellCheckHostChromeImpl::Create), ui_task_runner);
+ scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner =
+ base::CreateSingleThreadTaskRunnerWithTraits({content::BrowserThread::UI});
+ m_registry_with_source_info.AddInterface(base::BindRepeating(&SpellCheckHostChromeImpl::Create), ui_task_runner);
#endif
}
@@ -97,7 +99,7 @@ void ServiceQt::IOThreadContext::BindConnector(service_manager::mojom::Connector
// on the IO thread. Post a task instead. As long as this task is posted
// before any code attempts to connect to the chrome service, there's no
// race.
- content::BrowserThread::GetTaskRunnerForThread(content::BrowserThread::IO)->PostTask(
+ base::CreateSingleThreadTaskRunnerWithTraits({content::BrowserThread::IO})->PostTask(
FROM_HERE,
base::BindOnce(&IOThreadContext::BindConnectorOnIOThread,
base::Unretained(this),
diff --git a/src/core/type_conversion.cpp b/src/core/type_conversion.cpp
index 16960f8a0..ef16e2add 100644
--- a/src/core/type_conversion.cpp
+++ b/src/core/type_conversion.cpp
@@ -133,7 +133,7 @@ QImage toQImage(const SkBitmap &bitmap)
QImage toQImage(const gfx::ImageSkiaRep &imageSkiaRep)
{
- QImage image = toQImage(imageSkiaRep.sk_bitmap());
+ QImage image = toQImage(imageSkiaRep.GetBitmap());
if (!image.isNull() && imageSkiaRep.scale() != 1.0f)
image.setDevicePixelRatio(imageSkiaRep.scale());
return image;
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index 3cf9c0be9..68bbc3daa 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -62,9 +62,11 @@
#include "base/command_line.h"
#include "base/run_loop.h"
+#include "base/task/post_task.h"
#include "base/values.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/web_contents/web_contents_impl.h"
+#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/download_manager.h"
@@ -82,7 +84,6 @@
#include "content/public/common/url_constants.h"
#include "content/public/common/web_preferences.h"
#include "content/public/common/webrtc_ip_handling_policy.h"
-#include "third_party/blink/public/web/web_find_options.h"
#include "third_party/blink/public/web/web_media_player_action.h"
#include "printing/buildflags/buildflags.h"
#include "ui/base/clipboard/clipboard.h"
@@ -665,8 +666,8 @@ void WebContentsAdapter::load(const QWebEngineHttpRequest &request)
if (resizeNeeded) {
// Schedule navigation on the event loop.
- content::BrowserThread::PostTask(
- content::BrowserThread::UI, FROM_HERE, base::BindOnce(navigate, this, std::move(params)));
+ base::PostTaskWithTraits(FROM_HERE, {content::BrowserThread::UI},
+ base::BindOnce(navigate, this, std::move(params)));
} else {
navigate(this, params);
}
@@ -803,7 +804,7 @@ void WebContentsAdapter::selectAll()
void WebContentsAdapter::requestClose()
{
CHECK_INITIALIZED();
- m_webContents->DispatchBeforeUnload();
+ m_webContents->DispatchBeforeUnload(false /* auto_cancel */);
}
void WebContentsAdapter::unselect()
@@ -993,16 +994,16 @@ quint64 WebContentsAdapter::findText(const QString &subString, bool caseSensitiv
m_adapterClient->didFindText(m_lastFindRequestId, 0);
}
- blink::WebFindOptions options;
- options.forward = !findBackward;
- options.match_case = caseSensitively;
- options.find_next = subString == m_webContentsDelegate->lastSearchedString();
+ blink::mojom::FindOptionsPtr options = blink::mojom::FindOptions::New();
+ options->forward = !findBackward;
+ options->match_case = caseSensitively;
+ options->find_next = subString == m_webContentsDelegate->lastSearchedString();
m_webContentsDelegate->setLastSearchedString(subString);
// Find already allows a request ID as input, but only as an int.
// Use the same counter but mod it to MAX_INT, this keeps the same likeliness of request ID clashing.
int shrunkRequestId = m_nextRequestId++ & 0x7fffffff;
- m_webContents->Find(shrunkRequestId, toString16(subString), options);
+ m_webContents->Find(shrunkRequestId, toString16(subString), std::move(options));
m_lastFindRequestId = shrunkRequestId;
return shrunkRequestId;
}
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index 4bde93fd3..963b89a3f 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -65,6 +65,7 @@
#include "components/web_cache/browser/web_cache_manager.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/public/browser/browser_context.h"
+#include "content/public/browser/file_select_listener.h"
#include "content/public/browser/invalidate_type.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/navigation_handle.h"
@@ -73,7 +74,6 @@
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/favicon_url.h"
-#include "content/public/common/file_chooser_params.h"
#include "content/public/common/frame_navigate_params.h"
#include "content/public/common/url_constants.h"
#include "content/public/common/web_preferences.h"
@@ -451,12 +451,14 @@ bool WebContentsDelegateQt::IsFullscreenForTabOrPending(const content::WebConten
return m_viewClient->isFullScreenMode();
}
-ASSERT_ENUMS_MATCH(FilePickerController::Open, content::FileChooserParams::Open)
-ASSERT_ENUMS_MATCH(FilePickerController::OpenMultiple, content::FileChooserParams::OpenMultiple)
-ASSERT_ENUMS_MATCH(FilePickerController::UploadFolder, content::FileChooserParams::UploadFolder)
-ASSERT_ENUMS_MATCH(FilePickerController::Save, content::FileChooserParams::Save)
+ASSERT_ENUMS_MATCH(FilePickerController::Open, blink::mojom::FileChooserParams::Mode::kOpen)
+ASSERT_ENUMS_MATCH(FilePickerController::OpenMultiple, blink::mojom::FileChooserParams::Mode::kOpenMultiple)
+ASSERT_ENUMS_MATCH(FilePickerController::UploadFolder, blink::mojom::FileChooserParams::Mode::kUploadFolder)
+ASSERT_ENUMS_MATCH(FilePickerController::Save, blink::mojom::FileChooserParams::Mode::kSave)
-void WebContentsDelegateQt::RunFileChooser(content::RenderFrameHost *frameHost, const content::FileChooserParams &params)
+void WebContentsDelegateQt::RunFileChooser(content::RenderFrameHost * /*frameHost*/,
+ std::unique_ptr<content::FileSelectListener> listener,
+ const blink::mojom::FileChooserParams& params)
{
QStringList acceptedMimeTypes;
acceptedMimeTypes.reserve(params.accept_types.size());
@@ -464,7 +466,7 @@ void WebContentsDelegateQt::RunFileChooser(content::RenderFrameHost *frameHost,
acceptedMimeTypes.append(toQt(*it));
m_filePickerController.reset(new FilePickerController(static_cast<FilePickerController::FileChooserMode>(params.mode),
- frameHost, toQt(params.default_file_name.value()), acceptedMimeTypes));
+ std::move(listener), toQt(params.default_file_name.value()), acceptedMimeTypes));
// Defer the call to not block base::MessageLoop::RunTask with modal dialogs.
QTimer::singleShot(0, [this] () {
@@ -633,7 +635,9 @@ void WebContentsDelegateQt::BeforeUnloadFired(content::WebContents *tab, bool pr
m_viewClient->windowCloseRejected();
}
-void WebContentsDelegateQt::BeforeUnloadFired(const base::TimeTicks &proceed_time) {
+void WebContentsDelegateQt::BeforeUnloadFired(bool proceed, const base::TimeTicks &proceed_time)
+{
+ Q_UNUSED(proceed);
Q_UNUSED(proceed_time);
}
diff --git a/src/core/web_contents_delegate_qt.h b/src/core/web_contents_delegate_qt.h
index 9c0f8f484..40f585767 100644
--- a/src/core/web_contents_delegate_qt.h
+++ b/src/core/web_contents_delegate_qt.h
@@ -114,7 +114,9 @@ public:
void EnterFullscreenModeForTab(content::WebContents *web_contents, const GURL &origin, const blink::WebFullscreenOptions &) override;
void ExitFullscreenModeForTab(content::WebContents*) override;
bool IsFullscreenForTabOrPending(const content::WebContents* web_contents) const override;
- void RunFileChooser(content::RenderFrameHost* render_frame_host, const content::FileChooserParams& params) override;
+ void RunFileChooser(content::RenderFrameHost* render_frame_host,
+ std::unique_ptr<content::FileSelectListener> listener,
+ const blink::mojom::FileChooserParams& params) override;
bool DidAddMessageToConsole(content::WebContents* source, int32_t level, const base::string16& message, int32_t line_no, const base::string16& source_id) override;
void FindReply(content::WebContents *source, int request_id, int number_of_matches, const gfx::Rect& selection_rect, int active_match_ordinal, bool final_update) override;
void RequestMediaAccessPermission(content::WebContents *web_contents,
@@ -135,7 +137,7 @@ public:
void DidFinishNavigation(content::NavigationHandle *navigation_handle) override;
void DidFailLoad(content::RenderFrameHost* render_frame_host, const GURL& validated_url, int error_code, const base::string16& error_description) override;
void DidFinishLoad(content::RenderFrameHost *render_frame_host, const GURL &validated_url) override;
- void BeforeUnloadFired(const base::TimeTicks& proceed_time) override;
+ void BeforeUnloadFired(bool proceed, const base::TimeTicks& proceed_time) override;
void DidUpdateFaviconURL(const std::vector<content::FaviconURL> &candidates) override;
void OnVisibilityChanged(content::Visibility visibility) override;
void DidFirstVisuallyNonEmptyPaint() override;
diff --git a/src/core/web_contents_view_qt.cpp b/src/core/web_contents_view_qt.cpp
index 3c4465ae3..f44668019 100644
--- a/src/core/web_contents_view_qt.cpp
+++ b/src/core/web_contents_view_qt.cpp
@@ -41,18 +41,21 @@
#include "profile_adapter.h"
#include "content_browser_client_qt.h"
+#include "render_widget_host_view_qt.h"
#include "render_widget_host_view_qt_delegate.h"
#include "render_widget_host_view_qt.h"
#include "type_conversion.h"
+#include "web_contents_adapter_client.h"
#include "web_contents_adapter.h"
#include "web_engine_context.h"
+#include "web_contents_delegate_qt.h"
#include "components/spellcheck/spellcheck_buildflags.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/public/common/context_menu_params.h"
-#include <ui/gfx/image/image_skia.h>
+#include "ui/gfx/image/image_skia.h"
#include <QtGui/qpixmap.h>
@@ -82,7 +85,7 @@ content::RenderWidgetHostViewBase* WebContentsViewQt::CreateViewForWidget(conten
return view;
}
-content::RenderWidgetHostViewBase* WebContentsViewQt::CreateViewForPopupWidget(content::RenderWidgetHost* render_widget_host)
+content::RenderWidgetHostViewBase* WebContentsViewQt::CreateViewForChildWidget(content::RenderWidgetHost* render_widget_host)
{
RenderWidgetHostViewQt *view = new RenderWidgetHostViewQt(render_widget_host);
diff --git a/src/core/web_contents_view_qt.h b/src/core/web_contents_view_qt.h
index d1a2ff81e..c7bac1d97 100644
--- a/src/core/web_contents_view_qt.h
+++ b/src/core/web_contents_view_qt.h
@@ -63,7 +63,6 @@ public:
: m_webContents(webContents)
, m_client(nullptr)
, m_factoryClient(nullptr)
- , m_allowOtherViews(false)
{ }
void initialize(WebContentsAdapterClient* client);
@@ -73,7 +72,7 @@ public:
void CreateView(const gfx::Size& initial_size, gfx::NativeView context) override;
- content::RenderWidgetHostViewBase* CreateViewForPopupWidget(content::RenderWidgetHost* render_widget_host) override;
+ content::RenderWidgetHostViewBase *CreateViewForChildWidget(content::RenderWidgetHost* render_widget_host) override;
void SetPageTitle(const base::string16& title) override { }
@@ -83,29 +82,29 @@ public:
void RenderViewHostChanged(content::RenderViewHost*, content::RenderViewHost*) override { }
- void SetOverscrollControllerEnabled(bool enabled) override { QT_NOT_YET_IMPLEMENTED }
+ void SetOverscrollControllerEnabled(bool enabled) override { }
gfx::NativeView GetNativeView() const override;
- gfx::NativeView GetContentNativeView() const override { QT_NOT_USED return 0; }
+ gfx::NativeView GetContentNativeView() const override { return 0; }
- gfx::NativeWindow GetTopLevelNativeWindow() const override { QT_NOT_USED return 0; }
+ gfx::NativeWindow GetTopLevelNativeWindow() const override { return 0; }
void GetContainerBounds(gfx::Rect* out) const override;
- void SizeContents(const gfx::Size& size) override { QT_NOT_YET_IMPLEMENTED }
+ void SizeContents(const gfx::Size& size) override { }
void Focus() override;
void SetInitialFocus() override;
- void StoreFocus() override { QT_NOT_USED }
+ void StoreFocus() override { }
- void RestoreFocus() override { QT_NOT_USED }
+ void RestoreFocus() override { }
content::DropData* GetDropData() const override { QT_NOT_YET_IMPLEMENTED return nullptr; }
- gfx::Rect GetViewBounds() const override { QT_NOT_YET_IMPLEMENTED return gfx::Rect(); }
+ gfx::Rect GetViewBounds() const override { return gfx::Rect(); }
void StartDragging(const content::DropData& drop_data, blink::WebDragOperationsMask allowed_ops,
const gfx::ImageSkia& image, const gfx::Vector2d& image_offset,
@@ -122,8 +121,6 @@ public:
#if defined(OS_MACOSX)
- void SetAllowOtherViews(bool allow) override { m_allowOtherViews = allow; }
- bool GetAllowOtherViews() const override { return m_allowOtherViews; }
void CloseTabAfterEventTracking() override { QT_NOT_YET_IMPLEMENTED }
bool IsEventTracking() const override { QT_NOT_YET_IMPLEMENTED; return false; }
#endif // defined(OS_MACOSX)
@@ -132,7 +129,6 @@ private:
content::WebContents *m_webContents;
WebContentsAdapterClient *m_client;
WebContentsAdapterClient *m_factoryClient;
- bool m_allowOtherViews;
};
} // namespace QtWebEngineCore
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 056f4bcda..a357196b0 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -54,12 +54,14 @@
#endif
#include "components/viz/common/features.h"
#include "components/web_cache/browser/web_cache_manager.h"
-#include "content/browser/browser_thread_impl.h"
#include "content/browser/devtools/devtools_http_handler.h"
+#include "content/browser/scheduler/browser_task_executor.h"
+#include "content/browser/startup_helper.h"
#include "content/public/app/content_main.h"
#include "content/public/app/content_main_runner.h"
#include "content/public/browser/browser_main_runner.h"
#include "content/public/browser/browser_task_traits.h"
+#include "content/public/browser/browser_thread.h"
#include "content/public/browser/plugin_service.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
@@ -101,6 +103,7 @@
#include <QFileInfo>
#include <QGuiApplication>
+#include <QMutex>
#include <QOffscreenSurface>
#ifndef QT_NO_OPENGL
# include <QOpenGLContext>
@@ -167,6 +170,8 @@ void dummyGetPluginCallback(const std::vector<content::WebPluginInfo>&)
namespace QtWebEngineCore {
+extern std::unique_ptr<base::MessagePump> messagePumpFactory();
+
bool usingSoftwareDynamicGL()
{
if (QCoreApplication::testAttribute(Qt::AA_UseSoftwareOpenGL))
@@ -280,6 +285,7 @@ WebEngineContext::~WebEngineContext()
Q_ASSERT(!m_devtoolsServer);
Q_ASSERT(!m_browserRunner);
Q_ASSERT(m_profileAdapters.isEmpty());
+ delete s_syncPointManager.fetchAndStoreRelaxed(nullptr);
}
WebEngineContext *WebEngineContext::current()
@@ -292,8 +298,6 @@ WebEngineContext *WebEngineContext::current()
qAddPostRoutine(WebEngineContext::destroyContextPostRoutine);
// Add a false reference so there is no race between unreferencing m_handle and a global QApplication.
m_handle->AddRef();
- // This is need since gpu process start requires sync point manager;
- m_handle->initialize();
}
return m_handle.get();
}
@@ -321,7 +325,7 @@ void WebEngineContext::destroyContextPostRoutine()
// Destroy WebEngineContext before its static pointer is zeroed and destructor called.
// Before destroying MessageLoop via destroying BrowserMainRunner destructor
// WebEngineContext's pointer is used.
- m_handle->destroy();
+ m_handle->destroy();
#if !defined(NDEBUG)
if (!m_handle->HasOneRef())
qWarning("WebEngineContext leaked on exit, likely due to leaked WebEngine View or Page");
@@ -352,13 +356,8 @@ static void appendToFeatureSwitch(base::CommandLine *commandLine, const char *fe
WebEngineContext::WebEngineContext()
: m_mainDelegate(new ContentMainDelegateQt)
, m_globalQObject(new QObject())
- , m_syncPointManager(new gpu::SyncPointManager())
-{}
-
-void WebEngineContext::initialize()
{
base::TaskScheduler::Create("Browser");
- content::BrowserThreadImpl::CreateTaskExecutor();
m_contentRunner.reset(content::ContentMainRunner::Create());
m_browserRunner.reset(content::BrowserMainRunner::Create());
#ifdef Q_OS_LINUX
@@ -470,6 +469,8 @@ void WebEngineContext::initialize()
// The video-capture service is not functioning at this moment (since 69)
appendToFeatureSwitch(parsedCommandLine, switches::kDisableFeatures, features::kMojoVideoCapture.name);
+ appendToFeatureSwitch(parsedCommandLine, switches::kDisableFeatures, features::kBackgroundFetch.name);
+
if (useEmbeddedSwitches) {
// embedded switches are based on the switches for Android, see content/browser/android/content_startup_flags.cc
appendToFeatureSwitch(parsedCommandLine, switches::kEnableFeatures, features::kOverlayScrollbar.name);
@@ -577,6 +578,11 @@ void WebEngineContext::initialize()
#endif
registerMainThreadFactories(threadedGpu);
+ SetContentClient(new ContentClientQt);
+
+ content::StartBrowserTaskScheduler();
+ content::BrowserTaskExecutor::Create();
+
mojo::core::Init();
content::ContentMainParams contentMainParams(m_mainDelegate.get());
@@ -641,9 +647,17 @@ printing::PrintJobManager* WebEngineContext::getPrintJobManager()
}
#endif
+static QMutex s_spmMutex;
+QAtomicPointer<gpu::SyncPointManager> WebEngineContext::s_syncPointManager;
+
gpu::SyncPointManager *WebEngineContext::syncPointManager()
{
- return m_syncPointManager.get();
+ if (gpu::SyncPointManager *spm = s_syncPointManager.loadAcquire())
+ return spm;
+ QMutexLocker lock(&s_spmMutex);
+ if (!s_syncPointManager)
+ s_syncPointManager.store(new gpu::SyncPointManager());
+ return s_syncPointManager.load();
}
} // namespace
diff --git a/src/core/web_engine_context.h b/src/core/web_engine_context.h
index b9af38153..ad02ddf4d 100644
--- a/src/core/web_engine_context.h
+++ b/src/core/web_engine_context.h
@@ -91,13 +91,12 @@ public:
#if QT_CONFIG(webengine_printing_and_pdf)
printing::PrintJobManager* getPrintJobManager();
#endif
- void initialize();
void destroyProfileAdapter();
void addProfileAdapter(ProfileAdapter *profileAdapter);
void removeProfileAdapter(ProfileAdapter *profileAdapter);
void destroy();
- gpu::SyncPointManager *syncPointManager();
+ static gpu::SyncPointManager *syncPointManager();
private:
friend class base::RefCounted<WebEngineContext>;
@@ -115,7 +114,6 @@ private:
std::unique_ptr<QObject> m_globalQObject;
std::unique_ptr<ProfileAdapter> m_defaultProfileAdapter;
std::unique_ptr<DevToolsServerQt> m_devtoolsServer;
- std::unique_ptr<gpu::SyncPointManager> m_syncPointManager;
QVector<ProfileAdapter*> m_profileAdapters;
#ifndef QT_NO_ACCESSIBILITY
std::unique_ptr<AccessibilityActivationObserver> m_accessibilityActivationObserver;
@@ -126,6 +124,7 @@ private:
#endif
static scoped_refptr<QtWebEngineCore::WebEngineContext> m_handle;
static bool m_destroyed;
+ static QAtomicPointer<gpu::SyncPointManager> s_syncPointManager;
};
} // namespace
diff --git a/src/core/web_engine_context_threads.cpp b/src/core/web_engine_context_threads.cpp
index 3e5d47b92..07a86cc69 100644
--- a/src/core/web_engine_context_threads.cpp
+++ b/src/core/web_engine_context_threads.cpp
@@ -40,6 +40,7 @@
#include "web_engine_context.h"
#include "base/bind.h"
+#include "base/task/post_task.h"
#include "base/threading/platform_thread.h"
#include "base/threading/thread_restrictions.h"
#include "content/browser/gpu/gpu_main_thread_factory.h"
@@ -48,6 +49,8 @@
#include "content/gpu/gpu_child_thread.h"
#include "content/gpu/gpu_process.h"
#include "content/gpu/in_process_gpu_thread.h"
+#include "content/public/browser/browser_task_traits.h"
+#include "content/public/browser/browser_thread.h"
#include "content/renderer/in_process_renderer_thread.h"
#include "content/utility/in_process_utility_thread.h"
@@ -59,14 +62,14 @@ struct GpuThreadControllerQt : content::GpuThreadController
{
GpuThreadControllerQt(const content::InProcessChildThreadParams &params, const gpu::GpuPreferences &gpuPreferences)
{
- content::BrowserThread::PostTask(
- content::BrowserThread::UI, FROM_HERE,
+ base::PostTaskWithTraits(
+ FROM_HERE, { content::BrowserThread::UI },
base::BindOnce(&GpuThreadControllerQt::createGpuProcess, params, gpuPreferences));
}
~GpuThreadControllerQt() override
{
- content::BrowserThread::PostTask(
- content::BrowserThread::UI, FROM_HERE,
+ base::PostTaskWithTraits(
+ FROM_HERE, { content::BrowserThread::UI },
base::BindOnce(&GpuThreadControllerQt::destroyGpuProcess));
}
diff --git a/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp b/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp
index cdd5cfe28..7b7fec6f4 100644
--- a/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp
+++ b/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp
@@ -125,10 +125,7 @@ public:
// Skip import documents and sandboxed documents.
// See Document::SiteForCookies() in chromium/third_party/blink/renderer/core/dom/document.cc.
- //
- // TODO: Change this to empty URL during the next chromium update:
- // https://chromium-review.googlesource.com/c/chromium/src/+/1213082/
- return requestInfo.firstPartyUrl == QUrl("data:,");
+ return requestInfo.firstPartyUrl == QUrl("");
}
QList<RequestInfo> getUrlRequestForType(QWebEngineUrlRequestInfo::ResourceType type)
diff --git a/tests/auto/quick/qmltests/data/tst_findText.qml b/tests/auto/quick/qmltests/data/tst_findText.qml
index dfcfd586f..1ec574fae 100644
--- a/tests/auto/quick/qmltests/data/tst_findText.qml
+++ b/tests/auto/quick/qmltests/data/tst_findText.qml
@@ -116,7 +116,7 @@ TestWebEngineView {
webEngineView.clear()
webEngineView.findText("bla", findFlags, webEngineView.findTextCallback)
- tryCompare(webEngineView, "matchCount", 100)
+ tryCompare(webEngineView, "matchCount", 100, 20000)
verify(!findFailed)
}
@@ -172,7 +172,7 @@ TestWebEngineView {
webEngineView.clear()
webEngineView.findText("hello", findFlags, webEngineView.findTextCallback)
- tryCompare(webEngineView, "matchCount", 0)
+ tryCompare(webEngineView, "matchCount", 0, 20000)
verify(findFailed)
runJavaScript("document.body.innerHTML = 'blahellobla'");
diff --git a/tests/auto/quick/qquickwebengineview/BLACKLIST b/tests/auto/quick/qquickwebengineview/BLACKLIST
index 76cb18c1e..5bb38576a 100644
--- a/tests/auto/quick/qquickwebengineview/BLACKLIST
+++ b/tests/auto/quick/qquickwebengineview/BLACKLIST
@@ -9,8 +9,13 @@ windows
[basicRenderingSanity]
*
+
[javascriptClipboard:default]
opensuse-leap
+
[javascriptClipboard:canPaste]
opensuse-leap
+[changeLocale]
+*
+
diff --git a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp
index ca45d42a0..d467cd8ae 100644
--- a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp
+++ b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp
@@ -1003,7 +1003,7 @@ void tst_QQuickWebEngineView::changeLocale()
QTRY_VERIFY(!evaluateJavaScriptSync(viewDE.data(), "document.body.innerText").isNull());
errorLines = evaluateJavaScriptSync(viewDE.data(), "document.body.innerText").toString().split(QRegularExpression("[\r\n]"), QString::SkipEmptyParts);
- QCOMPARE(errorLines.first().toUtf8(), QByteArrayLiteral("Die Website ist nicht erreichbar"));
+ QCOMPARE(errorLines.first().toUtf8(), QByteArrayLiteral("Die Website ist nicht erreichbar Die Server-IP-Adresse von non.existent wurde nicht gefunden."));
QLocale::setDefault(QLocale("en"));
QScopedPointer<QQuickWebEngineView> viewEN(newWebEngineView());
diff --git a/tests/auto/widgets/origins/tst_origins.cpp b/tests/auto/widgets/origins/tst_origins.cpp
index 4e415af90..61c7232b0 100644
--- a/tests/auto/widgets/origins/tst_origins.cpp
+++ b/tests/auto/widgets/origins/tst_origins.cpp
@@ -301,7 +301,7 @@ void tst_Origins::jsUrlOrigin()
QCOMPARE(eval(QSL("new URL(\"qrc:/crysis.css\").origin")), QVariant(QSL("qrc://")));
QCOMPARE(eval(QSL("new URL(\"qrc://foo.com/crysis.css\").origin")), QVariant(QSL("qrc://")));
- // Same with unregistered schemes.
+ // Unregistered schemes behaves like opaque origins.
QCOMPARE(eval(QSL("new URL(\"tst:/banana\").origin")), QVariant(QSL("tst://")));
QCOMPARE(eval(QSL("new URL(\"tst://foo.com/banana\").origin")), QVariant(QSL("tst://")));
@@ -564,8 +564,6 @@ private:
// Try opening a WebSocket from pages loaded over various URL schemes.
void tst_Origins::webSocket()
{
- const int kAbnormalClosure = 1006;
-
EchoServer echoServer;
QWebChannel channel;
channel.registerObject(QSL("echoServer"), &echoServer);
@@ -578,9 +576,9 @@ void tst_Origins::webSocket()
QVERIFY(load(QSL("qrc:/resources/websocket.html")));
QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("ok")));
- // Only registered schemes can open WebSockets.
+ // Unregistered schemes can also open WebSockets (since Chromium 71)
QVERIFY(load(QSL("tst:/resources/websocket.html")));
- QTRY_COMPARE(eval(QSL("result")), QVariant(kAbnormalClosure));
+ QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("ok")));
// Even an insecure registered scheme can open WebSockets.
QVERIFY(load(QSL("PathSyntax:/resources/websocket.html")));
@@ -599,11 +597,10 @@ void tst_Origins::dedicatedWorker()
QTRY_VERIFY(eval(QSL("done")).toBool());
QCOMPARE(eval(QSL("result")), QVariant(42));
- // Unregistered schemes cannot create Workers.
+ // Unregistered schemes can also create Workers (since Chromium 71)
QVERIFY(load(QSL("tst:/resources/dedicatedWorker.html")));
QTRY_VERIFY(eval(QSL("done")).toBool());
- QVERIFY(eval(QSL("error")).toString()
- .contains(QSL("Access to dedicated workers is denied to origin 'tst://'")));
+ QCOMPARE(eval(QSL("result")), QVariant(42));
// Even an insecure registered scheme can create Workers.
QVERIFY(load(QSL("PathSyntax:/resources/dedicatedWorker.html")));
@@ -727,15 +724,9 @@ void tst_Origins::createObjectURL()
QVERIFY(load(QSL("qrc:/resources/createObjectURL.html")));
QVERIFY(eval(QSL("result")).toString().startsWith(QSL("blob:qrc:")));
- // Illegal for unregistered schemes (renderer gets terminated).
- qRegisterMetaType<QWebEnginePage::RenderProcessTerminationStatus>("RenderProcessTerminationStatus");
- QSignalSpy loadFinishedSpy(m_page, &QWebEnginePage::loadFinished);
- QSignalSpy renderProcessTerminatedSpy(m_page, &QWebEnginePage::renderProcessTerminated);
- m_page->load(QSL("tst:/resources/createObjectURL.html"));
- QVERIFY(!renderProcessTerminatedSpy.empty() || renderProcessTerminatedSpy.wait(20000));
- QVERIFY(renderProcessTerminatedSpy.front().value(0).value<QWebEnginePage::RenderProcessTerminationStatus>()
- != QWebEnginePage::NormalTerminationStatus);
- QVERIFY(loadFinishedSpy.empty());
+ // Also legal for unregistered schemes (since Chromium 71)
+ QVERIFY(load(QSL("tst:/resources/createObjectURL.html")));
+ QVERIFY(eval(QSL("result")).toString().startsWith(QSL("blob:tst:")));
}
QTEST_MAIN(tst_Origins)
diff --git a/tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp b/tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp
index 2af818928..5227f2d0a 100644
--- a/tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp
+++ b/tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp
@@ -611,6 +611,7 @@ void tst_QWebEngineDownloadItem::downloadPage_data()
void tst_QWebEngineDownloadItem::downloadPage()
{
+ QSKIP("Unstable since Chromium 71");
QFETCH(QWebEngineDownloadItem::SavePageFormat, savePageFormat);
// Set up HTTP server
diff --git a/tests/auto/widgets/qwebengineview/BLACKLIST b/tests/auto/widgets/qwebengineview/BLACKLIST
index 7c86a72d6..e8758abcc 100644
--- a/tests/auto/widgets/qwebengineview/BLACKLIST
+++ b/tests/auto/widgets/qwebengineview/BLACKLIST
@@ -6,3 +6,6 @@ osx
[textSelectionOutOfInputField]
*
+
+[changeLocale]
+*
diff --git a/tests/auto/widgets/qwebengineview/resources/image2.png b/tests/auto/widgets/qwebengineview/resources/image2.png
new file mode 100644
index 000000000..8d703640c
--- /dev/null
+++ b/tests/auto/widgets/qwebengineview/resources/image2.png
Binary files differ
diff --git a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
index d9afb56db..f2810101b 100644
--- a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
+++ b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
@@ -268,7 +268,7 @@ void tst_QWebEngineView::getWebKitVersion()
void tst_QWebEngineView::changePage_data()
{
QString html = "<html><head><title>%1</title>"
- "<link rel='icon' href='file://" TESTS_SOURCE_DIR "/resources/image2.png'></head></html>";
+ "<link rel='icon' href='qrc:///resources/image2.png'></head></html>";
QUrl urlFrom("data:text/html," + html.arg("TitleFrom"));
QUrl urlTo("data:text/html," + html.arg("TitleTo"));
QUrl nullPage("data:text/html,<html/>");
diff --git a/tests/auto/widgets/qwebengineview/tst_qwebengineview.qrc b/tests/auto/widgets/qwebengineview/tst_qwebengineview.qrc
index 53b11bca8..a09be0399 100644
--- a/tests/auto/widgets/qwebengineview/tst_qwebengineview.qrc
+++ b/tests/auto/widgets/qwebengineview/tst_qwebengineview.qrc
@@ -5,5 +5,6 @@
<file>resources/input_types.html</file>
<file>resources/scrolltest_page.html</file>
<file>resources/keyboardEvents.html</file>
+ <file>resources/image2.png</file>
</qresource>
</RCC>
diff --git a/tools/scripts/take_snapshot.py b/tools/scripts/take_snapshot.py
index 38915f2e5..4f71185e5 100755
--- a/tools/scripts/take_snapshot.py
+++ b/tools/scripts/take_snapshot.py
@@ -43,7 +43,7 @@ qtwebengine_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..',
os.chdir(qtwebengine_root)
def isInGitBlacklist(file_path):
- # We do need all the gyp files.
+ # We need all the git files.
if ( '.gitignore' in file_path
or '.gitmodules' in file_path
or '.gitattributes' in file_path
@@ -54,34 +54,14 @@ def isInChromiumBlacklist(file_path):
# Filter out empty submodule directories.
if (os.path.isdir(file_path)):
return True
- # We do need all the gyp files.
- if file_path.endswith('.gyp') or file_path.endswith('.gypi') or file_path.endswith('.isolate'):
- return False
- # We do need all the gn file.
+ # We do need all the gn files.
if file_path.endswith('.gn') or file_path.endswith('.gni') or file_path.endswith('.typemap') or \
file_path.endswith('.mojom'):
return False
- if ( '_jni' in file_path
- or 'jni_' in file_path
- or 'testdata/' in file_path
- or '/tests/' in file_path
- or ('/test/' in file_path and
- not '/webrtc/' in file_path and
- not file_path.startswith('net/test/') and
- not file_path.endswith('mock_chrome_application_mac.h') and
- not file_path.endswith('perftimer.h') and
- not file_path.endswith('test-torque.tq') and
- not 'ozone' in file_path and
- not 'clang_coverage' in file_path and
- not 'fontconfig_util_linux' in file_path and
- not 'core/mojo/test/' in file_path and
- not file_path.startswith('extensions/browser/'))
- or file_path.endswith('.java')
- or file_path.startswith('android_webview')
+ if (file_path.startswith('android_webview')
or file_path.startswith('apps/')
or file_path.startswith('ash/')
or file_path.startswith('base/android')
- or file_path.startswith('breakpad')
or file_path.startswith('buildtools/clang_format/script')
or file_path.startswith('buildtools/third_party/libc++')
or file_path.startswith('buildtools/third_party/libc++abi')
@@ -124,25 +104,27 @@ def isInChromiumBlacklist(file_path):
not file_path.endswith('.grdp') and
not file_path.endswith('.json') and
not file_path.endswith('chrome_version.rc.version'))
- or file_path.startswith('chrome_frame')
+ or file_path.startswith('chrome_elf')
or file_path.startswith('chromecast')
or file_path.startswith('chromeos')
or file_path.startswith('cloud_print')
- or file_path.startswith('components/chrome_apps/')
- or file_path.startswith('components/cronet/')
- or file_path.startswith('components/drive/')
- or file_path.startswith('components/invalidation/')
- or file_path.startswith('components/gcm_driver/')
- or file_path.startswith('components/nacl/')
- or file_path.startswith('components/omnibox/')
- or file_path.startswith('components/policy/')
- or file_path.startswith('components/proximity_auth/')
- or (file_path.startswith('components/resources/terms/') and not file_path.endswith('terms_chromium.html'))
- or file_path.startswith('components/rlz/')
- or file_path.startswith('components/sync/') and not file_path.endswith('ordinal.h')
- or file_path.startswith('components/test/')
- or file_path.startswith('components/test_runner/')
- or file_path.startswith('components/translate/')
+ or (file_path.startswith('components/') and (
+ file_path.startswith('components/chrome_apps/')
+ or file_path.startswith('components/cronet/')
+ or file_path.startswith('components/drive/')
+ or file_path.startswith('components/invalidation/')
+ or file_path.startswith('components/gcm_driver/')
+ or file_path.startswith('components/nacl/')
+ or file_path.startswith('components/omnibox/')
+ or file_path.startswith('components/policy/')
+ or file_path.startswith('components/proximity_auth/')
+ or (file_path.startswith('components/resources/terms/') and not file_path.endswith('terms_chromium.html'))
+ or file_path.startswith('components/rlz/')
+ or file_path.startswith('components/sync/') and not file_path.endswith('ordinal.h')
+ or file_path.startswith('components/test/')
+ or file_path.startswith('components/test_runner/')
+ or file_path.startswith('components/translate/')
+ ))
or file_path.startswith('content/public/android/java')
or (file_path.startswith('content/shell') and
not file_path.startswith('content/shell/common') and
@@ -151,7 +133,7 @@ def isInChromiumBlacklist(file_path):
or file_path.startswith('google_update')
or file_path.startswith('ios')
or file_path.startswith('media/base/android/java')
- or file_path.startswith('native_client')
+ or file_path.startswith('native_client_sdk')
or file_path.startswith('net/android/java')
or (file_path.startswith('net/data/') and '_unittest/' in file_path)
or file_path.startswith('net/data/fuzzer_data/')
@@ -159,86 +141,85 @@ def isInChromiumBlacklist(file_path):
or file_path.startswith('rlz')
or file_path.startswith('testing/android')
or file_path.startswith('testing/buildbot')
- or file_path.startswith('third_party/WebKit/LayoutTests')
- or file_path.startswith('third_party/WebKit/ManualTests')
- or file_path.startswith('third_party/WebKit/Source/core/testing/data/')
- or file_path.startswith('third_party/WebKit/Source/devtools/devtools-node-modules')
- or file_path.startswith('third_party/WebKit/PerformanceTests')
- or file_path.startswith('third_party/accessibility-audit')
- or file_path.startswith('third_party/afl')
- or file_path.startswith('third_party/android_')
- or file_path.startswith('third_party/apache-win32')
- or file_path.startswith('third_party/apple_sample_code')
- or file_path.startswith('third_party/ashmem')
- or file_path.startswith('third_party/binutils')
- or file_path.startswith('third_party/bison')
- or file_path.startswith('third_party/blink/perf_tests/')
- or file_path.startswith('third_party/breakpad/src/processor/testdata/')
- or file_path.startswith('third_party/boringssl/crypto_test_data.cc')
- or file_path.startswith('third_party/boringssl/src/fuzz')
- or (file_path.startswith('third_party/cacheinvalidation') and
- not file_path.endswith('isolate'))
- or file_path.startswith('third_party/catapult')
- or file_path.startswith('third_party/chromite')
- or file_path.startswith('third_party/cld_2')
- or file_path.startswith('third_party/closure_compiler')
- or file_path.startswith('third_party/codesighs')
- or file_path.startswith('third_party/colorama')
- or file_path.startswith('third_party/cygwin')
- or file_path.startswith('third_party/cython')
- or file_path.startswith('third_party/deqp')
- or file_path.startswith('third_party/depot_tools')
- or file_path.startswith('third_party/elfutils')
- or file_path.startswith('third_party/freetype-android')
- or file_path.startswith('third_party/google_input_tools')
- or file_path.startswith('third_party/gperf')
- or file_path.startswith('third_party/gnu_binutils')
- or file_path.startswith('third_party/grpc')
- or file_path.startswith('third_party/gtk+')
- or file_path.startswith('third_party/google_appengine_cloudstorage')
- or file_path.startswith('third_party/google_toolbox_for_mac')
- or file_path.startswith('third_party/hunspell_dictionaries')
- or (file_path.startswith('third_party/icu') and file_path.endswith('icudtl_dat.S'))
- or file_path.startswith('third_party/icu/android')
- or file_path.startswith('third_party/icu/ios')
- or file_path.startswith('third_party/instrumented_libraries')
- or file_path.startswith('third_party/jsr-305')
- or file_path.startswith('third_party/junit')
- or file_path.startswith('third_party/lcov')
- or file_path.startswith('third_party/libphonenumber')
- or file_path.startswith('third_party/libaddressinput/src/testdata')
- or file_path.startswith('third_party/libaddressinput/src/common/src/test')
- or file_path.startswith('third_party/libc++')
- or file_path.startswith('third_party/liblouis')
- or file_path.startswith('third_party/lighttpd')
- or file_path.startswith('third_party/libwebm/source/webm_parser/fuzzing')
- or file_path.startswith('third_party/logilab')
- or file_path.startswith('third_party/markdown')
- or file_path.startswith('third_party/mingw-w64')
- or file_path.startswith('third_party/nacl_sdk_binaries')
- or (file_path.startswith('third_party/polymer') and
- not file_path.startswith('third_party/polymer/v1_0/components-chromium/'))
- or file_path.startswith('third_party/openh264/src/res')
- or file_path.startswith('third_party/pdfium/testing/resources')
- or file_path.startswith('third_party/pdfium/tools')
- or file_path.startswith('third_party/pdfsqueeze')
- or file_path.startswith('third_party/pefile')
- or file_path.startswith('third_party/perl')
- or file_path.startswith('third_party/psyco_win32')
- or file_path.startswith('third_party/pylint')
- or file_path.startswith('third_party/scons-2.0.1')
- or file_path.startswith('third_party/sfntly/src/cpp/data/fonts')
- or file_path.startswith('third_party/sfntly/src/java')
- or file_path.startswith('third_party/skia/infra')
- or file_path.startswith('third_party/speech-dispatcher')
- or file_path.startswith('third_party/talloc')
- or file_path.startswith('third_party/trace-viewer')
- or file_path.startswith('third_party/undoview')
- or file_path.startswith('third_party/wayland')
- or file_path.startswith('third_party/webgl')
- or file_path.startswith('third_party/webrtc/resources/')
- or file_path.startswith('third_party/webrtc/third_party/boringssl/crypto_test_data.cc')
- or file_path.startswith('third_party/webrtc/third_party/boringssl/src/fuzz')
+ or (file_path.startswith('third_party/') and (
+ file_path.startswith('third_party/WebKit/LayoutTests')
+ or file_path.startswith('third_party/accessibility-audit')
+ or file_path.startswith('third_party/afl')
+ or file_path.startswith('third_party/android_')
+ or file_path.startswith('third_party/apache-win32')
+ or file_path.startswith('third_party/apple_sample_code')
+ or file_path.startswith('third_party/ashmem')
+ or file_path.startswith('third_party/binutils')
+ or file_path.startswith('third_party/bison')
+ or file_path.startswith('third_party/blink/perf_tests/')
+ or file_path.startswith('third_party/breakpad/src/processor/testdata/')
+ or file_path.startswith('third_party/boringssl/crypto_test_data.cc')
+ or file_path.startswith('third_party/boringssl/src/fuzz')
+ or (file_path.startswith('third_party/cacheinvalidation') and
+ not file_path.endswith('isolate'))
+ or file_path.startswith('third_party/catapult')
+ or file_path.startswith('third_party/chromite')
+ or file_path.startswith('third_party/cld_2')
+ or file_path.startswith('third_party/closure_compiler')
+ or file_path.startswith('third_party/codesighs')
+ or file_path.startswith('third_party/colorama')
+ or file_path.startswith('third_party/cygwin')
+ or file_path.startswith('third_party/cython')
+ or file_path.startswith('third_party/deqp')
+ or file_path.startswith('third_party/depot_tools')
+ or file_path.startswith('third_party/elfutils')
+ or file_path.startswith('third_party/freetype-android')
+ or file_path.startswith('third_party/google_input_tools')
+ or file_path.startswith('third_party/gperf')
+ or file_path.startswith('third_party/gnu_binutils')
+ or file_path.startswith('third_party/grpc')
+ or file_path.startswith('third_party/gtk+')
+ or file_path.startswith('third_party/google_appengine_cloudstorage')
+ or file_path.startswith('third_party/google_toolbox_for_mac')
+ or file_path.startswith('third_party/hunspell_dictionaries')
+ or (file_path.startswith('third_party/icu') and file_path.endswith('icudtl_dat.S'))
+ or file_path.startswith('third_party/icu/android')
+ or file_path.startswith('third_party/icu/ios')
+ or file_path.startswith('third_party/instrumented_libraries')
+ or file_path.startswith('third_party/jsr-305')
+ or file_path.startswith('third_party/junit')
+ or file_path.startswith('third_party/lcov')
+ or file_path.startswith('third_party/libphonenumber')
+ or file_path.startswith('third_party/libaddressinput/src/testdata')
+ or file_path.startswith('third_party/libaddressinput/src/common/src/test')
+ or file_path.startswith('third_party/libc++')
+ or file_path.startswith('third_party/liblouis')
+ or file_path.startswith('third_party/lighttpd')
+ or file_path.startswith('third_party/libwebm/source/webm_parser/fuzzing')
+ or file_path.startswith('third_party/logilab')
+ or file_path.startswith('third_party/markdown')
+ or file_path.startswith('third_party/mingw-w64')
+ or file_path.startswith('third_party/nacl_sdk_binaries')
+ or (file_path.startswith('third_party/polymer') and
+ not file_path.startswith('third_party/polymer/v1_0/components-chromium/'))
+ or file_path.startswith('third_party/openh264/src/res')
+ or file_path.startswith('third_party/pdfium/testing/resources')
+ or file_path.startswith('third_party/pdfium/tools')
+ or file_path.startswith('third_party/pdfsqueeze')
+ or file_path.startswith('third_party/pefile')
+ or file_path.startswith('third_party/perl')
+ or file_path.startswith('third_party/psyco_win32')
+ or file_path.startswith('third_party/pylint')
+ or file_path.startswith('third_party/scons-2.0.1')
+ or file_path.startswith('third_party/sfntly/src/cpp/data/fonts')
+ or file_path.startswith('third_party/sfntly/src/java')
+ or file_path.startswith('third_party/skia/infra')
+ or file_path.startswith('third_party/speech-dispatcher')
+ or file_path.startswith('third_party/swiftshader/third_party/llvm')
+ or file_path.startswith('third_party/talloc')
+ or file_path.startswith('third_party/trace-viewer')
+ or file_path.startswith('third_party/undoview')
+ or file_path.startswith('third_party/wayland')
+ or file_path.startswith('third_party/webgl')
+ or file_path.startswith('third_party/webrtc/resources/')
+ or file_path.startswith('third_party/webrtc/third_party/boringssl/crypto_test_data.cc')
+ or file_path.startswith('third_party/webrtc/third_party/boringssl/src/fuzz')
+ ))
or file_path.startswith('tools/android')
or file_path.startswith('tools/luci_go')
or file_path.startswith('tools/memory_inspector')
@@ -252,7 +233,19 @@ def isInChromiumBlacklist(file_path):
or file_path.startswith('ui/events/ozone/chromeos')
or file_path.startswith('ui/file_manager')
or file_path.startswith('ui/gfx/chromeos')
-
+ or 'testdata/' in file_path
+ or '/tests/' in file_path
+ or ('/test/' in file_path and
+ not '/webrtc/' in file_path and
+ not file_path.startswith('net/test/') and
+ not file_path.endswith('mock_chrome_application_mac.h') and
+ not file_path.endswith('perftimer.h') and
+ not file_path.endswith('test-torque.tq') and
+ not 'ozone' in file_path and
+ not 'clang_coverage' in file_path and
+ not 'fontconfig_util_linux' in file_path and
+ not 'core/mojo/test/' in file_path and
+ not file_path.startswith('extensions/browser/'))
):
return True
return False
diff --git a/tools/scripts/version_resolver.py b/tools/scripts/version_resolver.py
index 824c9412b..32c3f9d12 100644
--- a/tools/scripts/version_resolver.py
+++ b/tools/scripts/version_resolver.py
@@ -38,8 +38,8 @@ import json
import urllib2
import git_submodule as GitSubmodule
-chromium_version = '70.0.3538.78'
-chromium_branch = '3538'
+chromium_version = '71.0.3578.93'
+chromium_branch = '3578'
ninja_version = 'v1.8.2'
json_url = 'http://omahaproxy.appspot.com/all.json'
@@ -51,7 +51,6 @@ upstream_src_dir = os.path.abspath(snapshot_src_dir + '_upstream')
submodule_blacklist = [
'third_party/WebKit/LayoutTests/w3c/csswg-test'
, 'third_party/WebKit/LayoutTests/w3c/web-platform-tests'
- , 'third_party/jsoncpp/source'
, 'chrome/tools/test/reference_build/chrome_mac'
, 'chrome/tools/test/reference_build/chrome_linux'
, 'chrome/tools/test/reference_build/chrome_win'