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

Unified Diff: gin/v8_initializer.cc

Issue 2039793003: [gin] Add V8IgnitionLowEnd experiment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove crash keys Created 4 years, 6 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 | « gin/public/gin_features.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gin/v8_initializer.cc
diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc
index a3dad4f007d11e04edfaa5d21d02bdedf487fc33..deed15188d074685ff0808c90450aa61fa0e05a5 100644
--- a/gin/v8_initializer.cc
+++ b/gin/v8_initializer.cc
@@ -19,6 +19,7 @@
#include "base/metrics/histogram.h"
#include "base/rand_util.h"
#include "base/strings/sys_string_conversions.h"
+#include "base/sys_info.h"
#include "base/threading/platform_thread.h"
#include "base/time/time.h"
#include "crypto/sha2.h"
@@ -229,6 +230,18 @@ bool GenerateEntropy(unsigned char* buffer, size_t amount) {
return true;
}
+bool ShouldUseIgnition() {
+ if (base::FeatureList::IsEnabled(features::kV8Ignition)) return true;
+#if defined(OS_ANDROID)
+ if (base::FeatureList::IsEnabled(features::kV8IgnitionLowEnd) &&
+ base::SysInfo::IsLowEndDevice()) {
+ return true;
+ }
+#endif
+ return false;
+}
+
+
} // namespace
#if defined(V8_USE_EXTERNAL_STARTUP_DATA)
@@ -430,7 +443,7 @@ void V8Initializer::Initialize(IsolateHolder::ScriptMode mode,
v8::V8::SetFlagsFromString(flag, sizeof(flag) - 1);
}
- if (base::FeatureList::IsEnabled(features::kV8Ignition)) {
+ if (ShouldUseIgnition()) {
std::string flag("--ignition");
v8::V8::SetFlagsFromString(flag.c_str(), static_cast<int>(flag.size()));
« no previous file with comments | « gin/public/gin_features.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698