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

Unified Diff: content/public/common/prefetch_argument_win.cc

Issue 1612663002: Use a valid /prefetch argument when launching a process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bit
Patch Set: Created 4 years, 11 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
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

Powered by Google App Engine
This is Rietveld 408576698