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

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

Issue 10828083: gdata: Add GDataDirectoryService::AddEntryToDirectory() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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/gdata/gdata_files.h
diff --git a/chrome/browser/chromeos/gdata/gdata_files.h b/chrome/browser/chromeos/gdata/gdata_files.h
index dac845dd76088c07621a649767bb60c432cd11a6..72338bd12199e6ea4604a3d2145ae0ad20da38da 100644
--- a/chrome/browser/chromeos/gdata/gdata_files.h
+++ b/chrome/browser/chromeos/gdata/gdata_files.h
@@ -64,6 +64,10 @@ const char kGDataRootDirectoryResourceId[] = "folder:root";
// gdata.proto.
const int32 kProtoVersion = 1;
+// Used for file operations like removing files.
+typedef base::Callback<void(GDataFileError error)>
+ FileOperationCallback;
+
// Base class for representing files and directories in gdata virtual file
// system.
class GDataEntry {
@@ -275,12 +279,6 @@ class GDataDirectory : public GDataEntry {
bool FromProto(const GDataDirectoryProto& proto) WARN_UNUSED_RESULT;
void ToProto(GDataDirectoryProto* proto) const;
- // Adds child file to the directory and takes over the ownership of |file|
- // object. The method will also do name de-duplication to ensure that the
- // exposed presentation path does not have naming conflicts. Two files with
- // the same name "Foo" will be renames to "Foo (1)" and "Foo (2)".
- void AddEntry(GDataEntry* entry);
-
// Takes the ownership of |entry| from its current parent. If this directory
// is already the current parent of |file|, this method effectively goes
// through the name de-duplication for |file| based on the current state of
@@ -305,7 +303,16 @@ class GDataDirectory : public GDataEntry {
}
private:
+ // TODO(satorux): Remove the friend statements. crbug.com/139649
friend class GDataDirectoryService;
+ friend class GDataFileSystem;
+
+ // Adds child file to the directory and takes over the ownership of |file|
+ // object. The method will also do name de-duplication to ensure that the
+ // exposed presentation path does not have naming conflicts. Two files with
+ // the same name "Foo" will be renames to "Foo (1)" and "Foo (2)".
+ // TODO(satorux): Remove this. crbug.com/139649
+ void AddEntry(GDataEntry* entry);
// Find a child by its name.
// TODO(satorux): Remove this. crbug.com/139649
@@ -352,6 +359,10 @@ class GDataDirectoryService {
const ContentOrigin origin() const { return origin_; }
void set_origin(ContentOrigin value) { origin_ = value; }
+ // ...
achuithb 2012/07/31 00:06:52 I'm assuming comment is coming?
satorux1 2012/07/31 00:28:30 yes. sorry!
satorux1 2012/07/31 07:13:22 Done.
+ void AddEntryAt(const FilePath& path, GDataEntry* entry,
achuithb 2012/07/31 00:06:52 Can we rename |path| to something more descriptive
satorux1 2012/07/31 00:28:30 Will change it to directory_path
satorux1 2012/07/31 07:13:22 Done. Renamed it to AddEntryToDirectory() as well
+ const FileOperationCallback& callback);
+
// Adds the entry to resource map.
void AddEntryToResourceMap(GDataEntry* entry);
@@ -375,6 +386,10 @@ class GDataDirectoryService {
// fresh value |fresh_file|.
void RefreshFile(scoped_ptr<GDataFile> fresh_file);
+ // Replaces file entry |old_entry| with its fresh value |fresh_file|.
+ static void RefreshFileInternal(scoped_ptr<GDataFile> fresh_file,
achuithb 2012/07/31 00:06:52 Why is this moved from anon namespace?
satorux1 2012/07/31 00:28:30 so that GDataDirectory::AddEntry() can be called.
+ GDataEntry* old_entry);
+
// Serializes/Parses to/from string via proto classes.
void SerializeToString(std::string* serialized_proto) const;
bool ParseFromString(const std::string& serialized_proto);

Powered by Google App Engine
This is Rietveld 408576698