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

Side by Side Diff: chrome/app/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: address comments from gab #13 Created 4 years, 10 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 unified diff | Download patch
OLDNEW
(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 "base/command_line.h"
6 #include "base/macros.h"
7 #include "base/strings/string16.h"
8 #include "base/strings/string_util.h"
9
10 bool HasValidWindowsPrefetchArgument(const base::CommandLine& command_line) {
gab 2016/01/29 19:39:28 This is only used for a DCHECK, how about moving i
fdoray 2016/02/01 13:28:26 Done.
11 const base::char16 kPrefetchArgumentPrefix[] = L"/prefetch:";
12
13 // Check if |command_line| contains an argument "/prefetch:#" where # is
14 // [1, 8].
15 for (const auto& arg : command_line.argv()) {
16 if (arg.size() == arraysize(kPrefetchArgumentPrefix) &&
17 base::StartsWith(arg, kPrefetchArgumentPrefix,
18 base::CompareCase::SENSITIVE) &&
19 arg[arraysize(kPrefetchArgumentPrefix) - 1] >= L'1' &&
gab 2016/01/29 19:39:28 return arg[arraysize(kPrefetchArgumentPrefix) - 1]
fdoray 2016/02/01 13:28:26 Done.
20 arg[arraysize(kPrefetchArgumentPrefix) - 1] <= L'8') {
21 return true;
22 }
23 }
24 return false;
25 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698