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

Unified Diff: storage/browser/fileapi/dump_file_system.cc

Issue 636093002: Add SandboxPrioritizedOriginDatabase support for dump_file_system (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | storage/browser/fileapi/sandbox_prioritized_origin_database.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: storage/browser/fileapi/dump_file_system.cc
diff --git a/storage/browser/fileapi/dump_file_system.cc b/storage/browser/fileapi/dump_file_system.cc
index 49a2fa3aea1764d3026c73870b4bcc149f71bfb3..0c999c81e2a7ab79a1206059c3e2faac1e834a46 100644
--- a/storage/browser/fileapi/dump_file_system.cc
+++ b/storage/browser/fileapi/dump_file_system.cc
@@ -9,6 +9,8 @@
// ./out/Release/dump_file_system [options] <filesystem dir> [origin]...
//
// If no origin is specified, this dumps all origins in the profile dir.
+// For Chrome App, which has a separate storage directory, specify "primary"
+// as the origin name.
//
// Available options:
//
@@ -42,6 +44,7 @@
#include "storage/browser/fileapi/sandbox_directory_database.h"
#include "storage/browser/fileapi/sandbox_file_system_backend.h"
#include "storage/browser/fileapi/sandbox_origin_database.h"
+#include "storage/browser/fileapi/sandbox_prioritized_origin_database.h"
#include "storage/common/fileapi/file_system_types.h"
#include "storage/common/fileapi/file_system_util.h"
@@ -131,8 +134,14 @@ static void DumpDirectoryTree(const std::string& origin_name,
}
}
-static void DumpOrigin(const base::FilePath& file_system_dir,
- const std::string& origin_name) {
+static base::FilePath GetOriginDir(const base::FilePath& file_system_dir,
+ const std::string& origin_name) {
+ if (base::PathExists(file_system_dir.Append(
+ SandboxPrioritizedOriginDatabase::kPrimaryOriginFile))) {
+ return base::FilePath(
+ SandboxPrioritizedOriginDatabase::kPrimaryOriginFile);
+ }
+
SandboxOriginDatabase origin_db(file_system_dir, NULL);
base::FilePath origin_dir;
if (!origin_db.HasOriginPath(origin_name)) {
@@ -144,6 +153,13 @@ static void DumpOrigin(const base::FilePath& file_system_dir,
ShowMessageAndExit("Failed to get path of origin " + origin_name +
" in " + FilePathToString(file_system_dir));
}
+
+ return origin_dir;
+}
+
+static void DumpOrigin(const base::FilePath& file_system_dir,
+ const std::string& origin_name) {
+ base::FilePath origin_dir = GetOriginDir(file_system_dir, origin_name);
DumpDirectoryTree(origin_name, file_system_dir.Append(origin_dir));
}
« no previous file with comments | « no previous file | storage/browser/fileapi/sandbox_prioritized_origin_database.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698