diff options
author | satorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-31 21:21:02 +0000 |
---|---|---|
committer | satorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-31 21:21:02 +0000 |
commit | 9df3e69ac7d14f127f114471549612d1fc197d9a (patch) | |
tree | e4bc34f8d6eeea901fa01f1e92b588e240792da7 /chrome | |
parent | 3895dfe2d7feabf264bdff04cd43dc543ac72a3b (diff) | |
download | chromium_src-9df3e69ac7d14f127f114471549612d1fc197d9a.zip chromium_src-9df3e69ac7d14f127f114471549612d1fc197d9a.tar.gz chromium_src-9df3e69ac7d14f127f114471549612d1fc197d9a.tar.bz2 |
gdata: Make RemoveEntry/TakeEntry/TakeOverEntries private
We'll need to get rid of them, but for now, just make them private.
BUG=137725
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10834093
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149277 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/chromeos/gdata/gdata_file_system.cc | 35 | ||||
-rw-r--r-- | chrome/browser/chromeos/gdata/gdata_file_system.h | 6 | ||||
-rw-r--r-- | chrome/browser/chromeos/gdata/gdata_files.h | 27 |
3 files changed, 34 insertions, 34 deletions
diff --git a/chrome/browser/chromeos/gdata/gdata_file_system.cc b/chrome/browser/chromeos/gdata/gdata_file_system.cc index fb4f884..824fe9c 100644 --- a/chrome/browser/chromeos/gdata/gdata_file_system.cc +++ b/chrome/browser/chromeos/gdata/gdata_file_system.cc @@ -405,20 +405,6 @@ void RunTaskOnThread(scoped_refptr<base::MessageLoopProxy> relay_proxy, } // Callback for GetEntryByResourceIdAsync. -// Removes stale entry upon upload of file. -void RemoveStaleEntryOnUpload(const std::string& resource_id, - GDataDirectory* parent_dir, - GDataEntry* existing_entry) { - if (existing_entry && - // This should always match, but just in case. - existing_entry->parent() == parent_dir) { - parent_dir->RemoveEntry(existing_entry); - } else { - LOG(ERROR) << "Entry for the existing file not found: " << resource_id; - } -} - -// Callback for GetEntryByResourceIdAsync. // Adds |entry| to |results|. Runs |callback| with |results| when // |run_callback| is true. void AddEntryToSearchResults( @@ -3451,11 +3437,6 @@ void GDataFileSystem::ApplyFeedFromFileUrlMap( } } -// Helper function for adding new |file| from the feed into |directory|. It -// checks the type of file and updates |changed_dirs| if this file adding -// operation needs to raise directory notification update. If file is being -// added to |orphaned_dir_service| such notifications are not raised since -// we ignore such files and don't add them to the file system now. // static void GDataFileSystem::AddEntryToDirectoryAndCollectChangedDirectories( GDataEntry* entry, @@ -3467,9 +3448,6 @@ void GDataFileSystem::AddEntryToDirectoryAndCollectChangedDirectories( changed_dirs->insert(entry->GetFilePath()); } -// Helper function for removing |entry| from |directory|. If |entry| is a -// directory too, it will collect all its children file paths into -// |changed_dirs| as well. // static void GDataFileSystem::RemoveEntryFromDirectoryAndCollectChangedDirectories( GDataDirectory* directory, @@ -3481,6 +3459,19 @@ void GDataFileSystem::RemoveEntryFromDirectoryAndCollectChangedDirectories( directory->RemoveEntry(entry); } +// static +void GDataFileSystem::RemoveStaleEntryOnUpload(const std::string& resource_id, + GDataDirectory* parent_dir, + GDataEntry* existing_entry) { + if (existing_entry && + // This should always match, but just in case. + existing_entry->parent() == parent_dir) { + parent_dir->RemoveEntry(existing_entry); + } else { + LOG(ERROR) << "Entry for the existing file not found: " << resource_id; + } +} + GDataDirectory* GDataFileSystem::FindDirectoryForNewEntry( GDataEntry* new_entry, const FileResourceIdMap& file_map, diff --git a/chrome/browser/chromeos/gdata/gdata_file_system.h b/chrome/browser/chromeos/gdata/gdata_file_system.h index e9fa584..deab872 100644 --- a/chrome/browser/chromeos/gdata/gdata_file_system.h +++ b/chrome/browser/chromeos/gdata/gdata_file_system.h @@ -557,6 +557,12 @@ class GDataFileSystem : public GDataFileSystemInterface, GDataEntry* entry, std::set<FilePath>* changed_dirs); + // Callback for GetEntryByResourceIdAsync. + // Removes stale entry upon upload of file. + static void RemoveStaleEntryOnUpload(const std::string& resource_id, + GDataDirectory* parent_dir, + GDataEntry* existing_entry); + // Finds directory where new |file| should be added to during feed processing. // |orphaned_entries_dir| collects files/dirs that don't have a parent in // either locally cached file system or in this new feed. diff --git a/chrome/browser/chromeos/gdata/gdata_files.h b/chrome/browser/chromeos/gdata/gdata_files.h index f7defe7..b238bec 100644 --- a/chrome/browser/chromeos/gdata/gdata_files.h +++ b/chrome/browser/chromeos/gdata/gdata_files.h @@ -279,18 +279,6 @@ class GDataDirectory : public GDataEntry { bool FromProto(const GDataDirectoryProto& proto) WARN_UNUSED_RESULT; void ToProto(GDataDirectoryProto* proto) const; - // 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. - bool TakeEntry(GDataEntry* entry); - - // Takes over all entries from |dir|. - bool TakeOverEntries(GDataDirectory* dir); - - // Removes the entry from its children list and destroys the entry instance. - bool RemoveEntry(GDataEntry* entry); - // Removes child elements. void RemoveChildren(); void RemoveChildFiles(); @@ -314,6 +302,21 @@ class GDataDirectory : public GDataEntry { // TODO(satorux): Remove this. crbug.com/139649 void AddEntry(GDataEntry* entry); + // Removes the entry from its children list and destroys the entry instance. + // TODO(satorux): Remove this. crbug.com/139649 + bool 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); + // Find a child by its name. // TODO(satorux): Remove this. crbug.com/139649 GDataEntry* FindChild(const FilePath::StringType& file_name) const; |