Index: content/public/common/prefetch_argument_win.cc |
diff --git a/content/public/common/prefetch_argument_win.cc b/content/public/common/prefetch_argument_win.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9a75bf43933924ccdb0fd0f04882b14b4cfbcc70 |
--- /dev/null |
+++ b/content/public/common/prefetch_argument_win.cc |
@@ -0,0 +1,31 @@ |
+// Copyright (c) 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "content/public/common/prefetch_argument_win.h" |
+ |
+#include "base/command_line.h" |
+#include "base/logging.h" |
+#include "base/strings/stringprintf.h" |
+#include "components/startup_metric_utils/common/pre_read_field_trial_utils_win.h" |
+ |
+namespace content { |
+ |
+void AddWindowsPrefetchArgument(int prefetch_id, |
+ base::CommandLine* command_line) { |
+ DCHECK(command_line); |
+ |
+ // There can only be 9 different prefetch profiles per executable. |
+ DCHECK_GE(prefetch_id, 0); |
+ DCHECK_LE(prefetch_id, 8); |
+ |
+ if (startup_metric_utils::GetPreReadOptions() & |
+ startup_metric_utils::PRE_READ_OPTION_NO_PREFETCH_ARGUMENT) { |
+ return; |
+ } |
+ |
+ if (prefetch_id != 0) |
+ command_line->AppendArg(base::StringPrintf("/prefetch:%d", prefetch_id)); |
+} |
+ |
+} // namespace content |