OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 // A tool to dump HTML5 filesystem from CUI. | 5 // A tool to dump HTML5 filesystem from CUI. |
6 // | 6 // |
7 // Usage: | 7 // Usage: |
8 // | 8 // |
9 // ./out/Release/dump_file_system [options] <filesystem dir> [origin]... | 9 // ./out/Release/dump_file_system [options] <filesystem dir> [origin]... |
10 // | 10 // |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 } | 109 } |
110 | 110 |
111 // +1 for the leading extra slash. | 111 // +1 for the leading extra slash. |
112 const char* display_name = name.c_str() + 1; | 112 const char* display_name = name.c_str() + 1; |
113 const char* directory_suffix = info.is_directory() ? "/" : ""; | 113 const char* directory_suffix = info.is_directory() ? "/" : ""; |
114 if (g_opt_long) { | 114 if (g_opt_long) { |
115 int64 size; | 115 int64 size; |
116 if (info.is_directory()) { | 116 if (info.is_directory()) { |
117 size = static_cast<int64>(children.size()); | 117 size = static_cast<int64>(children.size()); |
118 } else { | 118 } else { |
119 file_util::GetFileSize(origin_dir.Append(info.data_path), &size); | 119 base::GetFileSize(origin_dir.Append(info.data_path), &size); |
120 } | 120 } |
121 // TODO(hamaji): Modification time? | 121 // TODO(hamaji): Modification time? |
122 printf("%s%s %"PRId64" %"PRId64" %s\n", | 122 printf("%s%s %"PRId64" %"PRId64" %s\n", |
123 display_name, | 123 display_name, |
124 directory_suffix, | 124 directory_suffix, |
125 id, | 125 id, |
126 size, | 126 size, |
127 FilePathToString(info.data_path).c_str()); | 127 FilePathToString(info.data_path).c_str()); |
128 } else { | 128 } else { |
129 printf("%s%s\n", display_name, directory_suffix); | 129 printf("%s%s\n", display_name, directory_suffix); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 | 195 |
196 if (argc == 2) { | 196 if (argc == 2) { |
197 fileapi::DumpFileSystem(file_system_dir); | 197 fileapi::DumpFileSystem(file_system_dir); |
198 } else { | 198 } else { |
199 for (int i = 2; i < argc; i++) { | 199 for (int i = 2; i < argc; i++) { |
200 fileapi::DumpOrigin(file_system_dir, argv[i]); | 200 fileapi::DumpOrigin(file_system_dir, argv[i]); |
201 } | 201 } |
202 } | 202 } |
203 return 0; | 203 return 0; |
204 } | 204 } |
OLD | NEW |