diff options
Diffstat (limited to 'src/core')
43 files changed, 258 insertions, 197 deletions
diff --git a/src/core/api/qwebengineurlrequestinfo.cpp b/src/core/api/qwebengineurlrequestinfo.cpp index 25fb4d50f..e2101fd02 100644 --- a/src/core/api/qwebengineurlrequestinfo.cpp +++ b/src/core/api/qwebengineurlrequestinfo.cpp @@ -46,26 +46,26 @@ QT_BEGIN_NAMESPACE -ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeMainFrame, content::RESOURCE_TYPE_MAIN_FRAME) -ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeSubFrame, content::RESOURCE_TYPE_SUB_FRAME) -ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeStylesheet, content::RESOURCE_TYPE_STYLESHEET) -ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeScript, content::RESOURCE_TYPE_SCRIPT) -ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeImage, content::RESOURCE_TYPE_IMAGE) -ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeFontResource, content::RESOURCE_TYPE_FONT_RESOURCE) -ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeSubResource, content::RESOURCE_TYPE_SUB_RESOURCE) -ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeObject, content::RESOURCE_TYPE_OBJECT) -ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeMedia, content::RESOURCE_TYPE_MEDIA) -ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeWorker, content::RESOURCE_TYPE_WORKER) -ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeSharedWorker, content::RESOURCE_TYPE_SHARED_WORKER) -ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypePrefetch, content::RESOURCE_TYPE_PREFETCH) -ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeFavicon, content::RESOURCE_TYPE_FAVICON) -ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeXhr, content::RESOURCE_TYPE_XHR) -ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypePing, content::RESOURCE_TYPE_PING) -ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeServiceWorker, content::RESOURCE_TYPE_SERVICE_WORKER) -ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeCspReport, content::RESOURCE_TYPE_CSP_REPORT) -ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypePluginResource, content::RESOURCE_TYPE_PLUGIN_RESOURCE) -ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeNavigationPreload, content::RESOURCE_TYPE_NAVIGATION_PRELOAD) -ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeLast, content::RESOURCE_TYPE_LAST_TYPE) +ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeMainFrame, content::ResourceType::kMainFrame) +ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeSubFrame, content::ResourceType::kSubFrame) +ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeStylesheet, content::ResourceType::kStylesheet) +ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeScript, content::ResourceType::kScript) +ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeImage, content::ResourceType::kImage) +ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeFontResource, content::ResourceType::kFontResource) +ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeSubResource, content::ResourceType::kSubResource) +ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeObject, content::ResourceType::kObject) +ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeMedia, content::ResourceType::kMedia) +ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeWorker, content::ResourceType::kWorker) +ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeSharedWorker, content::ResourceType::kSharedWorker) +ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypePrefetch, content::ResourceType::kPrefetch) +ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeFavicon, content::ResourceType::kFavicon) +ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeXhr, content::ResourceType::kXhr) +ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypePing, content::ResourceType::kPing) +ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeServiceWorker, content::ResourceType::kServiceWorker) +ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeCspReport, content::ResourceType::kCspReport) +ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypePluginResource, content::ResourceType::kPluginResource) +ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeNavigationPreload, content::ResourceType::kNavigationPreload) +ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeLast, content::ResourceType::kMaxValue) ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::LinkNavigation, QWebEngineUrlRequestInfo::NavigationTypeLink) ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::TypedNavigation, QWebEngineUrlRequestInfo::NavigationTypeTyped) diff --git a/src/core/api/qwebengineurlrequestinfo.h b/src/core/api/qwebengineurlrequestinfo.h index 6b8159a9b..c2c924b05 100644 --- a/src/core/api/qwebengineurlrequestinfo.h +++ b/src/core/api/qwebengineurlrequestinfo.h @@ -78,7 +78,7 @@ public: ResourceTypePluginResource, // A resource requested by a plugin ResourceTypeNavigationPreload, // A service worker navigation preload request. #ifndef Q_QDOC - ResourceTypeLast, + ResourceTypeLast = ResourceTypeNavigationPreload, #endif ResourceTypeUnknown = 255 }; diff --git a/src/core/browser_accessibility_qt.cpp b/src/core/browser_accessibility_qt.cpp index 75527ea95..f7e9c1c4f 100644 --- a/src/core/browser_accessibility_qt.cpp +++ b/src/core/browser_accessibility_qt.cpp @@ -386,6 +386,8 @@ QAccessible::Role BrowserAccessibilityQt::role() const return QAccessible::ListItem; case ax::mojom::Role::kListItem: return QAccessible::ListItem; + case ax::mojom::Role::kListGrid: + return QAccessible::List; case ax::mojom::Role::kListMarker: return QAccessible::StaticText; case ax::mojom::Role::kLog: @@ -727,7 +729,11 @@ void BrowserAccessibilityQt::scrollToSubstring(int startIndex, int endIndex) { int count = characterCount(); if (startIndex < endIndex && endIndex < count) - manager()->ScrollToMakeVisible(*this, GetPageBoundsForRange(startIndex, endIndex - startIndex)); + manager()->ScrollToMakeVisible(*this, + GetRootFrameRangeBoundsRect( + startIndex, + endIndex - startIndex, + ui::AXClippingBehavior::kUnclipped)); } QVariant BrowserAccessibilityQt::currentValue() const diff --git a/src/core/browser_main_parts_qt.cpp b/src/core/browser_main_parts_qt.cpp index 421a44890..d42a931d0 100644 --- a/src/core/browser_main_parts_qt.cpp +++ b/src/core/browser_main_parts_qt.cpp @@ -146,8 +146,7 @@ private: void ensureDelegate() { if (!m_delegate) { - auto messageLoop = base::MessageLoopCurrentForUI::Get().ToMessageLoopBaseDeprecated(); - auto seqMan = static_cast<base::sequence_manager::internal::SequenceManagerImpl *>(messageLoop); + auto seqMan = base::MessageLoopCurrent::GetCurrentSequenceManagerImpl(); m_delegate = static_cast<base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl *>( seqMan->controller_.get()); } diff --git a/src/core/browsing_data_remover_delegate_qt.cpp b/src/core/browsing_data_remover_delegate_qt.cpp index 78e6893ea..005a9820d 100644 --- a/src/core/browsing_data_remover_delegate_qt.cpp +++ b/src/core/browsing_data_remover_delegate_qt.cpp @@ -49,7 +49,7 @@ namespace QtWebEngineCore { bool DoesOriginMatchEmbedderMask(int origin_type_mask, - const GURL &origin, + const url::Origin &origin, storage::SpecialStoragePolicy *policy) { Q_UNUSED(origin_type_mask); Q_UNUSED(origin); @@ -58,7 +58,7 @@ bool DoesOriginMatchEmbedderMask(int origin_type_mask, } content::BrowsingDataRemoverDelegate::EmbedderOriginTypeMatcher BrowsingDataRemoverDelegateQt::GetOriginTypeMatcher() const { - return base::Bind(&DoesOriginMatchEmbedderMask); + return base::BindRepeating(&DoesOriginMatchEmbedderMask); } bool BrowsingDataRemoverDelegateQt::MayRemoveDownloadHistory() const { diff --git a/src/core/chromium_overrides.cpp b/src/core/chromium_overrides.cpp index c44d75a42..b226c34ea 100644 --- a/src/core/chromium_overrides.cpp +++ b/src/core/chromium_overrides.cpp @@ -42,7 +42,6 @@ #include "web_contents_view_qt.h" #include "base/values.h" -#include "content/browser/renderer_host/pepper/pepper_truetype_font_list.h" #include "content/browser/renderer_host/render_widget_host_view_base.h" #include "content/browser/web_contents/web_contents_impl.h" #include "content/common/font_list.h" @@ -120,22 +119,6 @@ std::unique_ptr<base::ListValue> GetFontList_SlowBlocking() return std::move(font_list); } -#if QT_CONFIG(webengine_pepper_plugins) -// content/browser/renderer_host/pepper/pepper_truetype_font_list.h -void GetFontFamilies_SlowBlocking(std::vector<std::string> *font_families) -{ - QFontDatabase database; - for (auto family : database.families()){ - font_families->push_back(family.toStdString()); - } -} - -void GetFontsInFamily_SlowBlocking(const std::string &, std::vector<ppapi::proxy::SerializedTrueTypeFontDesc> *) -{ - QT_NOT_USED -} -#endif // QT_CONFIG(webengine_pepper_plugins) - } // namespace content namespace aura { diff --git a/src/core/compositor/delegated_frame_node.cpp b/src/core/compositor/delegated_frame_node.cpp index 5f474cbfb..dc67b03e2 100644 --- a/src/core/compositor/delegated_frame_node.cpp +++ b/src/core/compositor/delegated_frame_node.cpp @@ -953,7 +953,7 @@ void DelegatedFrameNode::handleQuad( initAndHoldTexture(resource, quad->ShouldDrawWithBlending(), apiDelegate, GL_TEXTURE_EXTERNAL_OES)); QMatrix4x4 qMatrix; - convertToQt(squad->matrix.matrix(), qMatrix); +// convertToQt(squad->matrix.matrix(), qMatrix); nodeHandler->setupStreamVideoNode(texture, toQt(squad->rect), qMatrix, currentLayerChain); break; #endif // GL_OES_EGL_image_external diff --git a/src/core/config/common.pri b/src/core/config/common.pri index 18bd358f3..dea904ef8 100644 --- a/src/core/config/common.pri +++ b/src/core/config/common.pri @@ -12,6 +12,7 @@ gn_args += \ enable_nacl=false \ enable_remoting=false \ enable_reporting=false \ + enable_resource_whitelist_generation=false \ enable_swiftshader=false \ enable_web_auth=false \ enable_web_speech=false \ @@ -93,11 +94,15 @@ CONFIG(release, debug|release) { CONFIG(debug, debug|release) { gn_args += is_debug=true gn_args += use_debug_fission=false - # MSVC requires iterator debug to always match and Qt has leaves it default on. + # MSVC requires iterator debug to always match and Qt leaves it default on. msvc: gn_args += enable_iterator_debugging=true + + # We also can not have optimized V8 binaries for MSVC as iterator debugging + # would mismatch. + msvc|v8base_debug: gn_args += v8_optimized_debug=false } -!webcore_debug: gn_args += remove_webcore_debug_symbols=true +!webcore_debug: gn_args += blink_symbol_level=0 !v8base_debug: gn_args += remove_v8base_debug_symbols=true # Compiling with -Os makes a huge difference in binary size diff --git a/src/core/config/linux.pri b/src/core/config/linux.pri index e45273cca..40bc0b73c 100644 --- a/src/core/config/linux.pri +++ b/src/core/config/linux.pri @@ -17,6 +17,7 @@ gn_args += \ use_sysroot=false \ enable_session_service=false \ is_cfi=false \ + strip_absolute_paths_from_debug_symbols=false \ toolkit_views=false \ use_ozone=true \ ozone_auto_platforms=false \ diff --git a/src/core/config/mac_osx.pri b/src/core/config/mac_osx.pri index e49df90e7..3f2fe9c0a 100644 --- a/src/core/config/mac_osx.pri +++ b/src/core/config/mac_osx.pri @@ -24,6 +24,7 @@ system("$${QMAKE_CLANG_PATH} --version") gn_args += \ is_clang=true \ use_sysroot=false \ + use_system_xcode=true \ clang_base_path=\"$${QMAKE_CLANG_DIR}\" \ clang_use_chrome_plugins=false \ mac_deployment_target=\"$${QMAKE_MACOSX_DEPLOYMENT_TARGET}\" \ diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp index ee346efd3..ee420d258 100644 --- a/src/core/content_browser_client_qt.cpp +++ b/src/core/content_browser_client_qt.cpp @@ -87,7 +87,7 @@ #include "services/service_manager/public/cpp/service.h" #include "services/service_manager/sandbox/switches.h" #include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h" -#include "third_party/blink/public/platform/modules/insecure_input/insecure_input_service.mojom.h" +#include "third_party/blink/public/mojom/insecure_input/insecure_input_service.mojom.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/ui_base_switches.h" #include "ui/gl/gl_context.h" @@ -337,7 +337,7 @@ void ContentBrowserClientQt::OverrideWebkitPrefs(content::RenderViewHost *rvh, c } } -content::QuotaPermissionContext *ContentBrowserClientQt::CreateQuotaPermissionContext() +scoped_refptr<content::QuotaPermissionContext> ContentBrowserClientQt::CreateQuotaPermissionContext() { return new QuotaPermissionContextQt; } @@ -484,11 +484,12 @@ content::DevToolsManagerDelegate* ContentBrowserClientQt::GetDevToolsManagerDele return new DevToolsManagerDelegateQt; } -content::PlatformNotificationService *ContentBrowserClientQt::GetPlatformNotificationService() +content::PlatformNotificationService *ContentBrowserClientQt::GetPlatformNotificationService(content::BrowserContext *browser_context) { - if (!m_platformNotificationService) - m_platformNotificationService = std::make_unique<PlatformNotificationServiceQt>(); - return m_platformNotificationService.get(); + ProfileQt *profile = static_cast<ProfileQt *>(browser_context); + if (!profile) + return nullptr; + return profile->platformNotificationService(); } // This is a really complicated way of doing absolutely nothing, but Mojo demands it: @@ -542,7 +543,7 @@ void ContentBrowserClientQt::InitFrameInterfaces() { m_frameInterfaces = std::make_unique<service_manager::BinderRegistry>(); m_frameInterfacesParameterized = std::make_unique<service_manager::BinderRegistryWithArgs<content::RenderFrameHost*>>(); - m_frameInterfacesParameterized->AddInterface(base::Bind(&ServiceDriver::BindInsecureInputService)); + m_frameInterfacesParameterized->AddInterface(base::BindRepeating(&ServiceDriver::BindInsecureInputService)); } void ContentBrowserClientQt::BindInterfaceRequestFromFrame(content::RenderFrameHost* render_frame_host, @@ -747,7 +748,9 @@ bool ContentBrowserClientQt::HandleExternalProtocol( ui::PageTransition page_transition, bool has_user_gesture, const std::string &method, - const net::HttpRequestHeaders &headers) + const net::HttpRequestHeaders &headers, + network::mojom::URLLoaderFactoryRequest *factory_request, + network::mojom::URLLoaderFactory *&out_factory) { Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); Q_UNUSED(child_id); @@ -766,7 +769,7 @@ bool ContentBrowserClientQt::HandleExternalProtocol( } std::unique_ptr<content::LoginDelegate> ContentBrowserClientQt::CreateLoginDelegate( - net::AuthChallengeInfo *authInfo, + const net::AuthChallengeInfo &authInfo, content::WebContents *web_contents, const content::GlobalRequestID & /*request_id*/, bool /*is_main_frame*/, diff --git a/src/core/content_browser_client_qt.h b/src/core/content_browser_client_qt.h index ac575c2a8..7f31b7c85 100644 --- a/src/core/content_browser_client_qt.h +++ b/src/core/content_browser_client_qt.h @@ -89,7 +89,7 @@ public: void ResourceDispatcherHostCreated() override; gl::GLShareGroup* GetInProcessGpuShareGroup() override; content::MediaObserver* GetMediaObserver() override; - content::QuotaPermissionContext *CreateQuotaPermissionContext() override; + scoped_refptr<content::QuotaPermissionContext> CreateQuotaPermissionContext() override; void GetQuotaSettings(content::BrowserContext *context, content::StoragePartition *partition, storage::OptionalQuotaSettingsCallback callback) override; @@ -108,7 +108,7 @@ public: std::unique_ptr<content::ClientCertificateDelegate> delegate) override; std::unique_ptr<net::ClientCertStore> CreateClientCertStore(content::ResourceContext *resource_context) override; content::DevToolsManagerDelegate *GetDevToolsManagerDelegate() override; - content::PlatformNotificationService *GetPlatformNotificationService() override; + content::PlatformNotificationService * GetPlatformNotificationService(content::BrowserContext *browser_context) override; std::string GetApplicationLocale() override; std::string GetAcceptLangs(content::BrowserContext* context) override; @@ -186,9 +186,9 @@ public: #endif std::unique_ptr<content::LoginDelegate> CreateLoginDelegate( - net::AuthChallengeInfo *auth_info, + const net::AuthChallengeInfo &auth_info, content::WebContents *web_contents, - const content::GlobalRequestID &request_id, + const content::GlobalRequestID& request_id, bool is_request_for_main_frame, const GURL &url, scoped_refptr<net::HttpResponseHeaders> response_headers, @@ -203,7 +203,9 @@ public: ui::PageTransition page_transition, bool has_user_gesture, const std::string &method, - const net::HttpRequestHeaders &headers) override; + const net::HttpRequestHeaders &headers, + network::mojom::URLLoaderFactoryRequest *factory_request, + network::mojom::URLLoaderFactory *&out_factory) override; static std::string getUserAgent(); @@ -216,7 +218,6 @@ private: BrowserMainPartsQt* m_browserMainParts; std::unique_ptr<content::ResourceDispatcherHostDelegate> m_resourceDispatcherHostDelegate; - std::unique_ptr<content::PlatformNotificationService> m_platformNotificationService; scoped_refptr<ShareGroupQtQuick> m_shareGroupQtQuick; std::unique_ptr<service_manager::BinderRegistry> m_frameInterfaces; std::unique_ptr<service_manager::BinderRegistryWithArgs<content::RenderFrameHost*>> m_frameInterfacesParameterized; diff --git a/src/core/content_main_delegate_qt.cpp b/src/core/content_main_delegate_qt.cpp index 57f8af63c..6df20896c 100644 --- a/src/core/content_main_delegate_qt.cpp +++ b/src/core/content_main_delegate_qt.cpp @@ -165,6 +165,11 @@ void ContentMainDelegateQt::PreSandboxStartup() logging::SetMinLogLevel(level); } } + +#if defined(OS_POSIX) && !defined(OS_ANDROID) + if (parsedCommandLine->HasSwitch(switches::kSingleProcess)) + setlocale(LC_NUMERIC, "C"); +#endif } content::ContentBrowserClient *ContentMainDelegateQt::CreateContentBrowserClient() diff --git a/src/core/devtools_frontend_qt.cpp b/src/core/devtools_frontend_qt.cpp index 330730f9c..d3f46f648 100644 --- a/src/core/devtools_frontend_qt.cpp +++ b/src/core/devtools_frontend_qt.cpp @@ -375,7 +375,8 @@ void DevToolsFrontendQt::HandleMessageFromDevToolsFrontend(const std::string &me return; m_agentHost->DispatchProtocolMessage(this, protocol_message); } else if (method == "loadCompleted") { - web_contents()->GetMainFrame()->ExecuteJavaScript(base::ASCIIToUTF16("DevToolsAPI.setUseSoftMenu(true);")); + web_contents()->GetMainFrame()->ExecuteJavaScript(base::ASCIIToUTF16("DevToolsAPI.setUseSoftMenu(true);"), + base::NullCallback()); } else if (method == "loadNetworkResource" && params->GetSize() == 3) { // TODO(pfeldman): handle some of the embedder messages in content. std::string url; @@ -453,7 +454,8 @@ void DevToolsFrontendQt::HandleMessageFromDevToolsFrontend(const std::string &me } else if (method == "clearPreferences") { ClearPreferences(); } else if (method == "requestFileSystems") { - web_contents()->GetMainFrame()->ExecuteJavaScript(base::ASCIIToUTF16("DevToolsAPI.fileSystemsLoaded([]);")); + web_contents()->GetMainFrame()->ExecuteJavaScript(base::ASCIIToUTF16("DevToolsAPI.fileSystemsLoaded([]);"), + base::NullCallback()); } else if (method == "reattach") { m_agentHost->DetachClient(this); m_agentHost->AttachClient(this); @@ -498,7 +500,7 @@ void DevToolsFrontendQt::DispatchProtocolMessage(content::DevToolsAgentHost *age base::EscapeJSONString(message, true, ¶m); std::string code = "DevToolsAPI.dispatchMessage(" + param + ");"; base::string16 javascript = base::UTF8ToUTF16(code); - web_contents()->GetMainFrame()->ExecuteJavaScript(javascript); + web_contents()->GetMainFrame()->ExecuteJavaScript(javascript, base::NullCallback()); return; } @@ -509,7 +511,7 @@ void DevToolsFrontendQt::DispatchProtocolMessage(content::DevToolsAgentHost *age std::string code = "DevToolsAPI.dispatchMessageChunk(" + param + "," + std::to_string(pos ? 0 : total_size) + ");"; base::string16 javascript = base::UTF8ToUTF16(code); - web_contents()->GetMainFrame()->ExecuteJavaScript(javascript); + web_contents()->GetMainFrame()->ExecuteJavaScript(javascript, base::NullCallback()); } } @@ -533,7 +535,7 @@ void DevToolsFrontendQt::CallClientFunction(const std::string &function_name, } } javascript.append(");"); - web_contents()->GetMainFrame()->ExecuteJavaScript(base::UTF8ToUTF16(javascript)); + web_contents()->GetMainFrame()->ExecuteJavaScript(base::UTF8ToUTF16(javascript), base::NullCallback()); } void DevToolsFrontendQt::SendMessageAck(int request_id, const base::Value *arg) diff --git a/src/core/extensions/extension_system_qt.h b/src/core/extensions/extension_system_qt.h index 0ebe1d044..712e0104d 100644 --- a/src/core/extensions/extension_system_qt.h +++ b/src/core/extensions/extension_system_qt.h @@ -49,12 +49,12 @@ #include <string> +#include "base/one_shot_event.h" #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "build/build_config.h" #include "extensions/browser/extension_system.h" #include "extensions/common/extension_set.h" -#include "extensions/common/one_shot_event.h" namespace extensions { @@ -120,7 +120,7 @@ public: void Init(bool extensions_enabled); - const OneShotEvent &ready() const override { return ready_; } + const base::OneShotEvent &ready() const override { return ready_; } private: void OnExtensionRegisteredWithRequestContexts(scoped_refptr<const extensions::Extension> extension); @@ -141,7 +141,7 @@ private: // For verifying the contents of extensions read from disk. scoped_refptr<ContentVerifier> content_verifier_; - OneShotEvent ready_; + base::OneShotEvent ready_; content::BrowserContext *browser_context_; scoped_refptr<ValueStoreFactory> store_factory_; diff --git a/src/core/login_delegate_qt.cpp b/src/core/login_delegate_qt.cpp index b02940584..7970b9b46 100644 --- a/src/core/login_delegate_qt.cpp +++ b/src/core/login_delegate_qt.cpp @@ -72,11 +72,11 @@ namespace QtWebEngineCore { -LoginDelegateQt::LoginDelegateQt(net::AuthChallengeInfo *authInfo, - content::WebContents *web_contents, - GURL url, - bool /*first_auth_attempt*/, - LoginAuthRequiredCallback auth_required_callback) +LoginDelegateQt::LoginDelegateQt(const net::AuthChallengeInfo &authInfo, + content::WebContents *web_contents, + GURL url, + bool /*first_auth_attempt*/, + LoginAuthRequiredCallback auth_required_callback) : content::WebContentsObserver(web_contents) , m_authInfo(authInfo) , m_url(url) @@ -100,22 +100,22 @@ QUrl LoginDelegateQt::url() const QString LoginDelegateQt::realm() const { - return QString::fromStdString(m_authInfo->realm); + return QString::fromStdString(m_authInfo.realm); } QString LoginDelegateQt::host() const { - return QString::fromStdString(m_authInfo->challenger.host()); + return QString::fromStdString(m_authInfo.challenger.host()); } int LoginDelegateQt::port() const { - return m_authInfo->challenger.port(); + return m_authInfo.challenger.port(); } bool LoginDelegateQt::isProxy() const { - return m_authInfo->is_proxy; + return m_authInfo.is_proxy; } void LoginDelegateQt::triggerDialog() diff --git a/src/core/login_delegate_qt.h b/src/core/login_delegate_qt.h index 61f1745aa..20f302988 100644 --- a/src/core/login_delegate_qt.h +++ b/src/core/login_delegate_qt.h @@ -61,7 +61,7 @@ class LoginDelegateQt : public content::LoginDelegate, public content::WebContentsObserver { public: - LoginDelegateQt(net::AuthChallengeInfo *authInfo, + LoginDelegateQt(const net::AuthChallengeInfo &authInfo, content::WebContents *web_contents, GURL url, bool first_auth_attempt, @@ -81,7 +81,7 @@ private: void triggerDialog(); void destroy(); - scoped_refptr<net::AuthChallengeInfo> m_authInfo; + net::AuthChallengeInfo m_authInfo; GURL m_url; LoginAuthRequiredCallback m_auth_required_callback; diff --git a/src/core/net/client_cert_override.cpp b/src/core/net/client_cert_override.cpp index ed1572596..afb7ab5af 100644 --- a/src/core/net/client_cert_override.cpp +++ b/src/core/net/client_cert_override.cpp @@ -78,9 +78,9 @@ public: : net::ClientCertIdentity(std::move(cert)), m_key(std::move(key)) {} ~ClientCertIdentityOverride() override = default; - void AcquirePrivateKey(const base::Callback<void(scoped_refptr<net::SSLPrivateKey>)> &private_key_callback) override + void AcquirePrivateKey(base::OnceCallback<void(scoped_refptr<net::SSLPrivateKey>)> private_key_callback) override { - private_key_callback.Run(m_key); + std::move(private_key_callback).Run(m_key); } #if defined(OS_MACOSX) @@ -125,20 +125,20 @@ net::ClientCertIdentityList ClientCertOverrideStore::GetClientCertsOnUIThread(co } void ClientCertOverrideStore::GetClientCertsReturn(const net::SSLCertRequestInfo &cert_request_info, - const ClientCertListCallback &callback, + ClientCertListCallback callback, net::ClientCertIdentityList &&result) { // Continue with native cert store if matching certificatse were not found in memory if (result.empty() && m_nativeStore) - m_nativeStore->GetClientCerts(cert_request_info, callback); + m_nativeStore->GetClientCerts(cert_request_info, std::move(callback)); else - callback.Run(std::move(result)); + std::move(callback).Run(std::move(result)); } #endif // QT_CONFIG(ssl) void ClientCertOverrideStore::GetClientCerts(const net::SSLCertRequestInfo &cert_request_info, - const ClientCertListCallback &callback) + ClientCertListCallback callback) { #if QT_CONFIG(ssl) // Access the user-provided data from the UI thread, but return on whatever thread this is. @@ -147,7 +147,7 @@ void ClientCertOverrideStore::GetClientCerts(const net::SSLCertRequestInfo &cert base::BindOnce(&ClientCertOverrideStore::GetClientCertsOnUIThread, base::Unretained(this), std::cref(cert_request_info)), base::BindOnce(&ClientCertOverrideStore::GetClientCertsReturn, - base::Unretained(this), std::cref(cert_request_info), callback)) + base::Unretained(this), std::cref(cert_request_info), std::move(callback))) ) { return; } @@ -155,9 +155,9 @@ void ClientCertOverrideStore::GetClientCerts(const net::SSLCertRequestInfo &cert // Continue with native cert store if we failed to post task if (m_nativeStore) - m_nativeStore->GetClientCerts(cert_request_info, callback); + m_nativeStore->GetClientCerts(cert_request_info, std::move(callback)); else - callback.Run(net::ClientCertIdentityList()); + std::move(callback).Run(net::ClientCertIdentityList()); } // static diff --git a/src/core/net/client_cert_override.h b/src/core/net/client_cert_override.h index 35c1f96af..4f2734485 100644 --- a/src/core/net/client_cert_override.h +++ b/src/core/net/client_cert_override.h @@ -57,12 +57,12 @@ public: ClientCertOverrideStore(ClientCertificateStoreData *storeData); virtual ~ClientCertOverrideStore() override; void GetClientCerts(const net::SSLCertRequestInfo &cert_request_info, - const ClientCertListCallback &callback) override; + ClientCertListCallback callback) override; private: static std::unique_ptr<net::ClientCertStore> createNativeStore(); net::ClientCertIdentityList GetClientCertsOnUIThread(const net::SSLCertRequestInfo &request); void GetClientCertsReturn(const net::SSLCertRequestInfo &cert_request_info, - const ClientCertListCallback &callback, + ClientCertListCallback callback, net::ClientCertIdentityList &&result); ClientCertificateStoreData *m_storeData; std::unique_ptr<net::ClientCertStore> m_nativeStore; diff --git a/src/core/net/network_delegate_qt.cpp b/src/core/net/network_delegate_qt.cpp index 20addefb2..68bf34d31 100644 --- a/src/core/net/network_delegate_qt.cpp +++ b/src/core/net/network_delegate_qt.cpp @@ -90,7 +90,7 @@ WebContentsAdapterClient::NavigationType pageTransitionToNavigationType(ui::Page static QWebEngineUrlRequestInfo::ResourceType toQt(content::ResourceType resourceType) { - if (resourceType >= 0 && resourceType < content::ResourceType(QWebEngineUrlRequestInfo::ResourceTypeLast)) + if (resourceType >= content::ResourceType::kMainFrame && resourceType <= content::ResourceType::kMaxValue) return static_cast<QWebEngineUrlRequestInfo::ResourceType>(resourceType); return QWebEngineUrlRequestInfo::ResourceTypeUnknown; } @@ -111,7 +111,7 @@ int NetworkDelegateQt::OnBeforeURLRequest(net::URLRequest *request, net::Complet Q_ASSERT(m_profileIOData); content::ResourceRequestInfo *resourceInfo = content::ResourceRequestInfo::ForRequest(request); - content::ResourceType resourceType = content::RESOURCE_TYPE_LAST_TYPE; + content::ResourceType resourceType = content::ResourceType::kMaxValue; WebContentsAdapterClient::NavigationType navigationType = WebContentsAdapterClient::OtherNavigation; if (resourceInfo) { @@ -122,7 +122,7 @@ int NetworkDelegateQt::OnBeforeURLRequest(net::URLRequest *request, net::Complet const QUrl qUrl = toQt(request->url()); QUrl firstPartyUrl = QUrl(); - if (resourceType == content::ResourceType::RESOURCE_TYPE_SUB_FRAME) + if (resourceType == content::ResourceType::kSubFrame) firstPartyUrl = toQt(request->first_party_url()); else firstPartyUrl = toQt(request->site_for_cookies()); diff --git a/src/core/ozone/gl_ozone_glx_qt.cpp b/src/core/ozone/gl_ozone_glx_qt.cpp index e3a4f4708..f934a5c80 100644 --- a/src/core/ozone/gl_ozone_glx_qt.cpp +++ b/src/core/ozone/gl_ozone_glx_qt.cpp @@ -111,8 +111,10 @@ void GLOzoneGLXQt::ShutdownGL() { } bool GLOzoneGLXQt::GetGLWindowSystemBindingInfo( - gl::GLWindowSystemBindingInfo* info) { - return gl::GetGLWindowSystemBindingInfoGLX(info); + const gl::GLVersionInfo &gl_info, + gl::GLWindowSystemBindingInfo *info) +{ + return gl::GetGLWindowSystemBindingInfoGLX(gl_info, info); } scoped_refptr<gl::GLContext> GLOzoneGLXQt::CreateGLContext( diff --git a/src/core/ozone/gl_ozone_glx_qt.h b/src/core/ozone/gl_ozone_glx_qt.h index ffbd60454..1596ea12f 100644 --- a/src/core/ozone/gl_ozone_glx_qt.h +++ b/src/core/ozone/gl_ozone_glx_qt.h @@ -60,7 +60,8 @@ public: void SetDisabledExtensionsPlatform( const std::string& disabled_extensions) override; bool GetGLWindowSystemBindingInfo( - gl::GLWindowSystemBindingInfo* info) override; + const gl::GLVersionInfo &gl_info, + gl::GLWindowSystemBindingInfo *info) override; scoped_refptr<gl::GLContext> CreateGLContext( gl::GLShareGroup* share_group, diff --git a/src/core/ozone/gl_surface_egl_qt.cpp b/src/core/ozone/gl_surface_egl_qt.cpp index 33dd5745f..97c6cdee6 100644 --- a/src/core/ozone/gl_surface_egl_qt.cpp +++ b/src/core/ozone/gl_surface_egl_qt.cpp @@ -164,6 +164,11 @@ bool GLSurfaceEGL::IsCreateContextClientArraysSupported() return false; } +bool GLSurfaceEGL::IsPixelFormatFloatSupported() +{ + return false; +} + void GLSurfaceEGL::ShutdownOneOff() { } diff --git a/src/core/platform_notification_service_qt.cpp b/src/core/platform_notification_service_qt.cpp index e9829c21f..d8abec17f 100644 --- a/src/core/platform_notification_service_qt.cpp +++ b/src/core/platform_notification_service_qt.cpp @@ -105,12 +105,13 @@ struct PersistentNotificationDelegate : UserNotificationController::Delegate { }; -PlatformNotificationServiceQt::PlatformNotificationServiceQt() {} +PlatformNotificationServiceQt::PlatformNotificationServiceQt(content::BrowserContext *browserContext) + : browser_context(browserContext) +{} PlatformNotificationServiceQt::~PlatformNotificationServiceQt() {} void PlatformNotificationServiceQt::DisplayNotification( - content::BrowserContext *browser_context, const std::string ¬ification_id, const GURL &origin, const blink::PlatformNotificationData ¬ificationData, @@ -131,7 +132,6 @@ void PlatformNotificationServiceQt::DisplayNotification( } void PlatformNotificationServiceQt::DisplayPersistentNotification( - content::BrowserContext *browser_context, const std::string ¬ification_id, const GURL &service_worker_origin, const GURL &origin, @@ -151,9 +151,7 @@ void PlatformNotificationServiceQt::DisplayPersistentNotification( client->showNotification(controller); } -void PlatformNotificationServiceQt::CloseNotification( - content::BrowserContext *browser_context, - const std::string ¬ification_id) +void PlatformNotificationServiceQt::CloseNotification(const std::string ¬ification_id) { Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); ProfileQt *profile = static_cast<ProfileQt*>(browser_context); @@ -164,9 +162,7 @@ void PlatformNotificationServiceQt::CloseNotification( notificationController->closeNotification(); } -void PlatformNotificationServiceQt::ClosePersistentNotification( - content::BrowserContext *browser_context, - const std::string ¬ification_id) +void PlatformNotificationServiceQt::ClosePersistentNotification(const std::string ¬ification_id) { Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); ProfileQt *profile = static_cast<ProfileQt*>(browser_context); @@ -177,9 +173,7 @@ void PlatformNotificationServiceQt::ClosePersistentNotification( notificationController->closeNotification(); } -void PlatformNotificationServiceQt::GetDisplayedNotifications( - content::BrowserContext *browser_context, - DisplayedNotificationsCallback callback) +void PlatformNotificationServiceQt::GetDisplayedNotifications(DisplayedNotificationsCallback callback) { Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); ProfileQt *profile = static_cast<ProfileQt *>(browser_context); @@ -196,7 +190,7 @@ void PlatformNotificationServiceQt::GetDisplayedNotifications( std::move(callback).Run(std::move(movableStdStringSet), true /* supports_synchronization */); } -int64_t PlatformNotificationServiceQt::ReadNextPersistentNotificationId(content::BrowserContext *browser_context) +int64_t PlatformNotificationServiceQt::ReadNextPersistentNotificationId() { Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); auto prefs = static_cast<ProfileQt *>(browser_context)->GetPrefs(); @@ -205,4 +199,15 @@ int64_t PlatformNotificationServiceQt::ReadNextPersistentNotificationId(content: return nextId; } +void PlatformNotificationServiceQt::ScheduleTrigger(base::Time /*timestamp*/) +{ + Q_UNIMPLEMENTED(); +} + +base::Time PlatformNotificationServiceQt::ReadNextTriggerTimestamp() +{ + Q_UNIMPLEMENTED(); + return base::Time::Max(); +} + } // namespace QtWebEngineCore diff --git a/src/core/platform_notification_service_qt.h b/src/core/platform_notification_service_qt.h index 65477dde2..12aa2619b 100644 --- a/src/core/platform_notification_service_qt.h +++ b/src/core/platform_notification_service_qt.h @@ -42,26 +42,28 @@ #include "content/public/browser/platform_notification_service.h" +namespace content { +class BrowserContext; +} + namespace QtWebEngineCore { class PlatformNotificationServiceQt : public content::PlatformNotificationService { public: - PlatformNotificationServiceQt(); + PlatformNotificationServiceQt(content::BrowserContext *browserContext); ~PlatformNotificationServiceQt() override; // Displays the notification described in |notification_data| to the user. A // closure through which the notification can be closed will be stored in the // |cancel_callback| argument. This method must be called on the UI thread. - void DisplayNotification(content::BrowserContext* browser_context, - const std::string& notification_id, + void DisplayNotification(const std::string& notification_id, const GURL& origin, const blink::PlatformNotificationData& notificationData, const blink::NotificationResources& notificationResources) override; // Displays the persistent notification described in |notification_data| to // the user. This method must be called on the UI thread. - void DisplayPersistentNotification(content::BrowserContext* browser_context, - const std::string& notification_id, + void DisplayPersistentNotification(const std::string& notification_id, const GURL& service_worker_origin, const GURL& origin, const blink::PlatformNotificationData& notification_data, @@ -69,22 +71,27 @@ public: // Closes the notification identified by |notification_id|. // This method must be called on the UI thread. - void CloseNotification(content::BrowserContext* browser_context, const std::string& notification_id) override; + void CloseNotification(const std::string& notification_id) override; // Closes the persistent notification identified by |persistent_notification_id|. // This method must be called on the UI thread. - void ClosePersistentNotification(content::BrowserContext* browser_context, const std::string& notification_id) override; + void ClosePersistentNotification(const std::string& notification_id) override; // Retrieves the ids of all currently displaying notifications and // posts |callback| with the result. - void GetDisplayedNotifications(content::BrowserContext* browser_context, DisplayedNotificationsCallback callback) override; + void GetDisplayedNotifications(DisplayedNotificationsCallback callback) override; // Reads the value of the next persistent notification ID from the profile and // increments the value, as it is called once per notification write. - virtual int64_t ReadNextPersistentNotificationId(content::BrowserContext* browser_context) override; + int64_t ReadNextPersistentNotificationId() override; + + void ScheduleTrigger(base::Time timestamp) override; + base::Time ReadNextTriggerTimestamp() override; // Records a given notification to UKM. - virtual void RecordNotificationUkmEvent(content::BrowserContext*, const content::NotificationDatabaseData&) override { } + void RecordNotificationUkmEvent(const content::NotificationDatabaseData&) override { } + + content::BrowserContext *browser_context; }; } // namespace QtWebEngineCore diff --git a/src/core/pref_service_adapter.cpp b/src/core/pref_service_adapter.cpp index 4014f22bd..0cf53dda5 100644 --- a/src/core/pref_service_adapter.cpp +++ b/src/core/pref_service_adapter.cpp @@ -100,6 +100,7 @@ void PrefServiceAdapter::setup(const ProfileAdapter &profileAdapter) registry->RegisterStringPref(prefs::kAcceptLanguages, std::string()); registry->RegisterListPref(spellcheck::prefs::kSpellCheckDictionaries); registry->RegisterListPref(spellcheck::prefs::kSpellCheckForcedDictionaries); + registry->RegisterListPref(spellcheck::prefs::kSpellCheckBlacklistedDictionaries); registry->RegisterStringPref(spellcheck::prefs::kSpellCheckDictionary, std::string()); registry->RegisterBooleanPref(spellcheck::prefs::kSpellCheckEnable, false); registry->RegisterBooleanPref(spellcheck::prefs::kSpellCheckUseSpellingService, false); @@ -112,7 +113,7 @@ void PrefServiceAdapter::setup(const ProfileAdapter &profileAdapter) registry->RegisterListPref(extensions::pref_names::kInstallAllowList); registry->RegisterListPref(extensions::pref_names::kInstallDenyList); registry->RegisterDictionaryPref(extensions::pref_names::kInstallForceList); - registry->RegisterDictionaryPref(extensions::pref_names::kInstallLoginScreenAppList); + registry->RegisterDictionaryPref(extensions::pref_names::kLoginScreenExtensions); registry->RegisterListPref(extensions::pref_names::kAllowedTypes); registry->RegisterBooleanPref(extensions::pref_names::kStorageGarbageCollect, false); registry->RegisterListPref(extensions::pref_names::kAllowedInstallSites); @@ -120,6 +121,7 @@ void PrefServiceAdapter::setup(const ProfileAdapter &profileAdapter) registry->RegisterListPref(extensions::pref_names::kNativeMessagingBlacklist); registry->RegisterListPref(extensions::pref_names::kNativeMessagingWhitelist); registry->RegisterBooleanPref(extensions::pref_names::kNativeMessagingUserLevelHosts, true); + registry->RegisterBooleanPref(extensions::pref_names::kInsecureExtensionUpdatesEnabled, false); #endif // BUILDFLAG(ENABLE_EXTENSIONS) // Media device salt id key diff --git a/src/core/profile_adapter.cpp b/src/core/profile_adapter.cpp index 1e65ada6f..fdbdbfdcb 100644 --- a/src/core/profile_adapter.cpp +++ b/src/core/profile_adapter.cpp @@ -315,16 +315,6 @@ QString ProfileAdapter::cookiesPath() const return QString(); } -QString ProfileAdapter::channelIdPath() const -{ - if (m_offTheRecord) - return QString(); - QString basePath = dataPath(); - if (!basePath.isEmpty()) - return basePath % QLatin1String("/Origin Bound Certs"); - return QString(); -} - QString ProfileAdapter::httpCachePath() const { if (m_offTheRecord) diff --git a/src/core/profile_adapter.h b/src/core/profile_adapter.h index 8df85a68f..01477d0d9 100644 --- a/src/core/profile_adapter.h +++ b/src/core/profile_adapter.h @@ -124,7 +124,6 @@ public: QString httpCachePath() const; QString cookiesPath() const; - QString channelIdPath() const; QString httpUserAgent() const; void setHttpUserAgent(const QString &userAgent); diff --git a/src/core/profile_io_data_qt.cpp b/src/core/profile_io_data_qt.cpp index 3a39dd101..9a5058a5a 100644 --- a/src/core/profile_io_data_qt.cpp +++ b/src/core/profile_io_data_qt.cpp @@ -55,7 +55,7 @@ #include "net/cert/ct_log_verifier.h" #include "net/cert/ct_policy_enforcer.h" #include "net/cert/multi_log_ct_verifier.h" -#include "net/extras/sqlite/sqlite_channel_id_store.h" +#include "net/dns/host_resolver_manager.h" #include "net/http/http_auth_handler_factory.h" #include "net/http/http_auth_scheme.h" #include "net/http/http_auth_preferences.h" @@ -68,6 +68,7 @@ #include "net/proxy_resolution/proxy_config_service.h" #include "net/proxy_resolution/proxy_resolution_service.h" #include "net/ssl/channel_id_service.h" +#include "net/ssl/default_channel_id_store.h" #include "net/ssl/ssl_config_service_defaults.h" #include "net/url_request/data_protocol_handler.h" #include "net/url_request/file_protocol_handler.h" @@ -106,8 +107,6 @@ static bool doNetworkSessionParamsMatch(const net::HttpNetworkSession::Params &f { if (first.ignore_certificate_errors != second.ignore_certificate_errors) return false; - if (first.enable_channel_id != second.enable_channel_id) - return false; return true; } @@ -118,14 +117,14 @@ static bool doNetworkSessionContextMatch(const net::HttpNetworkSession::Context return false; if (first.cert_verifier != second.cert_verifier) return false; - if (first.channel_id_service != second.channel_id_service) - return false; if (first.proxy_resolution_service != second.proxy_resolution_service) return false; if (first.ssl_config_service != second.ssl_config_service) return false; if (first.http_auth_handler_factory != second.http_auth_handler_factory) return false; + if (first.http_user_agent_settings != second.http_user_agent_settings) + return false; if (first.http_server_properties != second.http_server_properties) return false; if (first.host_resolver != second.host_resolver) @@ -142,10 +141,10 @@ static net::HttpNetworkSession::Context generateNetworkSessionContext(net::URLRe net::HttpNetworkSession::Context network_session_context; network_session_context.transport_security_state = urlRequestContext->transport_security_state(); network_session_context.cert_verifier = urlRequestContext->cert_verifier(); - network_session_context.channel_id_service = urlRequestContext->channel_id_service(); network_session_context.proxy_resolution_service = urlRequestContext->proxy_resolution_service(); network_session_context.ssl_config_service = urlRequestContext->ssl_config_service(); network_session_context.http_auth_handler_factory = urlRequestContext->http_auth_handler_factory(); + network_session_context.http_user_agent_settings = urlRequestContext->http_user_agent_settings(); network_session_context.http_server_properties = urlRequestContext->http_server_properties(); network_session_context.host_resolver = urlRequestContext->host_resolver(); network_session_context.cert_transparency_verifier = urlRequestContext->cert_transparency_verifier(); @@ -296,6 +295,7 @@ void ProfileIODataQt::generateStorage() { Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); Q_ASSERT(m_urlRequestContext); +// Q_ASSERT(!m_mutex.tryLock()); // assert locked // We must stop all requests before deleting their backends. if (m_storage) { @@ -337,7 +337,11 @@ void ProfileIODataQt::generateStorage() ct_verifier->AddLogs(ct_logs); m_storage->set_cert_transparency_verifier(std::move(ct_verifier)); m_storage->set_ct_policy_enforcer(base::WrapUnique(new net::DefaultCTPolicyEnforcer())); - m_storage->set_host_resolver(net::HostResolver::CreateDefaultResolver(NULL)); +// static std::unique_ptr<net::HostResolverManager> s_hostResolverManager = +// std::make_unique<net::HostResolverManager>(net::HostResolver::Options(), nullptr); +// m_storage->set_host_resolver(net::HostResolver::CreateResolver(s_hostResolverManager.get())); + m_storage->set_host_resolver(net::HostResolver::CreateStandaloneResolver(nullptr)); + m_storage->set_ssl_config_service(std::make_unique<net::SSLConfigServiceDefaults>()); if (!m_httpAuthPreferences) { m_httpAuthPreferences.reset(new net::HttpAuthPreferences()); @@ -388,17 +392,9 @@ void ProfileIODataQt::generateCookieStore() QMutexLocker lock(&m_mutex); - scoped_refptr<net::SQLiteChannelIDStore> channel_id_db; - if (!m_channelIdPath.isEmpty() && m_persistentCookiesPolicy != ProfileAdapter::NoPersistentCookies) { - channel_id_db = new net::SQLiteChannelIDStore( - toFilePath(m_channelIdPath), - base::CreateSequencedTaskRunnerWithTraits( - {base::MayBlock(), base::TaskPriority::BEST_EFFORT})); - } - + // FIXME: Add code to remove the old database. m_storage->set_channel_id_service( - base::WrapUnique(new net::ChannelIDService( - new net::DefaultChannelIDStore(channel_id_db.get())))); + std::make_unique<net::ChannelIDService>(new net::DefaultChannelIDStore(nullptr))); std::unique_ptr<net::CookieStore> cookieStore; switch (m_persistentCookiesPolicy) { @@ -438,7 +434,7 @@ void ProfileIODataQt::generateCookieStore() const std::vector<std::string> cookieableSchemes(kCookieableSchemes, kCookieableSchemes + base::size(kCookieableSchemes)); - cookieMonster->SetCookieableSchemes(cookieableSchemes); + cookieMonster->SetCookieableSchemes(cookieableSchemes, base::DoNothing()); } void ProfileIODataQt::generateUserAgent() @@ -615,7 +611,6 @@ void ProfileIODataQt::setFullConfiguration() m_requestInterceptor = m_profileAdapter->requestInterceptor(); m_persistentCookiesPolicy = m_profileAdapter->persistentCookiesPolicy(); m_cookiesPath = m_profileAdapter->cookiesPath(); - m_channelIdPath = m_profileAdapter->channelIdPath(); m_httpAcceptLanguage = m_profileAdapter->httpAcceptLanguage(); m_httpUserAgent = m_profileAdapter->httpUserAgent(); m_httpCacheType = m_profileAdapter->httpCacheType(); @@ -680,7 +675,6 @@ void ProfileIODataQt::updateCookieStore() QMutexLocker lock(&m_mutex); m_persistentCookiesPolicy = m_profileAdapter->persistentCookiesPolicy(); m_cookiesPath = m_profileAdapter->cookiesPath(); - m_channelIdPath = m_profileAdapter->channelIdPath(); if (!m_pendingStorageRequestGeneration) requestStorageGeneration(); } diff --git a/src/core/profile_io_data_qt.h b/src/core/profile_io_data_qt.h index c9e73f778..f2dc67f44 100644 --- a/src/core/profile_io_data_qt.h +++ b/src/core/profile_io_data_qt.h @@ -170,7 +170,6 @@ private: ClientCertificateStoreData *m_clientCertificateStoreData; #endif QString m_cookiesPath; - QString m_channelIdPath; QString m_httpAcceptLanguage; QString m_httpUserAgent; ProfileAdapter::HttpCacheType m_httpCacheType; diff --git a/src/core/profile_qt.cpp b/src/core/profile_qt.cpp index 25b2169dd..19d54df62 100644 --- a/src/core/profile_qt.cpp +++ b/src/core/profile_qt.cpp @@ -46,6 +46,7 @@ #include "net/ssl_host_state_delegate_qt.h" #include "net/url_request_context_getter_qt.h" #include "permission_manager_qt.h" +#include "platform_notification_service_qt.h" #include "qtwebenginecoreglobal_p.h" #include "type_conversion.h" #include "web_engine_library_info.h" @@ -318,4 +319,11 @@ const PrefServiceAdapter &ProfileQt::prefServiceAdapter() const } +content::PlatformNotificationService *ProfileQt::platformNotificationService() +{ + if (!m_platformNotificationService) + m_platformNotificationService = std::make_unique<PlatformNotificationServiceQt>(this); + return m_platformNotificationService.get(); +} + } // namespace QtWebEngineCore diff --git a/src/core/profile_qt.h b/src/core/profile_qt.h index 76749fdfe..b6ff0a0db 100644 --- a/src/core/profile_qt.h +++ b/src/core/profile_qt.h @@ -118,6 +118,8 @@ public: ProfileAdapter *profileAdapter() { return m_profileAdapter; } + content::PlatformNotificationService *platformNotificationService(); + #if QT_CONFIG(webengine_spellchecker) void FailedToLoadDictionary(const std::string &language) override; #endif @@ -142,6 +144,7 @@ private: std::unique_ptr<SSLHostStateDelegateQt> m_sslHostStateDelegate; scoped_refptr<content::SharedCorsOriginAccessList> m_sharedCorsOriginAccessList; std::unique_ptr<ProfileIODataQt> m_profileIOData; + std::unique_ptr<content::PlatformNotificationService> m_platformNotificationService; ProfileAdapter *m_profileAdapter; PrefServiceAdapter m_prefServiceAdapter; diff --git a/src/core/qtwebengine.gni b/src/core/qtwebengine.gni index 11a72a2e9..d9e01a5b8 100644 --- a/src/core/qtwebengine.gni +++ b/src/core/qtwebengine.gni @@ -29,6 +29,7 @@ deps = [ "//components/web_cache/renderer", "//components/spellcheck:buildflags", "//components/proxy_config", + "//components/user_prefs", "//content/public/app:browser", "//content", "//media:media_buildflags", diff --git a/src/core/qtwebengine_sources.gni b/src/core/qtwebengine_sources.gni index 777309e21..8441ca095 100644 --- a/src/core/qtwebengine_sources.gni +++ b/src/core/qtwebengine_sources.gni @@ -84,13 +84,12 @@ source_set("qtwebengine_sources") { "//chrome/common/url_constants.h", "//chrome/common/webui_url_constants.cc", "//chrome/common/webui_url_constants.h", - "//components/prefs/in_memory_pref_store.cc", - "//components/prefs/in_memory_pref_store.h", ] if (enable_extensions) { deps += [ ":qtwebengine_extensions_features", + "//chrome/app:generated_resources", "//chrome/browser/resources:component_extension_resources_grit", "//chrome/common/extensions/api", "//chrome/common/extensions/api:extensions_features", diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index 7fd8cc3d0..a5ae0a04a 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -357,7 +357,7 @@ void RenderWidgetHostViewQt::SetBounds(const gfx::Rect &windowRectInDips) m_delegate->resize(windowRectInDips.width(), windowRectInDips.height()); } -gfx::NativeView RenderWidgetHostViewQt::GetNativeView() const +gfx::NativeView RenderWidgetHostViewQt::GetNativeView() { // gfx::NativeView is a typedef to a platform specific view // pointer (HWND, NSView*, GtkWidget*) and other ports use @@ -394,12 +394,12 @@ void RenderWidgetHostViewQt::Focus() host()->Focus(); } -bool RenderWidgetHostViewQt::HasFocus() const +bool RenderWidgetHostViewQt::HasFocus() { return m_delegate->hasKeyboardFocus(); } -bool RenderWidgetHostViewQt::IsSurfaceAvailableForCopy() const +bool RenderWidgetHostViewQt::IsSurfaceAvailableForCopy() { return true; } @@ -431,7 +431,7 @@ bool RenderWidgetHostViewQt::IsShowing() } // Retrieve the bounds of the View, in screen coordinates. -gfx::Rect RenderWidgetHostViewQt::GetViewBounds() const +gfx::Rect RenderWidgetHostViewQt::GetViewBounds() { return m_viewRectInDips; } @@ -468,8 +468,7 @@ void RenderWidgetHostViewQt::UpdateCursor(const content::WebCursor &webCursor) void RenderWidgetHostViewQt::DisplayCursor(const content::WebCursor &webCursor) { - content::CursorInfo cursorInfo; - webCursor.GetCursorInfo(&cursorInfo); + const content::CursorInfo &cursorInfo = webCursor.info(); Qt::CursorShape shape = Qt::ArrowCursor; #if defined(USE_AURA) ui::CursorType auraType = ui::CursorType::kNull; @@ -694,7 +693,7 @@ void RenderWidgetHostViewQt::SubmitCompositorFrame(const viz::LocalSurfaceId &lo m_adapterClient->updateContentsSize(toQt(m_lastContentsSize)); } -void RenderWidgetHostViewQt::GetScreenInfo(content::ScreenInfo *results) const +void RenderWidgetHostViewQt::GetScreenInfo(content::ScreenInfo *results) { *results = m_screenInfo; } diff --git a/src/core/render_widget_host_view_qt.h b/src/core/render_widget_host_view_qt.h index 7c1a0e2cd..91d5b8610 100644 --- a/src/core/render_widget_host_view_qt.h +++ b/src/core/render_widget_host_view_qt.h @@ -125,18 +125,18 @@ public: void InitAsFullscreen(content::RenderWidgetHostView*) override; void SetSize(const gfx::Size& size) override; void SetBounds(const gfx::Rect&) override; - gfx::NativeView GetNativeView() const override; + gfx::NativeView GetNativeView() override; gfx::NativeViewAccessible GetNativeViewAccessible() override; void Focus() override; - bool HasFocus() const override; - bool IsSurfaceAvailableForCopy() const override; + bool HasFocus() override; + bool IsSurfaceAvailableForCopy() override; void CopyFromSurface(const gfx::Rect &src_rect, const gfx::Size &output_size, base::OnceCallback<void(const SkBitmap &)> callback) override; void Show() override; void Hide() override; bool IsShowing() override; - gfx::Rect GetViewBounds() const override; + gfx::Rect GetViewBounds() override; void UpdateBackgroundColor() override; bool LockMouse() override; void UnlockMouse() override; @@ -156,7 +156,7 @@ public: viz::ScopedSurfaceIdAllocator DidUpdateVisualProperties(const cc::RenderFrameMetadata &metadata) override; void OnDidUpdateVisualPropertiesComplete(const cc::RenderFrameMetadata &metadata); - void GetScreenInfo(content::ScreenInfo* results) const override; + void GetScreenInfo(content::ScreenInfo *results) override; gfx::Rect GetBoundsInRootWindow() override; void ProcessAckedTouchEvent(const content::TouchEventWithLatencyInfo &touch, content::InputEventAckState ack_result) override; void ClearCompositorFrame() override; diff --git a/src/core/renderer/content_renderer_client_qt.cpp b/src/core/renderer/content_renderer_client_qt.cpp index 5fd4c7d65..092e6845d 100644 --- a/src/core/renderer/content_renderer_client_qt.cpp +++ b/src/core/renderer/content_renderer_client_qt.cpp @@ -280,33 +280,33 @@ void ContentRendererClientQt::GetNavigationErrorStringsInternal(content::RenderF if (errorHtml) { // Use a local error page. int resourceId; - base::DictionaryValue errorStrings; const std::string locale = content::RenderThread::Get()->GetLocale(); // TODO(elproxy): We could potentially get better diagnostics here by first calling // NetErrorHelper::GetErrorStringsForDnsProbe, but that one is harder to untangle. - error_page::LocalizedError::GetStrings( - error.reason(), error.domain(), error.url(), isPost, - error.stale_copy_in_cache(), false, RenderThreadObserverQt::is_incognito_process(), - error_page::LocalizedError::OfflineContentOnNetErrorFeatureState::kDisabled, - false, locale, std::unique_ptr<error_page::ErrorPageParams>(), &errorStrings); + error_page::LocalizedError::PageState errorPageState = + error_page::LocalizedError::GetPageState( + error.reason(), error.domain(), error.url(), isPost, + error.stale_copy_in_cache(), false, RenderThreadObserverQt::is_incognito_process(), false, + false, locale, std::unique_ptr<error_page::ErrorPageParams>()); + resourceId = IDR_NET_ERROR_HTML; const base::StringPiece template_html(ui::ResourceBundle::GetSharedInstance().GetRawDataResource(resourceId)); if (template_html.empty()) NOTREACHED() << "unable to load template. ID: " << resourceId; else // "t" is the id of the templates root node. - *errorHtml = webui::GetTemplatesHtml(template_html, &errorStrings, "t"); + *errorHtml = webui::GetTemplatesHtml(template_html, &errorPageState.strings, "t"); } } -unsigned long long ContentRendererClientQt::VisitedLinkHash(const char *canonicalUrl, size_t length) +uint64_t ContentRendererClientQt::VisitedLinkHash(const char *canonicalUrl, size_t length) { return m_visitedLinkSlave->ComputeURLFingerprint(canonicalUrl, length); } -bool ContentRendererClientQt::IsLinkVisited(unsigned long long linkHash) +bool ContentRendererClientQt::IsLinkVisited(uint64_t linkHash) { return m_visitedLinkSlave->IsVisited(linkHash); } diff --git a/src/core/renderer/content_renderer_client_qt.h b/src/core/renderer/content_renderer_client_qt.h index dd164fa3a..a13d16b5c 100644 --- a/src/core/renderer/content_renderer_client_qt.h +++ b/src/core/renderer/content_renderer_client_qt.h @@ -101,8 +101,8 @@ public: int http_status, std::string *error_html) override; - unsigned long long VisitedLinkHash(const char *canonicalUrl, size_t length) override; - bool IsLinkVisited(unsigned long long linkHash) override; + uint64_t VisitedLinkHash(const char *canonical_url, size_t length) override; + bool IsLinkVisited(uint64_t linkHash) override; blink::WebPrescientNetworking* GetPrescientNetworking() override; void AddSupportedKeySystems(std::vector<std::unique_ptr<media::KeySystemProperties>>* key_systems) override; diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index 6ea07b4e7..2295d33c0 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -213,10 +213,10 @@ static QVariant fromJSValue(const base::Value *result) return ret; } -static void callbackOnEvaluateJS(WebContentsAdapterClient *adapterClient, quint64 requestId, const base::Value *result) +static void callbackOnEvaluateJS(WebContentsAdapterClient *adapterClient, quint64 requestId, base::Value result) { if (requestId) - adapterClient->didRunJavaScript(requestId, fromJSValue(result)); + adapterClient->didRunJavaScript(requestId, fromJSValue(&result)); } #if QT_CONFIG(webengine_printing_and_pdf) @@ -560,6 +560,12 @@ bool WebContentsAdapter::canGoForward() const return m_webContents->GetController().CanGoForward(); } +bool WebContentsAdapter::canGoToOffset(int offset) const +{ + CHECK_INITIALIZED(false); + return m_webContents->GetController().CanGoToOffset(offset); +} + void WebContentsAdapter::stop() { CHECK_INITIALIZED(); @@ -845,6 +851,26 @@ void WebContentsAdapter::unselect() m_webContents->CollapseSelection(); } +void WebContentsAdapter::navigateBack() +{ + CHECK_INITIALIZED(); + CHECK_VALID_RENDER_WIDGET_HOST_VIEW(m_webContents->GetRenderViewHost()); + if (!m_webContents->GetController().CanGoBack()) + return; + m_webContents->GetController().GoBack(); + focusIfNecessary(); +} + +void WebContentsAdapter::navigateForward() +{ + CHECK_INITIALIZED(); + CHECK_VALID_RENDER_WIDGET_HOST_VIEW(m_webContents->GetRenderViewHost()); + if (!m_webContents->GetController().CanGoForward()) + return; + m_webContents->GetController().GoForward(); + focusIfNecessary(); +} + void WebContentsAdapter::navigateToIndex(int offset) { CHECK_INITIALIZED(); @@ -978,13 +1004,14 @@ void WebContentsAdapter::runJavaScript(const QString &javaScript, quint32 worldI CHECK_INITIALIZED(); content::RenderViewHost *rvh = m_webContents->GetRenderViewHost(); Q_ASSERT(rvh); +// static_cast<content::RenderFrameHostImpl *>(rvh->GetMainFrame())->NotifyUserActivation(); if (worldId == 0) { - rvh->GetMainFrame()->ExecuteJavaScript(toString16(javaScript)); + rvh->GetMainFrame()->ExecuteJavaScript(toString16(javaScript), base::NullCallback()); return; } - content::RenderFrameHost::JavaScriptResultCallback callback = base::Bind(&callbackOnEvaluateJS, m_adapterClient, CallbackDirectory::NoCallbackId); - rvh->GetMainFrame()->ExecuteJavaScriptInIsolatedWorld(toString16(javaScript), callback, worldId); + content::RenderFrameHost::JavaScriptResultCallback callback = base::BindOnce(&callbackOnEvaluateJS, m_adapterClient, CallbackDirectory::NoCallbackId); + rvh->GetMainFrame()->ExecuteJavaScriptInIsolatedWorld(toString16(javaScript), std::move(callback), worldId); } quint64 WebContentsAdapter::runJavaScriptCallbackResult(const QString &javaScript, quint32 worldId) @@ -992,11 +1019,12 @@ quint64 WebContentsAdapter::runJavaScriptCallbackResult(const QString &javaScrip CHECK_INITIALIZED(0); content::RenderViewHost *rvh = m_webContents->GetRenderViewHost(); Q_ASSERT(rvh); - content::RenderFrameHost::JavaScriptResultCallback callback = base::Bind(&callbackOnEvaluateJS, m_adapterClient, m_nextRequestId); +// static_cast<content::RenderFrameHostImpl *>(rvh->GetMainFrame())->NotifyUserActivation(); + content::RenderFrameHost::JavaScriptResultCallback callback = base::BindOnce(&callbackOnEvaluateJS, m_adapterClient, m_nextRequestId); if (worldId == 0) - rvh->GetMainFrame()->ExecuteJavaScript(toString16(javaScript), callback); + rvh->GetMainFrame()->ExecuteJavaScript(toString16(javaScript), std::move(callback)); else - rvh->GetMainFrame()->ExecuteJavaScriptInIsolatedWorld(toString16(javaScript), callback, worldId); + rvh->GetMainFrame()->ExecuteJavaScriptInIsolatedWorld(toString16(javaScript), std::move(callback), worldId); return m_nextRequestId++; } @@ -1596,11 +1624,10 @@ void WebContentsAdapter::waitForUpdateDragActionCalled() const qint64 timeout = 3000; QElapsedTimer t; t.start(); - auto backend = static_cast<base::sequence_manager::internal::SequenceManagerImpl *>( - base::MessageLoopCurrent::Get().ToMessageLoopBaseDeprecated()); + auto seqMan = base::MessageLoopCurrent::GetCurrentSequenceManagerImpl(); base::MessagePump::Delegate *delegate = static_cast<base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl *>( - backend->controller_.get()); + seqMan->controller_.get()); DCHECK(delegate); m_updateDragActionCalled = false; diff --git a/src/core/web_contents_adapter.h b/src/core/web_contents_adapter.h index f90634dd5..baf9d241c 100644 --- a/src/core/web_contents_adapter.h +++ b/src/core/web_contents_adapter.h @@ -119,6 +119,7 @@ public: bool canGoBack() const; bool canGoForward() const; + bool canGoToOffset(int) const; void stop(); void reload(); void reloadAndBypassCache(); @@ -138,6 +139,8 @@ public: void selectAll(); void unselect(); + void navigateBack(); + void navigateForward(); void navigateToIndex(int); void navigateToOffset(int); int navigationEntryCount(); diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp index 11276f3a5..93f441636 100644 --- a/src/core/web_contents_delegate_qt.cpp +++ b/src/core/web_contents_delegate_qt.cpp @@ -851,6 +851,7 @@ int &WebContentsDelegateQt::streamCount(blink::MediaStreamType type) case blink::MEDIA_GUM_DESKTOP_VIDEO_CAPTURE: case blink::MEDIA_GUM_DESKTOP_AUDIO_CAPTURE: case blink::MEDIA_DISPLAY_VIDEO_CAPTURE: + case blink::MEDIA_DISPLAY_AUDIO_CAPTURE: return m_desktopStreamCount; case blink::MEDIA_NO_SERVICE: diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index 1b82b6174..a988040ee 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -74,6 +74,7 @@ #include "gpu/command_buffer/service/sync_point_manager.h" #include "gpu/ipc/host/gpu_switches.h" #include "media/audio/audio_manager.h" +#include "media/base/media_switches.h" #include "mojo/core/embedder/embedder.h" #include "net/base/port_util.h" #include "ppapi/buildflags/buildflags.h" @@ -81,6 +82,7 @@ #include "services/network/public/cpp/network_switches.h" #include "services/resource_coordinator/public/cpp/resource_coordinator_features.h" #include "services/service_manager/sandbox/switches.h" +#include "third_party/blink/public/common/features.h" #include "ui/events/event_switches.h" #include "ui/native_theme/native_theme_features.h" #include "ui/gl/gl_switches.h" @@ -388,7 +390,7 @@ WebEngineContext::WebEngineContext() : m_mainDelegate(new ContentMainDelegateQt) , m_globalQObject(new QObject()) { - base::TaskScheduler::Create("Browser"); + base::ThreadPool::Create("Browser"); m_contentRunner.reset(content::ContentMainRunner::Create()); m_browserRunner = content::BrowserMainRunner::Create(); @@ -501,21 +503,29 @@ WebEngineContext::WebEngineContext() appendToFeatureList(disableFeatures, features::kMojoVideoCapture.name); // Breaks WebEngineNewViewRequest.userInitiated API (since 73) appendToFeatureList(disableFeatures, features::kUserActivationV2.name); - appendToFeatureList(disableFeatures, features::kWebAuth.name); - - appendToFeatureList(disableFeatures, features::kBackgroundFetch.name); + // We do not yet support the network-service, but it is enabled by default since 75. appendToFeatureList(disableFeatures, network::features::kNetworkService.name); + // VideoSurfaceLayer is enabled by default since 75. We don't support it. + appendToFeatureList(disableFeatures, media::kUseSurfaceLayerForVideo.name); + // BlinkGenPropertyTrees is enabled by default in 75, but causes regressions. + appendToFeatureList(disableFeatures, blink::features::kBlinkGenPropertyTrees.name); #if QT_CONFIG(webengine_printing_and_pdf) appendToFeatureList(disableFeatures, printing::features::kUsePdfCompositorServiceForPrint.name); #endif + // Explicitly tell Chromium about default-on features we do not support + appendToFeatureList(disableFeatures, features::kBackgroundFetch.name); + appendToFeatureList(disableFeatures, features::kOriginTrials.name); + appendToFeatureList(disableFeatures, features::kWebAuth.name); + appendToFeatureList(disableFeatures, features::kWebAuthCable.name); + appendToFeatureList(disableFeatures, features::kWebPayments.name); + appendToFeatureList(disableFeatures, features::kWebUsb.name); + if (useEmbeddedSwitches) { // embedded switches are based on the switches for Android, see content/browser/android/content_startup_flags.cc appendToFeatureList(enableFeatures, features::kOverlayScrollbar.name); - if (!parsedCommandLine->HasSwitch(switches::kDisablePinch)) - parsedCommandLine->AppendSwitch(switches::kEnablePinch); parsedCommandLine->AppendSwitch(switches::kEnableViewport); parsedCommandLine->AppendSwitch(switches::kMainFrameResizesAreOrientationChanges); parsedCommandLine->AppendSwitch(cc::switches::kDisableCompositedAntialiasing); @@ -632,7 +642,7 @@ WebEngineContext::WebEngineContext() base::MessageLoop::InitMessagePumpForUIFactory(messagePumpFactory); content::BrowserTaskExecutor::Create(); m_mainDelegate->PostEarlyInitialization(false); - content::StartBrowserTaskScheduler(); + content::StartBrowserThreadPool(); content::BrowserTaskExecutor::PostFeatureListSetup(); // Once the MessageLoop has been created, attach a top-level RunLoop. diff --git a/src/core/web_event_factory.cpp b/src/core/web_event_factory.cpp index 3a9c1eb65..1b0723cb5 100644 --- a/src/core/web_event_factory.cpp +++ b/src/core/web_event_factory.cpp @@ -1428,7 +1428,7 @@ WebGestureEvent WebEventFactory::toWebGestureEvent(QNativeGestureEvent *ev) webKitEvent.SetPositionInScreen(WebFloatPoint(ev->screenPos().x(), ev->screenPos().y())); - webKitEvent.SetSourceDevice(blink::kWebGestureDeviceTouchpad); + webKitEvent.SetSourceDevice(blink::WebGestureDevice::kTouchpad); Qt::NativeGestureType gestureType = ev->gestureType(); switch (gestureType) { |