| Index: webkit/child/webkitplatformsupport_impl.cc
|
| diff --git a/webkit/child/webkitplatformsupport_impl.cc b/webkit/child/webkitplatformsupport_impl.cc
|
| index ca82d3e273bb3d9e56f56dd0d30a38ce9513c08f..82b8dd3539ce6e0cd7e9aa47b3a940653267f0ab 100644
|
| --- a/webkit/child/webkitplatformsupport_impl.cc
|
| +++ b/webkit/child/webkitplatformsupport_impl.cc
|
| @@ -24,6 +24,7 @@
|
| #include "base/strings/string_util.h"
|
| #include "base/strings/utf_string_conversions.h"
|
| #include "base/synchronization/lock.h"
|
| +#include "base/sys_info.h"
|
| #include "base/time/time.h"
|
| #include "content/public/common/webplugininfo.h"
|
| #include "grit/blink_resources.h"
|
| @@ -889,11 +890,17 @@ bool WebKitPlatformSupportImpl::memoryAllocatorWasteInBytes(size_t* size) {
|
|
|
| size_t WebKitPlatformSupportImpl::maxDecodedImageBytes() {
|
| #if defined(OS_ANDROID)
|
| - // Limit image decoded size to 3M pixels on low end devices.
|
| - if (base::android::SysUtils::IsLowEndDevice())
|
| - return 3 * 1024 * 1024 * 4; // 4 is maximum number of bytes per pixel.
|
| -#endif
|
| + if (base::android::SysUtils::IsLowEndDevice()) {
|
| + // Limit image decoded size to 3M pixels on low end devices.
|
| + // 4 is maximum number of bytes per pixel.
|
| + return 3 * 1024 * 1024 * 4;
|
| + }
|
| + // For other devices, limit decoded image size based on the amount of physical
|
| + // memory. For a device with 2GB physical memory the limit is 16M pixels.
|
| + return base::SysInfo::AmountOfPhysicalMemory() / 32;
|
| +#else
|
| return noDecodedImageByteLimit;
|
| +#endif
|
| }
|
|
|
| void WebKitPlatformSupportImpl::SuspendSharedTimer() {
|
|
|