summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_delegate_qt.h
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2019-12-18 20:31:13 +0100
committerMichal Klocek <michal.klocek@qt.io>2020-01-14 19:42:04 +0100
commit445235bc012fcdc73acc881f865a21769c46a6d3 (patch)
tree931ad5942ed3a5a11939cbd8c3d238657bdf2177 /src/core/web_contents_delegate_qt.h
parentd2f6a5c7b97d61c4e983243d444dd51592a44bab (diff)
Rework url changed logic
Due security changes to prevent url spoofing, our implementation is getting extra invalidate url requests. Unfortunately, this breaks our url handling, which now gets lots of new back and fort url changed signals and make several unit test failures. After tedious investigation of Chromium omnibox handing and trying out different approaches, it seems that only sensible solution is to follow Chromium logic and make NavigationStateChanged to update 'ui' in asynchronous matter. This change tries not break any tests and simplify url handling. The only side effect of this change is that WebEnginePage::setContent will get extra 'url' signal of initial 'urlData' and later 'baseUrl' change is emitted. Fix one of qml tests which did not expect to have url on LoadStartedStatus. Task-number: QTBUG-63388 Task-number: QTBUG-48995 Change-Id: Id347f4325c036e16bfae7bf2f694905e0f21f8d7 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/web_contents_delegate_qt.h')
-rw-r--r--src/core/web_contents_delegate_qt.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/web_contents_delegate_qt.h b/src/core/web_contents_delegate_qt.h
index ba8c6b5a1..33fd49b3d 100644
--- a/src/core/web_contents_delegate_qt.h
+++ b/src/core/web_contents_delegate_qt.h
@@ -114,7 +114,7 @@ public:
WebContentsDelegateQt(content::WebContents*, WebContentsAdapterClient *adapterClient);
~WebContentsDelegateQt();
- QUrl url() const { return m_url; }
+ QUrl url(content::WebContents *source) const;
QString title() const { return m_title; }
// WebContentsDelegate overrides
@@ -223,12 +223,12 @@ private:
bool m_didStartLoadingSeen;
FrameFocusedObserver m_frameFocusedObserver;
- QUrl m_url;
QString m_title;
int m_audioStreamCount = 0;
int m_videoStreamCount = 0;
int m_mirroringStreamCount = 0;
int m_desktopStreamCount = 0;
+ mutable bool m_pendingUrlUpdate = false;
base::WeakPtrFactory<WebContentsDelegateQt> m_weakPtrFactory { this };
};