diff options
author | Michael Bruning <michael.bruning@theqtcompany.com> | 2016-05-23 15:02:12 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-05-23 16:51:11 +0200 |
commit | 59d211d8bbb42242ca355a7451b8a66ee5f30dc6 (patch) | |
tree | d51ef03184d1b9ef58fde30835a6c014c75b2c6d /src/core/web_contents_adapter.cpp | |
parent | 7933be051938a2815ed44563d26126e5d4a40b06 (diff) | |
parent | ad8bc45732eeb2efa6e885d564c10761e7154889 (diff) |
Merge remote-tracking branch 'origin/5.6' into 5.7.0
Conflicts:
src/3rdparty
src/core/browser_context_adapter.cpp
src/core/web_contents_adapter.cpp
src/webengine/doc/src/qtwebengine-platform-notes.qdoc
tests/auto/widgets/qwebenginepage/BLACKLIST
Change-Id: I768fc954a9a2147fc3669961286163a0a824def3
Diffstat (limited to 'src/core/web_contents_adapter.cpp')
-rw-r--r-- | src/core/web_contents_adapter.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index 82d21696c..5fe7c8dc9 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -70,6 +70,7 @@ #include "content/public/browser/navigation_entry.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/favicon_status.h" +#include "content/public/common/content_constants.h" #include <content/public/common/drop_data.h> #include "content/public/common/page_state.h" #include "content/public/common/page_zoom.h" @@ -426,6 +427,12 @@ void WebContentsAdapter::initialize(WebContentsAdapterClient *adapterClient) PrintViewManagerQt::CreateForWebContents(webContents()); #endif // defined(ENABLE_BASIC_PRINTING) + // Create an instance of WebEngineVisitedLinksManager to catch the first + // content::NOTIFICATION_RENDERER_PROCESS_CREATED event. This event will + // force to initialize visited links in VisitedLinkSlave. + // It must be done before creating a RenderView. + d->browserContextAdapter->visitedLinksManager(); + // Create a RenderView with the initial empty document content::RenderViewHost *rvh = d->webContents->GetRenderViewHost(); Q_ASSERT(rvh); @@ -511,7 +518,12 @@ void WebContentsAdapter::setContent(const QByteArray &data, const QString &mimeT urlString.append(","); urlString.append(encodedData.constData(), encodedData.length()); - content::NavigationController::LoadURLParams params((GURL(urlString))); + GURL dataUrlToLoad(urlString); + if (dataUrlToLoad.spec().size() > content::kMaxURLChars) { + d->adapterClient->loadFinished(false, baseUrl, false, net::ERR_ABORTED); + return; + } + content::NavigationController::LoadURLParams params((dataUrlToLoad)); params.load_type = content::NavigationController::LOAD_TYPE_DATA; params.base_url_for_data_url = toGurl(baseUrl); params.virtual_url_for_data_url = baseUrl.isEmpty() ? GURL(url::kAboutBlankURL) : toGurl(baseUrl); |