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

Unified Diff: chrome/browser/chromeos/gdata/gdata_files.h

Issue 10210012: GDataDB support with leveldb. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: shorten prefixes Created 8 years, 8 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 | « chrome/browser/chromeos/gdata/gdata_db_unittest.cc ('k') | chrome/browser/chromeos/gdata/gdata_files.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/gdata/gdata_files.h
===================================================================
--- chrome/browser/chromeos/gdata/gdata_files.h (revision 133819)
+++ chrome/browser/chromeos/gdata/gdata_files.h (working copy)
@@ -59,15 +59,27 @@
public:
explicit GDataEntry(GDataDirectory* parent, GDataRootDirectory* root);
virtual ~GDataEntry();
+
virtual GDataFile* AsGDataFile();
virtual GDataDirectory* AsGDataDirectory();
virtual GDataRootDirectory* AsGDataRootDirectory();
+ // const versions of AsGDataFile and AsGDataDirectory.
+ const GDataFile* AsGDataFileConst() const;
+ const GDataDirectory* AsGDataDirectoryConst() const;
+
// Converts DocumentEntry into GDataEntry.
static GDataEntry* FromDocumentEntry(GDataDirectory* parent,
DocumentEntry* doc,
GDataRootDirectory* root);
+ // Serialize/Parse to/from string via proto classes.
+ // TODO(achuith): Correctly set up parent_ and root_ links in
+ // FromProtoString.
+ void SerializeToString(std::string* serialized_proto) const;
+ static scoped_ptr<GDataEntry> FromProtoString(
+ const std::string& serialized_proto);
+
// Convert to/from proto.
void FromProto(const GDataEntryProto& proto);
void ToProto(GDataEntryProto* proto) const;
@@ -81,20 +93,20 @@
GDataDirectory* parent() { return parent_; }
const base::PlatformFileInfo& file_info() const { return file_info_; }
+
const FilePath::StringType& file_name() const { return file_name_; }
- const FilePath::StringType& title() const {
- return title_;
- }
- void set_title(const FilePath::StringType& title) {
- title_ = title;
- }
void set_file_name(const FilePath::StringType& name) { file_name_ = name; }
+ const FilePath::StringType& title() const { return title_; }
+ void set_title(const FilePath::StringType& title) { title_ = title; }
+
// The unique resource ID associated with this file system entry.
const std::string& resource_id() const { return resource_id_; }
+ void set_resource_id(const std::string& res_id) { resource_id_ = res_id; }
// The content URL is used for downloading regular files as is.
const GURL& content_url() const { return content_url_; }
+ void set_content_url(const GURL& url) { content_url_ = url; }
// The edit URL is used for removing files and hosted documents.
const GURL& edit_url() const { return edit_url_; }
@@ -111,7 +123,7 @@
// Returns virtual file path representing this file system entry. This path
// corresponds to file path expected by public methods of GDataFileSyste
// class.
- FilePath GetFilePath();
+ FilePath GetFilePath() const;
// Sets |file_name_| based on the value of |title_| without name
// de-duplication (see AddEntry() for details on de-duplication).
@@ -221,6 +233,7 @@
const std::string& etag() const { return etag_; }
const std::string& id() const { return id_; }
const std::string& file_md5() const { return file_md5_; }
+ void set_file_md5(const std::string& file_md5) { file_md5_ = file_md5; }
const std::string& document_extension() const { return document_extension_; }
bool is_hosted_document() const { return is_hosted_document_; }
@@ -398,7 +411,6 @@
void set_serialized_size(size_t size) { serialized_size_ = size; }
// GDataEntry implementation.
-
virtual GDataRootDirectory* AsGDataRootDirectory() OVERRIDE;
// Add the entry to resource map.
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_db_unittest.cc ('k') | chrome/browser/chromeos/gdata/gdata_files.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698