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

Unified Diff: ios/chrome/browser/experimental_flags.mm

Issue 1410973008: Added an experiment for an LRU snapshot cache. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
Index: ios/chrome/browser/experimental_flags.mm
diff --git a/ios/chrome/browser/experimental_flags.mm b/ios/chrome/browser/experimental_flags.mm
index 32bb7bb2a66f530ca03f3e855b1eccb91634cd61..cab0d186c7c7dddea0400e66fd28acf2a983b21a 100644
--- a/ios/chrome/browser/experimental_flags.mm
+++ b/ios/chrome/browser/experimental_flags.mm
@@ -54,6 +54,23 @@ void SetWKWebViewTrialEligibility(bool eligible) {
: WKWebViewEligibility::INELIGIBLE;
}
+bool IsLRUSnapshotCacheEnabled() {
+ return true;
sdefresne 2015/11/03 16:58:08 I guess that this is debug code, can you remove?
jbbegue 2015/11/05 17:14:40 Done.
+ // Check if the experimental flag is forced on or off.
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(switches::kEnableLRUSnapshotCache)) {
+ return true;
+ } else if (command_line->HasSwitch(switches::kDisableLRUSnapshotCache)) {
+ return false;
+ }
+
+ // Check if the finch experiment is turned on.
+ std::string group_name =
+ base::FieldTrialList::FindFullName("IOSLRUSnapshotCache");
+ return base::StartsWith(group_name, "Enabled",
+ base::CompareCase::INSENSITIVE_ASCII);
+}
+
bool IsWKWebViewEnabled() {
// If g_wkwebview_trial_eligibility hasn't been set, default it to
// ineligibile. This ensures future calls to try to set it will DCHECK.

Powered by Google App Engine
This is Rietveld 408576698