From 598bfc652edffb047948e01c3c76eb9e0cb7db4e Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 21 Feb 2019 17:01:03 +0100 Subject: Doc: Always treat \brief as full sentence Make sure all \brief descriptions start with an upper-case letter and end with a . Also start descriptions of \class with the name of the class or struct. Change-Id: Ifd2656201f9c1dff092085508a5423ce516e2d3f Reviewed-by: Leena Miettinen --- src/webenginewidgets/api/qwebenginepage.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/webenginewidgets/api/qwebenginepage.cpp') diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp index 67f3d7a76..aa1f7be7c 100644 --- a/src/webenginewidgets/api/qwebenginepage.cpp +++ b/src/webenginewidgets/api/qwebenginepage.cpp @@ -905,7 +905,7 @@ QWebEnginePage::QWebEnginePage(QObject* parent) \property QWebEnginePage::contentsSize \since 5.7 - The size of the page contents. + \brief The size of the page contents. */ /*! @@ -1054,7 +1054,7 @@ void QWebEnginePage::setWebChannel(QWebChannel *channel, uint worldId) /*! \property QWebEnginePage::backgroundColor - \brief the page's background color behind the document's body. + \brief The page's background color behind the document's body. \since 5.6 You can set the background color to Qt::transparent or to a translucent @@ -1105,7 +1105,7 @@ void QWebEnginePage::save(const QString &filePath, /*! \property QWebEnginePage::audioMuted - \brief whether the current page audio is muted. + \brief Whether the current page audio is muted. \since 5.7 The default value is \c false. @@ -1127,7 +1127,7 @@ void QWebEnginePage::setAudioMuted(bool muted) { /*! \property QWebEnginePage::recentlyAudible - \brief the current page's \e {audible state}, that is, whether audio was recently played + \brief The current page's \e {audible state}, that is, whether audio was recently played or not. \since 5.7 @@ -2046,7 +2046,7 @@ QUrl QWebEnginePage::requestedUrl() const /*! \property QWebEnginePage::iconUrl - \brief the URL of the icon associated with the page currently viewed + \brief The URL of the icon associated with the page currently viewed. By default, this property contains an empty URL. @@ -2060,7 +2060,7 @@ QUrl QWebEnginePage::iconUrl() const /*! \property QWebEnginePage::icon - \brief the icon associated with the page currently viewed + \brief The icon associated with the page currently viewed. \since 5.7 By default, this property contains a null icon. If the web page specifies more than one icon, -- cgit v1.2.3 From 56fadb571f32b721d8b99554e6e38692009ec37f Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Thu, 28 Feb 2019 10:49:22 +0100 Subject: Force destruction of webcontent client before profile adapter Currently users might forget to delete webcontent client before profile adapter. This might be nasty if users are not aware of default profile. Instead of asserting badly in chromium, clean up and release chromium resources. This avoids the crash, but might leak memory if users never deletes page. Task-number: QTBUG-74021 Change-Id: I66f466f169d12f7ee08866d505260dca47800bb0 Reviewed-by: Allan Sandfeld Jensen --- src/webenginewidgets/api/qwebenginepage.cpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'src/webenginewidgets/api/qwebenginepage.cpp') diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp index aa1f7be7c..fae34ae8d 100644 --- a/src/webenginewidgets/api/qwebenginepage.cpp +++ b/src/webenginewidgets/api/qwebenginepage.cpp @@ -256,12 +256,15 @@ QWebEnginePagePrivate::QWebEnginePagePrivate(QWebEngineProfile *_profile) ensureInitialized(); wasShown(); }); + + profile->d_ptr->addWebContentsAdapterClient(this); } QWebEnginePagePrivate::~QWebEnginePagePrivate() { delete history; delete settings; + profile->d_ptr->removeWebContentsAdapterClient(this); } RenderWidgetHostViewQtDelegate *QWebEnginePagePrivate::CreateRenderWidgetHostViewQtDelegate(RenderWidgetHostViewQtDelegateClient *client) @@ -545,6 +548,13 @@ void QWebEnginePagePrivate::authenticationRequired(QSharedPointeraccept(networkAuth.user(), networkAuth.password()); } +void QWebEnginePagePrivate::releaseProfile() +{ + qDebug("Release of profile requested but WebEnginePage still not deleted. Expect troubles !"); + // this is not the way to go, but might avoid the crash if user code does not make any calls to page. + delete q_ptr->d_ptr.take(); +} + void QWebEnginePagePrivate::showColorDialog(QSharedPointer controller) { #if QT_CONFIG(colordialog) @@ -967,11 +977,13 @@ QWebEnginePage::QWebEnginePage(QWebEngineProfile *profile, QObject* parent) QWebEnginePage::~QWebEnginePage() { - Q_D(QWebEnginePage); - setDevToolsPage(nullptr); - d->adapter->stopFinding(); - QWebEnginePagePrivate::bindPageAndView(this, nullptr); - QWebEnginePagePrivate::bindPageAndWidget(this, nullptr); + if (d_ptr) { + // d_ptr might be exceptionally null if profile adapter got deleted first + setDevToolsPage(nullptr); + d_ptr->adapter->stopFinding(); + QWebEnginePagePrivate::bindPageAndView(this, nullptr); + QWebEnginePagePrivate::bindPageAndWidget(this, nullptr); + } } QWebEngineHistory *QWebEnginePage::history() const -- cgit v1.2.3