From 8405fe763e25d2cd0be22b87ddb41248671cbc68 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 31 Jan 2018 17:35:34 -0700 Subject: [PATCH] Make a copy-paste recipe for rebuilding the blacklist --- atom/app/command_line_args.cc | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/atom/app/command_line_args.cc b/atom/app/command_line_args.cc index e83eed46f2e1..5f0dacd90be7 100644 --- a/atom/app/command_line_args.cc +++ b/atom/app/command_line_args.cc @@ -38,24 +38,20 @@ bool IsUrlArg(const base::CommandLine::CharType* arg) { return false; } -// The blacklist of command line switches, must be sorted. -// Created with: -// find ./ -name "*switches.cc" \ -// | xargs grep -P --no-filename "\"\S+\";" \ -// | perl -pe 's|^.*?"(\S+)";| "$1",|' \ -// | sort | uniq -// then manually insert following switches into the list: -// "inspect", -// "inspect-brk", -// finally write a small piece of code to print out the sorted list since -// the "sort" tool may use differnt rules from C++ STL. -// std::vector sorted(std::begin(kBlacklist), -// std::end(kBlacklist)); -// std::sort(sorted.begin(), sorted.end()); -// FILE* f = fopen("testlist2", "w+"); -// for (auto& i : sorted) -// fprintf(f, "\"%s\",\n", i.c_str()); -// fclose(f); +/* + * The blacklist of command line switches, must be sorted. + * Update the list by pasting the following command into bash + * in libchromiumcontent/src/: + + (find ./ -name "*switches.cc" | \ + xargs grep -P --no-filename "\"\S+\";" | \ + perl -pe 's|^.*?"(\S+)";| "$1",|'; \ + echo ' "inspect",'; \ + echo ' "inspect-brk",') | \ + LANG=C sort | \ + uniq > blacklist-switches.txt + + */ const char* kBlacklist[] = { "/prefetch:1", "/prefetch:2",