summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJüri Valdmann <juri.valdmann@qt.io>2018-09-18 13:04:17 +0200
committerJüri Valdmann <juri.valdmann@qt.io>2018-09-24 09:01:10 +0000
commit0d579dd580e7ef2c2416594fabced8f95612b000 (patch)
treeb85a30884b4824372766346befcb4496a3b918b6
parent5d0fbf8a6890c395c0cdc0c60e775b70c95e15ed (diff)
Set a maximum size on favicons
Favicons are downloaded by the render process and sent back via mojo message. However, mojo messages have a maximum size; if the favicon doesn't fit, the render process is killed. Impose a maximum size to ensure that favicons can fit in mojo messages. Task-number: QTBUG-69123 Change-Id: I6027bc310dcc77ec530145e4f125efa36106464f Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
-rw-r--r--src/core/favicon_manager.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/favicon_manager.cpp b/src/core/favicon_manager.cpp
index 2a7d78320..de6a0f183 100644
--- a/src/core/favicon_manager.cpp
+++ b/src/core/favicon_manager.cpp
@@ -84,6 +84,7 @@ FaviconManager::~FaviconManager()
int FaviconManager::downloadIcon(const QUrl &url)
{
+ static const uint32_t maxSize = 256;
static int fakeId = 0;
int id;
@@ -95,7 +96,7 @@ int FaviconManager::downloadIcon(const QUrl &url)
id = m_webContents->DownloadImage(
toGurl(url),
true, // is_favicon
- 0, // no max size
+ maxSize,
false, // normal cache policy
base::Bind(&FaviconManager::iconDownloadFinished, m_weakFactory->GetWeakPtr()));
}