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

Unified Diff: webkit/child/webkitplatformsupport_impl.cc

Issue 119493005: Expose a low-end device mode override flags for non-android OSs as well (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Put low end device detection under the flag for all platforms except android. Created 6 years, 11 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
« content/renderer/render_widget.cc ('K') | « ui/gl/gl_context_android.cc ('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 5b70672ffc103033b1893bcf5da8744b54ea811a..a03101c14b741825e6e93cf8734787004fcaf50b 100644
--- a/webkit/child/webkitplatformsupport_impl.cc
+++ b/webkit/child/webkitplatformsupport_impl.cc
@@ -25,6 +25,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/synchronization/lock.h"
#include "base/sys_info.h"
+#include "base/sys_utils.h"
#include "base/time/time.h"
#include "grit/blink_resources.h"
#include "grit/webkit_resources.h"
@@ -49,10 +50,6 @@
#include "webkit/child/weburlloader_impl.h"
#include "webkit/common/user_agent/user_agent.h"
-#if defined(OS_ANDROID)
-#include "base/android/sys_utils.h"
-#endif
-
#if !defined(NO_TCMALLOC) && defined(USE_TCMALLOC) && !defined(OS_WIN)
#include "third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h"
#endif
@@ -915,12 +912,12 @@ bool WebKitPlatformSupportImpl::memoryAllocatorWasteInBytes(size_t* size) {
}
size_t WebKitPlatformSupportImpl::maxDecodedImageBytes() {
-#if defined(OS_ANDROID)
- if (base::android::SysUtils::IsLowEndDevice()) {
+ if (base::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;
}
+#if defined(OS_ANDROID)
// 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;
« content/renderer/render_widget.cc ('K') | « ui/gl/gl_context_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698