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

Side by Side Diff: webkit/browser/fileapi/dump_file_system.cc

Issue 492873002: Collapse fileapi, webkit_blob, webkit_database, quota, and webkit_common namespaces into single sto… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix chromeos build Created 6 years, 4 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 | Annotate | Revision Log
OLDNEW
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 } 56 }
57 57
58 void ShowUsageAndExit(const std::string& arg0) { 58 void ShowUsageAndExit(const std::string& arg0) {
59 ShowMessageAndExit( 59 ShowMessageAndExit(
60 "Usage: " + arg0 + 60 "Usage: " + arg0 +
61 " [-l] [-t] [-s] <filesystem dir> [origin]..."); 61 " [-l] [-t] [-s] <filesystem dir> [origin]...");
62 } 62 }
63 63
64 } // namespace 64 } // namespace
65 65
66 namespace fileapi { 66 namespace storage {
67 67
68 static void DumpDirectoryTree(const std::string& origin_name, 68 static void DumpDirectoryTree(const std::string& origin_name,
69 base::FilePath origin_dir) { 69 base::FilePath origin_dir) {
70 origin_dir = origin_dir.Append(g_opt_fs_type); 70 origin_dir = origin_dir.Append(g_opt_fs_type);
71 71
72 printf("=== ORIGIN %s %s ===\n", 72 printf("=== ORIGIN %s %s ===\n",
73 origin_name.c_str(), FilePathToString(origin_dir).c_str()); 73 origin_name.c_str(), FilePathToString(origin_dir).c_str());
74 74
75 if (!base::DirectoryExists(origin_dir)) 75 if (!base::DirectoryExists(origin_dir))
76 return; 76 return;
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 SandboxOriginDatabase origin_db(file_system_dir, NULL); 151 SandboxOriginDatabase origin_db(file_system_dir, NULL);
152 std::vector<SandboxOriginDatabase::OriginRecord> origins; 152 std::vector<SandboxOriginDatabase::OriginRecord> origins;
153 origin_db.ListAllOrigins(&origins); 153 origin_db.ListAllOrigins(&origins);
154 for (size_t i = 0; i < origins.size(); i++) { 154 for (size_t i = 0; i < origins.size(); i++) {
155 const SandboxOriginDatabase::OriginRecord& origin = origins[i]; 155 const SandboxOriginDatabase::OriginRecord& origin = origins[i];
156 DumpDirectoryTree(origin.origin, file_system_dir.Append(origin.path)); 156 DumpDirectoryTree(origin.origin, file_system_dir.Append(origin.path));
157 puts(""); 157 puts("");
158 } 158 }
159 } 159 }
160 160
161 } // namespace fileapi 161 } // namespace storage
162 162
163 int main(int argc, char* argv[]) { 163 int main(int argc, char* argv[]) {
164 const char* arg0 = argv[0]; 164 const char* arg0 = argv[0];
165 std::string username = "Default"; 165 std::string username = "Default";
166 while (true) { 166 while (true) {
167 if (argc < 2) 167 if (argc < 2)
168 ShowUsageAndExit(arg0); 168 ShowUsageAndExit(arg0);
169 169
170 if (std::string(argv[1]) == "-l") { 170 if (std::string(argv[1]) == "-l") {
171 g_opt_long = true; 171 g_opt_long = true;
172 argc--; 172 argc--;
173 argv++; 173 argv++;
174 } else if (std::string(argv[1]) == "-t") { 174 } else if (std::string(argv[1]) == "-t") {
175 g_opt_fs_type = "t"; 175 g_opt_fs_type = "t";
176 argc--; 176 argc--;
177 argv++; 177 argv++;
178 } else if (std::string(argv[1]) == "-s") { 178 } else if (std::string(argv[1]) == "-s") {
179 g_opt_fs_type = "s"; 179 g_opt_fs_type = "s";
180 argc--; 180 argc--;
181 argv++; 181 argv++;
182 } else { 182 } else {
183 break; 183 break;
184 } 184 }
185 } 185 }
186 186
187 if (argc < 2) 187 if (argc < 2)
188 ShowUsageAndExit(arg0); 188 ShowUsageAndExit(arg0);
189 189
190 const base::FilePath file_system_dir = fileapi::StringToFilePath(argv[1]); 190 const base::FilePath file_system_dir = storage::StringToFilePath(argv[1]);
191 if (!base::DirectoryExists(file_system_dir)) { 191 if (!base::DirectoryExists(file_system_dir)) {
192 ShowMessageAndExit(fileapi::FilePathToString(file_system_dir) + 192 ShowMessageAndExit(storage::FilePathToString(file_system_dir) +
193 " is not a filesystem directory"); 193 " is not a filesystem directory");
194 } 194 }
195 195
196 if (argc == 2) { 196 if (argc == 2) {
197 fileapi::DumpFileSystem(file_system_dir); 197 storage::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 storage::DumpOrigin(file_system_dir, argv[i]);
201 } 201 }
202 } 202 }
203 return 0; 203 return 0;
204 } 204 }
OLDNEW
« no previous file with comments | « webkit/browser/fileapi/dragged_file_util.cc ('k') | webkit/browser/fileapi/external_mount_points.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698