summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsatorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-19 18:08:31 +0000
committersatorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-19 18:08:31 +0000
commit49b68ad947f0e77c23942aa93b104f5e2bcaea2e (patch)
tree985e6faf95069095187d6637c3232953d2b1f441
parent12e30b0efe903af89932087cd203be1106e8c3d8 (diff)
downloadchromium_src-49b68ad947f0e77c23942aa93b104f5e2bcaea2e.zip
chromium_src-49b68ad947f0e77c23942aa93b104f5e2bcaea2e.tar.gz
chromium_src-49b68ad947f0e77c23942aa93b104f5e2bcaea2e.tar.bz2
gdata: Stop saving GDataFile::kind_ in proto
kind_ is only used for computing stats when documents list feed is loaded from the server, hence there is no need to save. Besides, saving C++ enum in proto is fragile, as C++ enum can change very easily which causes incompatibility with the enum values saved in proto. If we want to save enum in proto, we should define it in the proto file instead. BUG=135162 TEST=compiles Review URL: https://chromiumcodereview.appspot.com/10806033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147487 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/chromeos/gdata/gdata.proto1
-rw-r--r--chrome/browser/chromeos/gdata/gdata_files.cc2
-rw-r--r--chrome/browser/chromeos/gdata/gdata_files.h3
3 files changed, 1 insertions, 5 deletions
diff --git a/chrome/browser/chromeos/gdata/gdata.proto b/chrome/browser/chromeos/gdata/gdata.proto
index e53587e..ddbad67 100644
--- a/chrome/browser/chromeos/gdata/gdata.proto
+++ b/chrome/browser/chromeos/gdata/gdata.proto
@@ -39,7 +39,6 @@ message GDataEntryProto {
// Represents GDataFile.
message GDataFileProto {
optional GDataEntryProto gdata_entry = 1;
- optional uint32 kind = 2;
optional string thumbnail_url = 3;
optional string alternate_url = 4;
optional string content_mime_type = 5;
diff --git a/chrome/browser/chromeos/gdata/gdata_files.cc b/chrome/browser/chromeos/gdata/gdata_files.cc
index dbbcb4f..5f656c7 100644
--- a/chrome/browser/chromeos/gdata/gdata_files.cc
+++ b/chrome/browser/chromeos/gdata/gdata_files.cc
@@ -611,7 +611,6 @@ bool GDataFile::FromProto(const GDataFileProto& proto) {
if (!GDataEntry::FromProto(proto.gdata_entry()))
return false;
- kind_ = DocumentEntry::EntryKind(proto.kind());
thumbnail_url_ = GURL(proto.thumbnail_url());
alternate_url_ = GURL(proto.alternate_url());
content_mime_type_ = proto.content_mime_type();
@@ -625,7 +624,6 @@ bool GDataFile::FromProto(const GDataFileProto& proto) {
void GDataFile::ToProto(GDataFileProto* proto) const {
GDataEntry::ToProto(proto->mutable_gdata_entry());
DCHECK(!proto->gdata_entry().file_info().is_directory());
- proto->set_kind(kind_);
proto->set_thumbnail_url(thumbnail_url_.spec());
proto->set_alternate_url(alternate_url_.spec());
proto->set_content_mime_type(content_mime_type_);
diff --git a/chrome/browser/chromeos/gdata/gdata_files.h b/chrome/browser/chromeos/gdata/gdata_files.h
index f7e4ae6..f73c90d 100644
--- a/chrome/browser/chromeos/gdata/gdata_files.h
+++ b/chrome/browser/chromeos/gdata/gdata_files.h
@@ -236,8 +236,7 @@ class GDataFile : public GDataEntry {
virtual void SetBaseNameFromTitle() OVERRIDE;
private:
- // Content URL for files.
- DocumentEntry::EntryKind kind_;
+ DocumentEntry::EntryKind kind_; // Not saved in proto.
GURL thumbnail_url_;
GURL alternate_url_;
std::string content_mime_type_;