diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/web_contents_adapter.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index c7c20c23e..5625695fc 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -638,18 +638,19 @@ void WebContentsAdapter::load(const QWebEngineHttpRequest &request) } } - auto navigate = [this, loadParams = std::move(params)]() { - webContents()->GetController().LoadURLWithParams(loadParams); + auto navigate = [](WebContentsAdapter *adapter, const content::NavigationController::LoadURLParams ¶ms) { + adapter->webContents()->GetController().LoadURLWithParams(params); // Follow chrome::Navigate and invalidate the URL immediately. - m_webContentsDelegate->NavigationStateChanged(webContents(), content::INVALIDATE_TYPE_URL); - focusIfNecessary(); + adapter->m_webContentsDelegate->NavigationStateChanged(adapter->webContents(), content::INVALIDATE_TYPE_URL); + adapter->focusIfNecessary(); }; if (resizeNeeded) { // Schedule navigation on the event loop. - QTimer::singleShot(0, std::move(navigate)); + content::BrowserThread::PostTask( + content::BrowserThread::UI, FROM_HERE, base::BindOnce(navigate, this, std::move(params))); } else { - navigate(); + navigate(this, params); } } |