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

Unified Diff: chrome/browser/sync_file_system/drive_backend/metadata_database.h

Issue 107743002: Add 'Dump Database' tab to syncfs-internals (only for v2 for now) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
Index: chrome/browser/sync_file_system/drive_backend/metadata_database.h
diff --git a/chrome/browser/sync_file_system/drive_backend/metadata_database.h b/chrome/browser/sync_file_system/drive_backend/metadata_database.h
index 1bef1408dcf3d72f4d972305429d816bd4f7973a..e30c069d4d3384c74acaef04c224ae8c1bd6da47 100644
--- a/chrome/browser/sync_file_system/drive_backend/metadata_database.h
+++ b/chrome/browser/sync_file_system/drive_backend/metadata_database.h
@@ -134,6 +134,9 @@ class MetadataDatabase {
// Returns all file metadata for the given |app_id|.
scoped_ptr<base::ListValue> DumpFiles(const std::string& app_id);
+ // Returns all database data.
+ scoped_ptr<base::ListValue> DumpDatabase();
+
// TODO(tzik): Move GetLargestKnownChangeID() to private section, and hide its
// handling in the class, instead of letting user do.
//
@@ -226,6 +229,11 @@ class MetadataDatabase {
// The file path is relative to app-root and have a leading path separator.
bool BuildPathForTracker(int64 tracker_id, base::FilePath* path) const;
+ // Builds the file path for the given tracker for display purpose.
+ // This may return a path ending with '<unknown>' if the given tracker does
+ // not have title information (yet). This may return an empty path.
+ base::FilePath BuildDisplayPathForTracker(const FileTracker& tracker) const;
+
// Returns false if no registered app exists associated to |app_id|.
// If |full_path| is active, assigns the tracker of |full_path| to |tracker|.
// Otherwise, assigns the nearest active ancestor to |full_path| to |tracker|.
@@ -402,6 +410,9 @@ class MetadataDatabase {
bool HasNewerFileMetadata(const std::string& file_id, int64 change_id);
+ scoped_ptr<base::ListValue> DumpTrackers();
+ scoped_ptr<base::ListValue> DumpMetadata();
+
scoped_refptr<base::SequencedTaskRunner> task_runner_;
scoped_ptr<leveldb::DB> db_;

Powered by Google App Engine
This is Rietveld 408576698