diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-22 14:18:16 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-01-13 16:11:59 +0100 |
commit | 7869ec5823da36a3ce33b379d3d664204756cad5 (patch) | |
tree | 45b692a4ed986b0a8932f2f6a183ed9408439e33 /src/core/web_contents_adapter.cpp | |
parent | ffb13e6927ae14a7185bb45ee0dfd03973e5ebb0 (diff) |
Adaptations for Chromium 86
Change-Id: I7e0ebecdbb68cfff0b574c966f3fa80d28680e1c
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Diffstat (limited to 'src/core/web_contents_adapter.cpp')
-rw-r--r-- | src/core/web_contents_adapter.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index 44c4b5f37..df98337a1 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -62,6 +62,7 @@ #include "base/command_line.h" #include "base/run_loop.h" +#include "base/task/current_thread.h" #include "base/task/post_task.h" #include "base/task/sequence_manager/sequence_manager_impl.h" #include "base/task/sequence_manager/thread_controller_with_message_pump_impl.h" @@ -1057,13 +1058,10 @@ void WebContentsAdapter::runJavaScript(const QString &javaScript, quint32 worldI content::RenderViewHost *rvh = m_webContents->GetRenderViewHost(); Q_ASSERT(rvh); // static_cast<content::RenderFrameHostImpl *>(rvh->GetMainFrame())->NotifyUserActivation(); - if (worldId == 0) { + if (worldId == 0) rvh->GetMainFrame()->ExecuteJavaScript(toString16(javaScript), base::NullCallback()); - return; - } - - content::RenderFrameHost::JavaScriptResultCallback callback = base::BindOnce(&callbackOnEvaluateJS, m_adapterClient, CallbackDirectory::NoCallbackId); - rvh->GetMainFrame()->ExecuteJavaScriptInIsolatedWorld(toString16(javaScript), std::move(callback), worldId); + else + rvh->GetMainFrame()->ExecuteJavaScriptInIsolatedWorld(toString16(javaScript), base::NullCallback(), worldId); } quint64 WebContentsAdapter::runJavaScriptCallbackResult(const QString &javaScript, quint32 worldId) @@ -1094,10 +1092,10 @@ quint64 WebContentsAdapter::fetchDocumentInnerText() return m_nextRequestId++; } -void WebContentsAdapter::updateWebPreferences(const content::WebPreferences & webPreferences) +void WebContentsAdapter::updateWebPreferences(const content::WebPreferences &webPreferences) { CHECK_INITIALIZED(); - m_webContents->GetRenderViewHost()->UpdateWebkitPreferences(webPreferences); + m_webContents->SetWebPreferences(webPreferences); // In case of updating preferences during navigation, there might be a pending RVH what will // be active on successful navigation. @@ -1105,7 +1103,7 @@ void WebContentsAdapter::updateWebPreferences(const content::WebPreferences & we if (pendingRFH) { content::RenderViewHost *pendingRVH = pendingRFH->GetRenderViewHost(); Q_ASSERT(pendingRVH); - pendingRVH->UpdateWebkitPreferences(webPreferences); + static_cast<content::RenderViewHostImpl*>(pendingRVH)->SendWebPreferencesToRenderer(); } } @@ -1528,7 +1526,7 @@ void WebContentsAdapter::startDragging(QObject *dragSource, const content::DropD } { - base::MessageLoopCurrent::ScopedNestableTaskAllower allow; + base::CurrentThread::ScopedNestableTaskAllower allow; drag->exec(allowedActions); } @@ -1672,7 +1670,7 @@ void WebContentsAdapter::waitForUpdateDragActionCalled() const qint64 timeout = 3000; QElapsedTimer t; t.start(); - auto seqMan = base::MessageLoopCurrent::GetCurrentSequenceManagerImpl(); + auto seqMan = base::CurrentThread::GetCurrentSequenceManagerImpl(); base::MessagePump::Delegate *delegate = static_cast<base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl *>( seqMan->controller_.get()); @@ -2055,6 +2053,6 @@ ASSERT_ENUMS_MATCH(ReferrerPolicy::OriginWhenCrossOrigin, network::mojom::Referr //ASSERT_ENUMS_MATCH(ReferrerPolicy::NoReferrerWhenDowngradeOriginWhenCrossOrigin, network::mojom::ReferrerPolicy::kNoReferrerWhenDowngradeOriginWhenCrossOrigin) ASSERT_ENUMS_MATCH(ReferrerPolicy::SameOrigin, network::mojom::ReferrerPolicy::kSameOrigin) ASSERT_ENUMS_MATCH(ReferrerPolicy::StrictOrigin, network::mojom::ReferrerPolicy::kStrictOrigin) -ASSERT_ENUMS_MATCH(ReferrerPolicy::Last, network::mojom::ReferrerPolicy::kLast) +ASSERT_ENUMS_MATCH(ReferrerPolicy::Last, network::mojom::ReferrerPolicy::kMaxValue) } // namespace QtWebEngineCore |