summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-09-10 13:55:09 +0200
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-09-10 12:33:44 +0000
commitd3978d733ffba103bfd60b53ded1e47fc5b03075 (patch)
treedbfcc027e6b6e27c898cdbcb613a84c6d4d14a87
parentf590b159c56d9112ae8f6f2aeb960a365a881ac5 (diff)
Fix assert on exit
Remove frame loading error-page when frame is deleted, and make sure WebContents is destroyed before the observer so the observer can observe the full live-span including deletions.. Task-number: QTBUG-47945 Change-Id: I56bec611b8bfbfc6f75a1bc2108efbc80a81729b Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
-rw-r--r--src/core/web_contents_adapter.cpp2
-rw-r--r--src/core/web_contents_delegate_qt.cpp5
-rw-r--r--src/core/web_contents_delegate_qt.h1
3 files changed, 8 insertions, 0 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index 8c13035e..e35319fd 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -330,6 +330,8 @@ WebContentsAdapterPrivate::WebContentsAdapterPrivate()
WebContentsAdapterPrivate::~WebContentsAdapterPrivate()
{
+ // Destroy the WebContents first
+ webContents.reset();
}
QExplicitlySharedDataPointer<WebContentsAdapter> WebContentsAdapter::createFromSerializedNavigationHistory(QDataStream &input, WebContentsAdapterClient *adapterClient)
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index f9db91b3..c16c76f7 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -143,6 +143,11 @@ void WebContentsDelegateQt::HandleKeyboardEvent(content::WebContents *, const co
m_viewClient->unhandledKeyEvent(reinterpret_cast<QKeyEvent *>(event.os_event));
}
+void WebContentsDelegateQt::RenderFrameDeleted(content::RenderFrameHost *render_frame_host)
+{
+ m_loadingErrorFrameList.removeOne(render_frame_host->GetRoutingID());
+}
+
void WebContentsDelegateQt::DidStartProvisionalLoadForFrame(content::RenderFrameHost* render_frame_host, const GURL& validated_url, bool is_error_page, bool is_iframe_srcdoc)
{
if (is_error_page) {
diff --git a/src/core/web_contents_delegate_qt.h b/src/core/web_contents_delegate_qt.h
index 254177d2..41acf7c8 100644
--- a/src/core/web_contents_delegate_qt.h
+++ b/src/core/web_contents_delegate_qt.h
@@ -91,6 +91,7 @@ public:
virtual void MoveValidationMessage(content::WebContents *web_contents, const gfx::Rect &anchor_in_root_view) Q_DECL_OVERRIDE;
// WebContentsObserver overrides
+ virtual void RenderFrameDeleted(content::RenderFrameHost *render_frame_host) Q_DECL_OVERRIDE;
virtual void DidStartProvisionalLoadForFrame(content::RenderFrameHost *render_frame_host, const GURL &validated_url, bool is_error_page, bool is_iframe_srcdoc) Q_DECL_OVERRIDE;
virtual void DidCommitProvisionalLoadForFrame(content::RenderFrameHost *render_frame_host, const GURL &url, ui::PageTransition transition_type) Q_DECL_OVERRIDE;
virtual void DidFailProvisionalLoad(content::RenderFrameHost *render_frame_host, const GURL &validated_url, int error_code, const base::string16 &error_description) Q_DECL_OVERRIDE;