OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This command-line program dumps the contents of a set of cache files, either | 5 // This command-line program dumps the contents of a set of cache files, either |
6 // to stdout or to another set of cache files. | 6 // to stdout or to another set of cache files. |
7 | 7 |
8 #include <stdio.h> | 8 #include <stdio.h> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/at_exit.h" | 11 #include "base/at_exit.h" |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
14 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
15 #include "base/strings/stringprintf.h" | |
16 #include "net/disk_cache/blockfile/disk_format.h" | 15 #include "net/disk_cache/blockfile/disk_format.h" |
17 #include "net/tools/dump_cache/dump_files.h" | 16 #include "net/tools/dump_cache/dump_files.h" |
18 | 17 |
19 enum Errors { | 18 enum Errors { |
20 GENERIC = -1, | 19 GENERIC = -1, |
21 ALL_GOOD = 0, | 20 ALL_GOOD = 0, |
22 INVALID_ARGUMENT = 1, | 21 INVALID_ARGUMENT = 1, |
23 FILE_ACCESS_ERROR, | 22 FILE_ACCESS_ERROR, |
24 UNKNOWN_VERSION, | 23 UNKNOWN_VERSION, |
25 TOOL_NOT_FOUND, | 24 TOOL_NOT_FOUND, |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 base::FilePath name = | 102 base::FilePath name = |
104 input_path.AppendASCII(command_line.GetSwitchValueASCII(kDumpFile)); | 103 input_path.AppendASCII(command_line.GetSwitchValueASCII(kDumpFile)); |
105 return DumpAllocation(name); | 104 return DumpAllocation(name); |
106 } | 105 } |
107 | 106 |
108 if (command_line.HasSwitch(kDumpHeaders)) | 107 if (command_line.HasSwitch(kDumpHeaders)) |
109 return DumpHeaders(input_path); | 108 return DumpHeaders(input_path); |
110 | 109 |
111 return Help(); | 110 return Help(); |
112 } | 111 } |
OLD | NEW |