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

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

Issue 10827211: Replace GDataDirectory::TakeEntry with GDataDirectoryService::AddEntryToDirectory. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: expect/assert after RunBlockingTask Created 8 years, 4 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
===================================================================
--- chrome/browser/chromeos/gdata/gdata_files.h (revision 150448)
+++ chrome/browser/chromeos/gdata/gdata_files.h (working copy)
@@ -74,10 +74,16 @@
typedef base::Callback<void(GDataFileError error)>
FileOperationCallback;
+// Callback similar to FileOperationCallback but with a given |file_path|.
satorux1 2012/08/08 23:25:01 let's add: // Used for operations that change a f
achuithb 2012/08/09 00:12:51 Done.
+typedef base::Callback<void(GDataFileError error,
+ const FilePath& file_path)>
+ FilePathUpdateCallback;
satorux1 2012/08/08 23:25:01 Maybe FilePathChangeCallback?
satorux1 2012/08/08 23:40:57 Better idea. This callback seems to be only used f
achuithb 2012/08/09 00:12:51 Done.
+
// Base class for representing files and directories in gdata virtual file
// system.
class GDataEntry {
public:
+ // TODO(achuith): Remove |parent| from ctor. crbug.com/141494
GDataEntry(GDataDirectory* parent, GDataDirectoryService* directory_service);
virtual ~GDataEntry();
@@ -220,6 +226,7 @@
// this could be either a regular file or a server side document.
class GDataFile : public GDataEntry {
public:
+ // TODO(achuith): Remove |parent| from ctor. crbug.com/141494
explicit GDataFile(GDataDirectory* parent,
GDataDirectoryService* directory_service);
virtual ~GDataFile();
@@ -266,6 +273,7 @@
// collection element.
class GDataDirectory : public GDataEntry {
public:
+ // TODO(achuith): Remove |parent| from ctor. crbug.com/141494
GDataDirectory(GDataDirectory* parent,
GDataDirectoryService* directory_service);
virtual ~GDataDirectory();
@@ -281,11 +289,6 @@
bool FromProto(const GDataDirectoryProto& proto) WARN_UNUSED_RESULT;
void ToProto(GDataDirectoryProto* proto) const;
- // Removes child elements.
- void RemoveChildren();
- void RemoveChildFiles();
- void RemoveChildDirectories();
-
// Collection of children files/directories.
const GDataFileCollection& child_files() const { return child_files_; }
const GDataDirectoryCollection& child_directories() const {
@@ -309,13 +312,6 @@
// TODO(satorux): Remove this. crbug.com/139649
void RemoveEntry(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
- // the file system.
- // TODO(satorux): Remove this. crbug.com/139649
- bool TakeEntry(GDataEntry* entry);
-
// Takes over all entries from |dir|.
// TODO(satorux): Remove this. crbug.com/139649
bool TakeOverEntries(GDataDirectory* dir);
@@ -331,6 +327,11 @@
// entry instance.
void RemoveChild(GDataEntry* entry);
+ // Removes child elements.
+ void RemoveChildren();
+ void RemoveChildFiles();
+ void RemoveChildDirectories();
+
// Collection of children GDataEntry items.
GDataFileCollection child_files_;
GDataDirectoryCollection child_directories_;
@@ -370,11 +371,12 @@
const ContentOrigin origin() const { return origin_; }
void set_origin(ContentOrigin value) { origin_ = value; }
- // Adds |entry| to |directory_path| asynchronously.
- // Must be called on UI thread. |callback| is called on the UI thread.
+ // Adds |entry| to |directory_path| asynchronously. Removes entry from
+ // previous parent. Must be called on UI thread. |callback| is called on the
satorux1 2012/08/08 23:40:58 Per the description, "MoveEntryToDirectory" may be
achuithb 2012/08/09 00:12:51 Done.
+ // UI thread.
void AddEntryToDirectory(const FilePath& directory_path,
GDataEntry* entry,
satorux1 2012/08/08 23:25:01 Not in this patch, but I think we should change th
achuithb 2012/08/09 00:12:51 Yup
- const FileOperationCallback& callback);
+ const FilePathUpdateCallback& callback);
// Adds the entry to resource map.
void AddEntryToResourceMap(GDataEntry* entry);

Powered by Google App Engine
This is Rietveld 408576698