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

Unified Diff: chrome/browser/chromeos/drive/drive_resource_metadata.h

Issue 11227020: Set root resource ID upon full feed update. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add a comment. Created 8 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
Index: chrome/browser/chromeos/drive/drive_resource_metadata.h
diff --git a/chrome/browser/chromeos/drive/drive_resource_metadata.h b/chrome/browser/chromeos/drive/drive_resource_metadata.h
index 195da00228ce673f454d85fb6c67824d93ac4f9e..5f4004b7d9d7af7b84093e07d7c419ae4a246bac 100644
--- a/chrome/browser/chromeos/drive/drive_resource_metadata.h
+++ b/chrome/browser/chromeos/drive/drive_resource_metadata.h
@@ -59,10 +59,6 @@ enum ContentOrigin {
// name is used in URLs for the file manager, hence user-visible.
const FilePath::CharType kDriveRootDirectory[] = FILE_PATH_LITERAL("drive");
-// The resource ID for the root directory is defined in the spec:
-// https://developers.google.com/google-apps/documents-list/
-const char kDriveRootDirectoryResourceId[] = "folder:root";
-
// This should be incremented when incompatibility change is made in
// drive.proto.
const int32 kProtoVersion = 2;
@@ -262,6 +258,10 @@ class DriveResourceMetadata {
const FileOperationCallback& callback);
void SaveToDB();
+ // Returns the resource ID of the root directory or empty string if it is
+ // not initialized.
+ const std::string& root_resource_id() const;
+
private:
// Initializes the resource map using serialized_resources fetched from the
// database.
@@ -307,6 +307,11 @@ class DriveResourceMetadata {
scoped_ptr<DriveDirectory> root_; // Stored in the serialized proto.
+ // Retains special resource ID for the root directory across |ClearRoot()|.
+ // This must be initialized only once using |InitializeRootEntry()|.
+ // This value will be used to look up the root direcotry in |InitFromDB()|.
+ std::string saved_root_resource_id_;
+
base::Time last_serialized_;
size_t serialized_size_;
int64 largest_changestamp_; // Stored in the serialized proto.

Powered by Google App Engine
This is Rietveld 408576698