Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(684)

Unified Diff: webkit/child/webkitplatformsupport_impl.cc

Issue 23600067: Limit image decoded size on low end Android devices (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Change according to WebKit API change Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/child/webkitplatformsupport_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/child/webkitplatformsupport_impl.cc
diff --git a/webkit/child/webkitplatformsupport_impl.cc b/webkit/child/webkitplatformsupport_impl.cc
index 44350ce9ae04ea6dd70ab5d2f64034621b1939ec..ca82d3e273bb3d9e56f56dd0d30a38ce9513c08f 100644
--- a/webkit/child/webkitplatformsupport_impl.cc
+++ b/webkit/child/webkitplatformsupport_impl.cc
@@ -51,6 +51,10 @@
#include "webkit/common/user_agent/user_agent.h"
#include "webkit/glue/webkit_glue.h"
+#if defined(OS_ANDROID)
+#include "base/android/sys_utils.h"
+#endif
+
using WebKit::WebAudioBus;
using WebKit::WebCookie;
using WebKit::WebData;
@@ -883,6 +887,15 @@ bool WebKitPlatformSupportImpl::memoryAllocatorWasteInBytes(size_t* size) {
return base::allocator::GetAllocatorWasteSize(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
+ return noDecodedImageByteLimit;
+}
+
void WebKitPlatformSupportImpl::SuspendSharedTimer() {
++shared_timer_suspended_;
}
« no previous file with comments | « webkit/child/webkitplatformsupport_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698