summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/gdata/gdata_files.h
diff options
context:
space:
mode:
authorachuith@chromium.org <achuith@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-25 00:15:34 +0000
committerachuith@chromium.org <achuith@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-25 00:15:34 +0000
commit671b613a7506f78672129b4dc9685fde01e66f00 (patch)
tree1b36c91867e522c83906e0c272c8ff59e832c986 /chrome/browser/chromeos/gdata/gdata_files.h
parent11e82d5b469c06f22503cfce5edc4f21fb4a1102 (diff)
downloadchromium_src-671b613a7506f78672129b4dc9685fde01e66f00.zip
chromium_src-671b613a7506f78672129b4dc9685fde01e66f00.tar.gz
chromium_src-671b613a7506f78672129b4dc9685fde01e66f00.tar.bz2
Revert 133815 - GDataDB support with leveldb.
* Define GDataDB interface with methods to Put, Get and Delete. Also define a path-based iterator. * GDataLevelDB implements GDataDB using leveldb. * Add methods SerializeToString and FromProtoString to serialize GDataEntry to strings and vice versa. * GDataDBTests test Put, Get, Delete for files and directories. * Iterator tests in GDataDBTests. * GDataDBFactory class to create GDataLevelDB instance. TODO: * There is no integration with GDataRootDirectory/GDataFileSystem yet. BUG=chromium-os:29232 TEST=unittests pass. Review URL: https://chromiumcodereview.appspot.com/10168025 TBR=achuith@chromium.org Review URL: https://chromiumcodereview.appspot.com/10214008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133819 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/gdata/gdata_files.h')
-rw-r--r--chrome/browser/chromeos/gdata/gdata_files.h28
1 files changed, 8 insertions, 20 deletions
diff --git a/chrome/browser/chromeos/gdata/gdata_files.h b/chrome/browser/chromeos/gdata/gdata_files.h
index 1944235..b7e9031 100644
--- a/chrome/browser/chromeos/gdata/gdata_files.h
+++ b/chrome/browser/chromeos/gdata/gdata_files.h
@@ -59,27 +59,15 @@ class GDataEntry {
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;
@@ -93,20 +81,20 @@ class GDataEntry {
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_; }
@@ -123,7 +111,7 @@ class GDataEntry {
// Returns virtual file path representing this file system entry. This path
// corresponds to file path expected by public methods of GDataFileSyste
// class.
- FilePath GetFilePath() const;
+ FilePath GetFilePath();
// Sets |file_name_| based on the value of |title_| without name
// de-duplication (see AddEntry() for details on de-duplication).
@@ -233,7 +221,6 @@ class GDataFile : public GDataEntry {
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_; }
@@ -411,6 +398,7 @@ class GDataRootDirectory : public GDataDirectory {
void set_serialized_size(size_t size) { serialized_size_ = size; }
// GDataEntry implementation.
+
virtual GDataRootDirectory* AsGDataRootDirectory() OVERRIDE;
// Add the entry to resource map.