diff options
author | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2014-08-13 11:13:28 +0200 |
---|---|---|
committer | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2014-08-15 11:14:15 +0200 |
commit | 423b399a3336ed5832ac12fe0bb9c4c3eebc1c82 (patch) | |
tree | 5b4abc470dbeec3948cfe18bff91f48b06b9937f /src/core/web_contents_delegate_qt.h | |
parent | eb7e970eb03dfcc73c39544f4eca3a72782f4a08 (diff) |
Fix uncalled callbacks with findText
Calling findText successively might prevent the previous pending
FindReply to be sent, which would leak the callback on the
application side.
This would cause a crash in qupzilla since we empty all pending
callbacks in the QWebEnginePage's destructor to catch this kind
of issue.
This also renames lastRequestId to nextRequestId to make it clear
that this is the ID generator for everything, including findText,
and that lastFindRequestId is only a tracker.
Change-Id: Ia78d553a58ed31af7237aad8772fa9828560c6d4
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'src/core/web_contents_delegate_qt.h')
-rw-r--r-- | src/core/web_contents_delegate_qt.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/web_contents_delegate_qt.h b/src/core/web_contents_delegate_qt.h index e4bc143c1..8e1761a0a 100644 --- a/src/core/web_contents_delegate_qt.h +++ b/src/core/web_contents_delegate_qt.h @@ -65,6 +65,7 @@ public: WebContentsDelegateQt(content::WebContents*, WebContentsAdapterClient *adapterClient); QString lastSearchedString() const { return m_lastSearchedString; } void setLastSearchedString(const QString &s) { m_lastSearchedString = s; } + int lastReceivedFindReply() const { return m_lastReceivedFindReply; } virtual content::WebContents *OpenURLFromTab(content::WebContents *source, const content::OpenURLParams ¶ms) Q_DECL_OVERRIDE; virtual void NavigationStateChanged(const content::WebContents* source, unsigned changed_flags) Q_DECL_OVERRIDE; @@ -92,6 +93,7 @@ public: private: WebContentsAdapterClient *m_viewClient; QString m_lastSearchedString; + int m_lastReceivedFindReply; }; #endif // WEB_CONTENTS_DELEGATE_QT_H |