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

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
« no previous file with comments | « ios/chrome/browser/experimental_flags.h ('k') | ios/chrome/browser/snapshots/lru_cache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e6714a400a1bf3191d9e8b4f5c679f9e1b2a81ec 100644
--- a/ios/chrome/browser/experimental_flags.mm
+++ b/ios/chrome/browser/experimental_flags.mm
@@ -54,6 +54,22 @@ void SetWKWebViewTrialEligibility(bool eligible) {
: WKWebViewEligibility::INELIGIBLE;
}
+bool IsLRUSnapshotCacheEnabled() {
+ // 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.
« no previous file with comments | « ios/chrome/browser/experimental_flags.h ('k') | ios/chrome/browser/snapshots/lru_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698