OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/public/common/prefetch_argument_win.h" |
| 6 |
| 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" |
| 9 #include "base/strings/stringprintf.h" |
| 10 #include "components/startup_metric_utils/common/pre_read_field_trial_utils_win.
h" |
| 11 |
| 12 namespace content { |
| 13 |
| 14 void AddWindowsPrefetchArgument(int prefetch_id, |
| 15 base::CommandLine* command_line) { |
| 16 DCHECK(command_line); |
| 17 |
| 18 // There can only be 9 different prefetch profiles per executable. |
| 19 DCHECK_GE(prefetch_id, 0); |
| 20 DCHECK_LE(prefetch_id, 8); |
| 21 |
| 22 if (startup_metric_utils::GetPreReadOptions() & |
| 23 startup_metric_utils::PRE_READ_OPTION_NO_PREFETCH_ARGUMENT) { |
| 24 return; |
| 25 } |
| 26 |
| 27 if (prefetch_id != 0) |
| 28 command_line->AppendArg(base::StringPrintf("/prefetch:%d", prefetch_id)); |
| 29 } |
| 30 |
| 31 } // namespace content |
OLD | NEW |