Bug 1322435. Limit the number of image decoding threads we use in the parent process. r=aosmond

There aren't as many images in chrome to decode, and they aren't as big, so we don't need as many threads.
This commit is contained in:
Timothy Nikkel 2016-12-08 18:20:13 -06:00
Родитель a13d957952
Коммит 04b319ae6d
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -16,6 +16,7 @@
#include "nsThreadUtils.h"
#include "nsXPCOMCIDInternal.h"
#include "prsystem.h"
#include "nsIXULRuntime.h"
#include "gfxPrefs.h"
@ -261,6 +262,11 @@ DecodePool::DecodePool()
if (limit > 32) {
limit = 32;
}
// The parent process where there are content processes doesn't need as many
// threads for decoding images.
if (limit > 4 && XRE_IsParentProcess() && BrowserTabsRemoteAutostart()) {
limit = 4;
}
// Initialize the thread pool.
for (uint32_t i = 0 ; i < limit ; ++i) {