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

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

Issue 1107963002: Add MemoryWedge to ios/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review feedback. Created 5 years, 8 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 | « ios/chrome/browser/experimental_flags.h ('k') | ios/chrome/browser/experimental_flags_unittest.mm » ('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 a1ab78ee02c8030a51de69c2f953783f9aafb398..f837e62ddf8a83b7af54f59c1eb09aa3731c7f1f 100644
--- a/ios/chrome/browser/experimental_flags.mm
+++ b/ios/chrome/browser/experimental_flags.mm
@@ -7,7 +7,12 @@
#include "ios/chrome/browser/experimental_flags.h"
+#include <string>
+
#include "base/command_line.h"
+#include "base/metrics/field_trial.h"
+#include "base/strings/string_number_conversions.h"
+#include "components/variations/variations_associated_data.h"
#include "ios/chrome/browser/chrome_switches.h"
namespace experimental_flags {
@@ -17,4 +22,25 @@ bool IsOpenFromClipboardEnabled() {
return command_line->HasSwitch(switches::kEnableIOSOpenFromClipboard);
}
+size_t MemoryWedgeSizeInMB() {
+ std::string wedge_size_string;
+
+ // Get the size from the Experimental setting.
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ wedge_size_string =
+ command_line->GetSwitchValueASCII(switches::kIOSMemoryWedgeSize);
+
+ // Otherwise, get from a variation param.
+ if (wedge_size_string.empty()) {
+ wedge_size_string =
+ variations::GetVariationParamValue("MemoryWedge", "wedge_size");
+ }
+
+ // Parse the value.
+ size_t wedge_size_in_mb = 0;
+ if (base::StringToSizeT(wedge_size_string, &wedge_size_in_mb))
+ return wedge_size_in_mb;
+ return 0;
+}
+
} // namespace experimental_flags
« no previous file with comments | « ios/chrome/browser/experimental_flags.h ('k') | ios/chrome/browser/experimental_flags_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698