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

Unified Diff: content/renderer/render_thread_impl.cc

Issue 24000003: [Android] Set V8 is_memory_constrained ResourceConstraint on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_thread_impl.cc
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index 085d4524cd96ff51d319ec2cb44c2bc4e8f5464f..6728faa3455fa2b4eb11a24ab3ef1718f76f17ef 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -127,6 +127,7 @@
#if defined(OS_ANDROID)
#include <cpu-features.h>
+#include "base/android/sys_utils.h"
#include "content/renderer/android/synchronous_compositor_factory.h"
#endif
@@ -323,6 +324,13 @@ void RenderThreadImpl::Init() {
v8::V8::SetCreateHistogramFunction(CreateHistogram);
v8::V8::SetAddHistogramSampleFunction(AddHistogramSample);
+#if defined(OS_ANDROID)
+ bool is_memory_constrained = base::android::SysUtils::IsLowEndDevice();
+ v8::ResourceConstraints resourceConstraints;
+ resourceConstraints.set_memory_constrained(&is_memory_constrained);
jamesr 2013/09/06 00:24:04 can you please show me where this API is provided?
+ v8::SetResourceConstraints(&resourceConstraints);
+#endif
+
#if defined(OS_MACOSX) || defined(OS_ANDROID)
// On Mac and Android, the select popups are rendered by the browser.
WebKit::WebView::setUseExternalPopupMenus(true);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698