diff options
author | satorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-14 07:20:41 +0000 |
---|---|---|
committer | satorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-14 07:20:41 +0000 |
commit | 4df437dc0ae4a1600dfa93e519d7f7528a4d8a78 (patch) | |
tree | d4a01388acc147c783e7f3f16cbadfeee4838358 | |
parent | d104666aaab2608b780fe70e1fbfb7270d777b86 (diff) | |
download | chromium_src-4df437dc0ae4a1600dfa93e519d7f7528a4d8a78.zip chromium_src-4df437dc0ae4a1600dfa93e519d7f7528a4d8a78.tar.gz chromium_src-4df437dc0ae4a1600dfa93e519d7f7528a4d8a78.tar.bz2 |
drive: Rename GetEntryInfo* to GetResourceEntry* in drive::FileSystem
Historically the term "EntryInfo" has been used in many functions and
callback types but these are not good names. "ResourceEntry" should be
the right term for these.
BUG=238949
TEST=none; mechanical renames
R=hashimoto@chromium.org
Review URL: https://codereview.chromium.org/14908008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@199942 0039d316-1c4b-4281-b951-d872f2087c98
39 files changed, 275 insertions, 268 deletions
diff --git a/chrome/browser/chromeos/drive/change_list_loader.cc b/chrome/browser/chromeos/drive/change_list_loader.cc index 0d0eb97..339de30 100644 --- a/chrome/browser/chromeos/drive/change_list_loader.cc +++ b/chrome/browser/chromeos/drive/change_list_loader.cc @@ -545,7 +545,7 @@ void ChangeListLoader::DoLoadDirectoryFromServer( base::FilePath(util::kDriveMyDriveRootPath), base::Bind( &ChangeListLoader - ::DoLoadGrandRootDirectoryFromServerAfterGetEntryInfoByPath, + ::DoLoadGrandRootDirectoryFromServerAfterGetResourceEntryByPath, weak_ptr_factory_.GetWeakPtr(), directory_fetch_info, callback)); @@ -568,7 +568,7 @@ void ChangeListLoader::DoLoadDirectoryFromServer( } void -ChangeListLoader::DoLoadGrandRootDirectoryFromServerAfterGetEntryInfoByPath( +ChangeListLoader::DoLoadGrandRootDirectoryFromServerAfterGetResourceEntryByPath( const DirectoryFetchInfo& directory_fetch_info, const FileOperationCallback& callback, FileError error, diff --git a/chrome/browser/chromeos/drive/change_list_loader.h b/chrome/browser/chromeos/drive/change_list_loader.h index f69340e..0097a89 100644 --- a/chrome/browser/chromeos/drive/change_list_loader.h +++ b/chrome/browser/chromeos/drive/change_list_loader.h @@ -218,7 +218,7 @@ class ChangeListLoader { const FileOperationCallback& callback); // Part of DoLoadDirectoryFromServer() for the grand root ("/drive"). - void DoLoadGrandRootDirectoryFromServerAfterGetEntryInfoByPath( + void DoLoadGrandRootDirectoryFromServerAfterGetResourceEntryByPath( const DirectoryFetchInfo& directory_fetch_info, const FileOperationCallback& callback, FileError error, diff --git a/chrome/browser/chromeos/drive/change_list_processor.h b/chrome/browser/chromeos/drive/change_list_processor.h index 8a5142c..3d5b693 100644 --- a/chrome/browser/chromeos/drive/change_list_processor.h +++ b/chrome/browser/chromeos/drive/change_list_processor.h @@ -112,7 +112,7 @@ class ChangeListProcessor { void ApplyEntryProto(const ResourceEntry& entry); // Continue ApplyEntryProto. This is a callback for - // ResourceMetadata::GetEntryInfoByResourceId. + // ResourceMetadata::GetResourceEntryById. void ContinueApplyEntryProto( const ResourceEntry& entry, FileError error, @@ -170,7 +170,7 @@ class ChangeListProcessor { void UpdateRootEntry(const base::Closure& closure); // Part of UpdateRootEntry(). Called after - // ResourceMetadata::GetEntryInfoByPath is complete. Updates the root + // ResourceMetadata::GetResourceEntryByPath is complete. Updates the root // proto, and refreshes the root entry with the proto. void UpdateRootEntryAfterGetEntry(const base::Closure& closure, FileError error, diff --git a/chrome/browser/chromeos/drive/download_handler.cc b/chrome/browser/chromeos/drive/download_handler.cc index f6a0756..d8c68e6 100644 --- a/chrome/browser/chromeos/drive/download_handler.cc +++ b/chrome/browser/chromeos/drive/download_handler.cc @@ -142,14 +142,14 @@ void DownloadHandler::SubstituteDriveDownloadPath( if (util::IsUnderDriveMountPoint(drive_path)) { // Can't access drive if the directory does not exist on Drive. // We set off a chain of callbacks as follows: - // FileSystem::GetEntryInfoByPath + // FileSystem::GetResourceEntryByPath // OnEntryFound calls FileSystem::CreateDirectory (if necessary) // OnCreateDirectory calls SubstituteDriveDownloadPathInternal const base::FilePath drive_dir_path = util::ExtractDrivePath(drive_path.DirName()); // Ensure the directory exists. This also forces FileSystem to // initialize DriveRootDirectory. - file_system_->GetEntryInfoByPath( + file_system_->GetResourceEntryByPath( drive_dir_path, base::Bind(&DownloadHandler::OnEntryFound, weak_ptr_factory_.GetWeakPtr(), @@ -195,7 +195,7 @@ bool DownloadHandler::IsDriveDownload(const DownloadItem* download) { void DownloadHandler::CheckForFileExistence( const DownloadItem* download, const content::CheckForFileExistenceCallback& callback) { - file_system_->GetEntryInfoByPath( + file_system_->GetResourceEntryByPath( util::ExtractDrivePath(GetTargetPath(download)), base::Bind(&ContinueCheckingForFileExistence, callback)); @@ -271,7 +271,7 @@ void DownloadHandler::OnEntryFound( // Directory is already ready. OnCreateDirectory(callback, FILE_ERROR_OK); } else { - LOG(WARNING) << "Failed to get entry info for path: " + LOG(WARNING) << "Failed to get resource entry for path: " << drive_dir_path.value() << ", error = " << FileErrorToString(error); callback.Run(base::FilePath()); diff --git a/chrome/browser/chromeos/drive/download_handler.h b/chrome/browser/chromeos/drive/download_handler.h index f8d9670..78c25fe 100644 --- a/chrome/browser/chromeos/drive/download_handler.h +++ b/chrome/browser/chromeos/drive/download_handler.h @@ -76,7 +76,7 @@ class DownloadHandler : public AllDownloadItemNotifier::Observer { // Removes the download. void RemoveDownload(int id); - // Callback for FileSystem::GetEntryInfoByPath(). + // Callback for FileSystem::GetResourceEntryByPath(). // Used to implement SubstituteDriveDownloadPath(). void OnEntryFound(const base::FilePath& drive_dir_path, const SubstituteDriveDownloadPathCallback& callback, diff --git a/chrome/browser/chromeos/drive/download_handler_unittest.cc b/chrome/browser/chromeos/drive/download_handler_unittest.cc index 3e2f6f9..3a0db7f0 100644 --- a/chrome/browser/chromeos/drive/download_handler_unittest.cc +++ b/chrome/browser/chromeos/drive/download_handler_unittest.cc @@ -52,7 +52,7 @@ class DownloadHandlerTest : public testing::Test { .WillRepeatedly(Return(content::DownloadItem::IN_PROGRESS)); // Set expectations for file system to save argument callbacks. - EXPECT_CALL(file_system_, GetEntryInfoByPath(_, _)) + EXPECT_CALL(file_system_, GetResourceEntryByPath(_, _)) .WillRepeatedly(SaveArg<1>(&get_entry_info_callback_)); EXPECT_CALL(file_system_, CreateDirectory(_, _, _, _)) .WillRepeatedly(SaveArg<3>(&create_directory_callback_)); @@ -110,7 +110,7 @@ TEST_F(DownloadHandlerTest, SubstituteDriveDownloadPath) { base::Bind(&CopySubstituteDriveDownloadPathResult, &substituted_path)); google_apis::test_util::RunBlockingPoolTask(); - // Return result of GetEntryInfoByPath(), destination directory found. + // Return result of GetResourceEntryByPath(), destination directory found. scoped_ptr<ResourceEntry> entry(new ResourceEntry); ASSERT_FALSE(get_entry_info_callback_.is_null()); get_entry_info_callback_.Run(FILE_ERROR_OK, entry.Pass()); @@ -134,7 +134,7 @@ TEST_F(DownloadHandlerTest, SubstituteDriveDownloadPathGetEntryFailure) { base::Bind(&CopySubstituteDriveDownloadPathResult, &substituted_path)); google_apis::test_util::RunBlockingPoolTask(); - // Return result of GetEntryInfoByPath(), failing for some reason. + // Return result of GetResourceEntryByPath(), failing for some reason. ASSERT_FALSE(get_entry_info_callback_.is_null()); get_entry_info_callback_.Run(FILE_ERROR_FAILED, scoped_ptr<ResourceEntry>()); @@ -156,7 +156,7 @@ TEST_F(DownloadHandlerTest, SubstituteDriveDownloadPathCreateDirectory) { base::Bind(&CopySubstituteDriveDownloadPathResult, &substituted_path)); google_apis::test_util::RunBlockingPoolTask(); - // Return result of GetEntryInfoByPath(), destination directory not found. + // Return result of GetResourceEntryByPath(), destination directory not found. ASSERT_FALSE(get_entry_info_callback_.is_null()); get_entry_info_callback_.Run(FILE_ERROR_NOT_FOUND, scoped_ptr<ResourceEntry>()); @@ -186,7 +186,7 @@ TEST_F(DownloadHandlerTest, base::Bind(&CopySubstituteDriveDownloadPathResult, &substituted_path)); google_apis::test_util::RunBlockingPoolTask(); - // Return result of GetEntryInfoByPath(), destination directory not found. + // Return result of GetResourceEntryByPath(), destination directory not found. ASSERT_FALSE(get_entry_info_callback_.is_null()); get_entry_info_callback_.Run(FILE_ERROR_NOT_FOUND, scoped_ptr<ResourceEntry>()); @@ -215,7 +215,7 @@ TEST_F(DownloadHandlerTest, SubstituteDriveDownloadPathForSavePackage) { base::Bind(&CopySubstituteDriveDownloadPathResult, &substituted_path)); google_apis::test_util::RunBlockingPoolTask(); - // Return result of GetEntryInfoByPath(), destination directory found. + // Return result of GetResourceEntryByPath(), destination directory found. scoped_ptr<ResourceEntry> entry(new ResourceEntry); ASSERT_FALSE(get_entry_info_callback_.is_null()); get_entry_info_callback_.Run(FILE_ERROR_OK, entry.Pass()); @@ -251,7 +251,7 @@ TEST_F(DownloadHandlerTest, CheckForFileExistence) { base::Bind(&CopyCheckForFileExistenceResult, &file_exists)); google_apis::test_util::RunBlockingPoolTask(); - // Return result of GetEntryInfoByPath(), file exists. + // Return result of GetResourceEntryByPath(), file exists. { scoped_ptr<ResourceEntry> entry(new ResourceEntry); ASSERT_FALSE(get_entry_info_callback_.is_null()); @@ -271,7 +271,7 @@ TEST_F(DownloadHandlerTest, CheckForFileExistence) { base::Bind(&CopyCheckForFileExistenceResult, &file_exists)); google_apis::test_util::RunBlockingPoolTask(); - // Return result of GetEntryInfoByPath(), file does not exist. + // Return result of GetResourceEntryByPath(), file does not exist. ASSERT_FALSE(get_entry_info_callback_.is_null()); get_entry_info_callback_.Run(FILE_ERROR_NOT_FOUND, scoped_ptr<ResourceEntry>()); diff --git a/chrome/browser/chromeos/drive/fake_file_system.cc b/chrome/browser/chromeos/drive/fake_file_system.cc index 78aa907..3fde68e 100644 --- a/chrome/browser/chromeos/drive/fake_file_system.cc +++ b/chrome/browser/chromeos/drive/fake_file_system.cc @@ -54,7 +54,7 @@ void FakeFileSystem::CheckForUpdates() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); } -void FakeFileSystem::GetEntryInfoByResourceId( +void FakeFileSystem::GetResourceEntryById( const std::string& resource_id, const GetResourceEntryWithFilePathCallback& callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); @@ -62,7 +62,7 @@ void FakeFileSystem::GetEntryInfoByResourceId( drive_service_->GetResourceEntry( resource_id, base::Bind( - &FakeFileSystem::GetEntryInfoByResourceIdAfterGetResourceEntry, + &FakeFileSystem::GetResourceEntryByIdAfterGetResourceEntry, weak_ptr_factory_.GetWeakPtr(), callback)); } @@ -152,9 +152,9 @@ void FakeFileSystem::GetFileContentByPath( const FileOperationCallback& completion_callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - GetEntryInfoByPath( + GetResourceEntryByPath( file_path, - base::Bind(&FakeFileSystem::GetFileContentByPathAfterGetEntryInfo, + base::Bind(&FakeFileSystem::GetFileContentByPathAfterGetResourceEntry, weak_ptr_factory_.GetWeakPtr(), file_path, initialized_callback, get_content_callback, completion_callback)); @@ -167,7 +167,7 @@ void FakeFileSystem::UpdateFileByResourceId( DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); } -void FakeFileSystem::GetEntryInfoByPath( +void FakeFileSystem::GetResourceEntryByPath( const base::FilePath& file_path, const GetResourceEntryCallback& callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); @@ -179,15 +179,15 @@ void FakeFileSystem::GetEntryInfoByPath( // Specialized for the root entry. drive_service_->GetAboutResource( base::Bind( - &FakeFileSystem::GetEntryInfoByPathAfterGetAboutResource, + &FakeFileSystem::GetResourceEntryByPathAfterGetAboutResource, weak_ptr_factory_.GetWeakPtr(), callback)); return; } - GetEntryInfoByPath( + GetResourceEntryByPath( file_path.DirName(), base::Bind( - &FakeFileSystem::GetEntryInfoByPathAfterGetParentEntryInfo, + &FakeFileSystem::GetResourceEntryByPathAfterGetParentEntryInfo, weak_ptr_factory_.GetWeakPtr(), file_path.BaseName(), callback)); } @@ -324,8 +324,8 @@ void FakeFileSystem::GetFilePathAfterGetResourceEntry( file_path, callback); } -// Implementation of GetEntryInfoByResourceId. -void FakeFileSystem::GetEntryInfoByResourceIdAfterGetResourceEntry( +// Implementation of GetResourceEntryById. +void FakeFileSystem::GetResourceEntryByIdAfterGetResourceEntry( const GetResourceEntryWithFilePathCallback& callback, google_apis::GDataErrorCode error_in, scoped_ptr<google_apis::ResourceEntry> resource_entry) { @@ -345,12 +345,12 @@ void FakeFileSystem::GetEntryInfoByResourceIdAfterGetResourceEntry( GetFilePath( parent_resource_id, base::Bind( - &FakeFileSystem::GetEntryInfoByResourceIdAfterGetFilePath, + &FakeFileSystem::GetResourceEntryByIdAfterGetFilePath, weak_ptr_factory_.GetWeakPtr(), callback, error, base::Passed(&entry))); } -void FakeFileSystem::GetEntryInfoByResourceIdAfterGetFilePath( +void FakeFileSystem::GetResourceEntryByIdAfterGetFilePath( const GetResourceEntryWithFilePathCallback& callback, FileError error, scoped_ptr<ResourceEntry> entry, @@ -362,7 +362,7 @@ void FakeFileSystem::GetEntryInfoByResourceIdAfterGetFilePath( } // Implementation of GetFileContentByPath. -void FakeFileSystem::GetFileContentByPathAfterGetEntryInfo( +void FakeFileSystem::GetFileContentByPathAfterGetResourceEntry( const base::FilePath& file_path, const GetFileContentInitializedCallback& initialized_callback, const google_apis::GetContentCallback& get_content_callback, @@ -383,18 +383,19 @@ void FakeFileSystem::GetFileContentByPathAfterGetEntryInfo( return; } - // Fetch the ResourceEntry for its |download_url|. + // Fetch google_apis::ResourceEntry for its |download_url|. drive_service_->GetResourceEntry( entry->resource_id(), - base::Bind(&FakeFileSystem::GetFileContentByPathAfterGetResourceEntry, - weak_ptr_factory_.GetWeakPtr(), - file_path, - initialized_callback, - get_content_callback, - completion_callback)); + base::Bind( + &FakeFileSystem::GetFileContentByPathAfterGetWapiResourceEntry, + weak_ptr_factory_.GetWeakPtr(), + file_path, + initialized_callback, + get_content_callback, + completion_callback)); } -void FakeFileSystem::GetFileContentByPathAfterGetResourceEntry( +void FakeFileSystem::GetFileContentByPathAfterGetWapiResourceEntry( const base::FilePath& file_path, const GetFileContentInitializedCallback& initialized_callback, const google_apis::GetContentCallback& get_content_callback, @@ -444,8 +445,8 @@ void FakeFileSystem::GetFileContentByPathAfterDownloadFile( completion_callback.Run(util::GDataToFileError(gdata_error)); } -// Implementation of GetEntryInfoByPath. -void FakeFileSystem::GetEntryInfoByPathAfterGetAboutResource( +// Implementation of GetResourceEntryByPath. +void FakeFileSystem::GetResourceEntryByPathAfterGetAboutResource( const GetResourceEntryCallback& callback, google_apis::GDataErrorCode gdata_error, scoped_ptr<google_apis::AboutResource> about_resource) { @@ -465,7 +466,7 @@ void FakeFileSystem::GetEntryInfoByPathAfterGetAboutResource( callback.Run(error, root.Pass()); } -void FakeFileSystem::GetEntryInfoByPathAfterGetParentEntryInfo( +void FakeFileSystem::GetResourceEntryByPathAfterGetParentEntryInfo( const base::FilePath& base_name, const GetResourceEntryCallback& callback, FileError error, @@ -481,11 +482,11 @@ void FakeFileSystem::GetEntryInfoByPathAfterGetParentEntryInfo( drive_service_->GetResourceListInDirectory( parent_entry->resource_id(), base::Bind( - &FakeFileSystem::GetEntryInfoByPathAfterGetResourceList, + &FakeFileSystem::GetResourceEntryByPathAfterGetResourceList, weak_ptr_factory_.GetWeakPtr(), base_name, callback)); } -void FakeFileSystem::GetEntryInfoByPathAfterGetResourceList( +void FakeFileSystem::GetResourceEntryByPathAfterGetResourceList( const base::FilePath& base_name, const GetResourceEntryCallback& callback, google_apis::GDataErrorCode gdata_error, diff --git a/chrome/browser/chromeos/drive/fake_file_system.h b/chrome/browser/chromeos/drive/fake_file_system.h index 08372c8..ab5924e 100644 --- a/chrome/browser/chromeos/drive/fake_file_system.h +++ b/chrome/browser/chromeos/drive/fake_file_system.h @@ -51,7 +51,7 @@ class FakeFileSystem : public FileSystemInterface { virtual void AddObserver(FileSystemObserver* observer) OVERRIDE; virtual void RemoveObserver(FileSystemObserver* observer) OVERRIDE; virtual void CheckForUpdates() OVERRIDE; - virtual void GetEntryInfoByResourceId( + virtual void GetResourceEntryById( const std::string& resource_id, const GetResourceEntryWithFilePathCallback& callback) OVERRIDE; virtual void TransferFileFromRemoteToLocal( @@ -102,7 +102,7 @@ class FakeFileSystem : public FileSystemInterface { const std::string& resource_id, const DriveClientContext& context, const FileOperationCallback& callback) OVERRIDE; - virtual void GetEntryInfoByPath( + virtual void GetResourceEntryByPath( const base::FilePath& file_path, const GetResourceEntryCallback& callback) OVERRIDE; virtual void ReadDirectoryByPath( @@ -167,16 +167,16 @@ class FakeFileSystem : public FileSystemInterface { google_apis::GDataErrorCode error_in, scoped_ptr<google_apis::ResourceEntry> resource_entry); - // Helpers of GetEntryInfoByResourceId. + // Helpers of GetResourceEntryById. // How the method works: // 1) Gets ResourceEntry from the drive service. // 2) Gets the file path of the resource. // 3) Runs the |callback|. - void GetEntryInfoByResourceIdAfterGetResourceEntry( + void GetResourceEntryByIdAfterGetResourceEntry( const GetResourceEntryWithFilePathCallback& callback, google_apis::GDataErrorCode error_in, scoped_ptr<google_apis::ResourceEntry> resource_entry); - void GetEntryInfoByResourceIdAfterGetFilePath( + void GetResourceEntryByIdAfterGetFilePath( const GetResourceEntryWithFilePathCallback& callback, FileError error, scoped_ptr<ResourceEntry> entry, @@ -188,14 +188,14 @@ class FakeFileSystem : public FileSystemInterface { // 2) Look at if there is a cache file or not. If found return it. // 3) Otherwise start DownloadFile. // 4) Runs the |completion_callback| upon the download completion. - void GetFileContentByPathAfterGetEntryInfo( + void GetFileContentByPathAfterGetResourceEntry( const base::FilePath& file_path, const GetFileContentInitializedCallback& initialized_callback, const google_apis::GetContentCallback& get_content_callback, const FileOperationCallback& completion_callback, FileError error, scoped_ptr<ResourceEntry> entry); - void GetFileContentByPathAfterGetResourceEntry( + void GetFileContentByPathAfterGetWapiResourceEntry( const base::FilePath& file_path, const GetFileContentInitializedCallback& initialized_callback, const google_apis::GetContentCallback& get_content_callback, @@ -207,7 +207,7 @@ class FakeFileSystem : public FileSystemInterface { google_apis::GDataErrorCode gdata_error, const base::FilePath& temp_file); - // Helpers of GetEntryInfoByPath. + // Helpers of GetResourceEntryByPath. // How the method works: // 1) If the path is root, gets AboutResrouce from the drive service // and create ResourceEntry. @@ -218,16 +218,16 @@ class FakeFileSystem : public FileSystemInterface { // not supported in FakeFileSystem. Thus, even if the server has // files sharing the same name under a directory, the second (or later) // file cannot be taken with the suffixed name. - void GetEntryInfoByPathAfterGetAboutResource( + void GetResourceEntryByPathAfterGetAboutResource( const GetResourceEntryCallback& callback, google_apis::GDataErrorCode gdata_error, scoped_ptr<google_apis::AboutResource> about_resource); - void GetEntryInfoByPathAfterGetParentEntryInfo( + void GetResourceEntryByPathAfterGetParentEntryInfo( const base::FilePath& base_name, const GetResourceEntryCallback& callback, FileError error, scoped_ptr<ResourceEntry> parent_entry); - void GetEntryInfoByPathAfterGetResourceList( + void GetResourceEntryByPathAfterGetResourceList( const base::FilePath& base_name, const GetResourceEntryCallback& callback, google_apis::GDataErrorCode gdata_error, diff --git a/chrome/browser/chromeos/drive/fake_file_system_unittest.cc b/chrome/browser/chromeos/drive/fake_file_system_unittest.cc index 44a0623..14251a7 100644 --- a/chrome/browser/chromeos/drive/fake_file_system_unittest.cc +++ b/chrome/browser/chromeos/drive/fake_file_system_unittest.cc @@ -44,12 +44,12 @@ class FakeFileSystemTest : public ::testing::Test { scoped_ptr<FakeFileSystem> fake_file_system_; }; -TEST_F(FakeFileSystemTest, GetEntryInfoByResourceId) { +TEST_F(FakeFileSystemTest, GetResourceEntryById) { FileError error = FILE_ERROR_FAILED; scoped_ptr<ResourceEntry> entry; base::FilePath file_path; - fake_file_system_->GetEntryInfoByResourceId( + fake_file_system_->GetResourceEntryById( "folder:sub_dir_folder_resource_id", google_apis::test_util::CreateCopyResultCallback( &error, &file_path, &entry)); @@ -64,15 +64,15 @@ TEST_F(FakeFileSystemTest, GetEntryInfoByResourceId) { } TEST_F(FakeFileSystemTest, - GetEntryInfoByResourceId_PathCompatibleWithGetEntryInfoByPath) { + GetResourceEntryById_PathCompatibleWithGetResourceEntryByPath) { const std::string document_resource_id = "document:5_document_resource_id"; FileError error = FILE_ERROR_FAILED; scoped_ptr<ResourceEntry> entry; base::FilePath file_path; - // Get entry info by resource id. - fake_file_system_->GetEntryInfoByResourceId( + // Get resource entry by resource id. + fake_file_system_->GetResourceEntryById( document_resource_id, google_apis::test_util::CreateCopyResultCallback( &error, &file_path, &entry)); @@ -82,10 +82,10 @@ TEST_F(FakeFileSystemTest, ASSERT_TRUE(entry); EXPECT_TRUE(entry->file_specific_info().is_hosted_document()); - // Get entry info by path given by GetEntryInfoByResourceId. + // Get resource entry by path given by GetResourceEntryById. error = FILE_ERROR_FAILED; entry.reset(); - fake_file_system_->GetEntryInfoByPath( + fake_file_system_->GetResourceEntryByPath( file_path, google_apis::test_util::CreateCopyResultCallback(&error, &entry)); google_apis::test_util::RunBlockingPoolTask(); @@ -177,10 +177,10 @@ TEST_F(FakeFileSystemTest, GetFileContentByPath_Directory) { EXPECT_EQ(FILE_ERROR_NOT_A_FILE, completion_error); } -TEST_F(FakeFileSystemTest, GetEntryInfoByPath) { +TEST_F(FakeFileSystemTest, GetResourceEntryByPath) { FileError error = FILE_ERROR_FAILED; scoped_ptr<ResourceEntry> entry; - fake_file_system_->GetEntryInfoByPath( + fake_file_system_->GetResourceEntryByPath( util::GetDriveMyDriveRootPath().AppendASCII( "Directory 1/Sub Directory Folder"), google_apis::test_util::CreateCopyResultCallback(&error, &entry)); @@ -191,10 +191,10 @@ TEST_F(FakeFileSystemTest, GetEntryInfoByPath) { EXPECT_EQ("folder:sub_dir_folder_resource_id", entry->resource_id()); } -TEST_F(FakeFileSystemTest, GetEntryInfoByPath_Root) { +TEST_F(FakeFileSystemTest, GetResourceEntryByPath_Root) { FileError error = FILE_ERROR_FAILED; scoped_ptr<ResourceEntry> entry; - fake_file_system_->GetEntryInfoByPath( + fake_file_system_->GetResourceEntryByPath( util::GetDriveMyDriveRootPath(), google_apis::test_util::CreateCopyResultCallback(&error, &entry)); google_apis::test_util::RunBlockingPoolTask(); @@ -206,10 +206,10 @@ TEST_F(FakeFileSystemTest, GetEntryInfoByPath_Root) { EXPECT_EQ(util::kDriveMyDriveRootDirName, entry->title()); } -TEST_F(FakeFileSystemTest, GetEntryInfoByPath_Invalid) { +TEST_F(FakeFileSystemTest, GetResourceEntryByPath_Invalid) { FileError error = FILE_ERROR_FAILED; scoped_ptr<ResourceEntry> entry; - fake_file_system_->GetEntryInfoByPath( + fake_file_system_->GetResourceEntryByPath( util::GetDriveMyDriveRootPath().AppendASCII("Invalid File Name"), google_apis::test_util::CreateCopyResultCallback(&error, &entry)); google_apis::test_util::RunBlockingPoolTask(); diff --git a/chrome/browser/chromeos/drive/file_system.cc b/chrome/browser/chromeos/drive/file_system.cc index 4f426a9..a845ae0 100644 --- a/chrome/browser/chromeos/drive/file_system.cc +++ b/chrome/browser/chromeos/drive/file_system.cc @@ -331,7 +331,7 @@ void FileSystem::RemoveObserver(FileSystemObserver* observer) { observers_.RemoveObserver(observer); } -void FileSystem::GetEntryInfoByResourceId( +void FileSystem::GetResourceEntryById( const std::string& resource_id, const GetResourceEntryWithFilePathCallback& callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); @@ -340,12 +340,12 @@ void FileSystem::GetEntryInfoByResourceId( resource_metadata_->GetResourceEntryByIdOnUIThread( resource_id, - base::Bind(&FileSystem::GetEntryInfoByResourceIdAfterGetEntry, + base::Bind(&FileSystem::GetResourceEntryByIdAfterGetEntry, weak_ptr_factory_.GetWeakPtr(), callback)); } -void FileSystem::GetEntryInfoByResourceIdAfterGetEntry( +void FileSystem::GetResourceEntryByIdAfterGetEntry( const GetResourceEntryWithFilePathCallback& callback, FileError error, const base::FilePath& file_path, @@ -457,13 +457,13 @@ void FileSystem::Pin(const base::FilePath& file_path, DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(!callback.is_null()); - GetEntryInfoByPath(file_path, - base::Bind(&FileSystem::PinAfterGetEntryInfoByPath, - weak_ptr_factory_.GetWeakPtr(), - callback)); + GetResourceEntryByPath(file_path, + base::Bind(&FileSystem::PinAfterGetResourceEntryByPath, + weak_ptr_factory_.GetWeakPtr(), + callback)); } -void FileSystem::PinAfterGetEntryInfoByPath( +void FileSystem::PinAfterGetResourceEntryByPath( const FileOperationCallback& callback, FileError error, scoped_ptr<ResourceEntry> entry) { @@ -489,13 +489,14 @@ void FileSystem::Unpin(const base::FilePath& file_path, DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(!callback.is_null()); - GetEntryInfoByPath(file_path, - base::Bind(&FileSystem::UnpinAfterGetEntryInfoByPath, - weak_ptr_factory_.GetWeakPtr(), - callback)); + GetResourceEntryByPath( + file_path, + base::Bind(&FileSystem::UnpinAfterGetResourceEntryByPath, + weak_ptr_factory_.GetWeakPtr(), + callback)); } -void FileSystem::UnpinAfterGetEntryInfoByPath( +void FileSystem::UnpinAfterGetResourceEntryByPath( const FileOperationCallback& callback, FileError error, scoped_ptr<ResourceEntry> entry) { @@ -523,13 +524,13 @@ void FileSystem::GetFileByPath(const base::FilePath& file_path, resource_metadata_->GetResourceEntryByPathOnUIThread( file_path, - base::Bind(&FileSystem::OnGetEntryInfoCompleteForGetFileByPath, + base::Bind(&FileSystem::OnGetResourceEntryCompleteForGetFileByPath, weak_ptr_factory_.GetWeakPtr(), file_path, callback)); } -void FileSystem::OnGetEntryInfoCompleteForGetFileByPath( +void FileSystem::OnGetResourceEntryCompleteForGetFileByPath( const base::FilePath& file_path, const GetFileCallback& callback, FileError error, @@ -646,8 +647,9 @@ void FileSystem::GetFileContentByPathAfterGetEntry( get_content_callback))); } -void FileSystem::GetEntryInfoByPath(const base::FilePath& file_path, - const GetResourceEntryCallback& callback) { +void FileSystem::GetResourceEntryByPath( + const base::FilePath& file_path, + const GetResourceEntryCallback& callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(!callback.is_null()); @@ -658,13 +660,13 @@ void FileSystem::GetEntryInfoByPath(const base::FilePath& file_path, // loading until the first call to ReadDirectoryByPath(). resource_metadata_->GetResourceEntryByPathOnUIThread( file_path, - base::Bind(&FileSystem::GetEntryInfoByPathAfterGetEntry1, + base::Bind(&FileSystem::GetResourceEntryByPathAfterGetEntry1, weak_ptr_factory_.GetWeakPtr(), file_path, callback)); } -void FileSystem::GetEntryInfoByPathAfterGetEntry1( +void FileSystem::GetResourceEntryByPathAfterGetEntry1( const base::FilePath& file_path, const GetResourceEntryCallback& callback, FileError error, @@ -681,13 +683,13 @@ void FileSystem::GetEntryInfoByPathAfterGetEntry1( // try fetching information of the directory and retry. LoadDirectoryIfNeeded( file_path.DirName(), - base::Bind(&FileSystem::GetEntryInfoByPathAfterLoad, + base::Bind(&FileSystem::GetResourceEntryByPathAfterLoad, weak_ptr_factory_.GetWeakPtr(), file_path, callback)); } -void FileSystem::GetEntryInfoByPathAfterLoad( +void FileSystem::GetResourceEntryByPathAfterLoad( const base::FilePath& file_path, const GetResourceEntryCallback& callback, FileError error) { @@ -701,12 +703,12 @@ void FileSystem::GetEntryInfoByPathAfterLoad( resource_metadata_->GetResourceEntryByPathOnUIThread( file_path, - base::Bind(&FileSystem::GetEntryInfoByPathAfterGetEntry2, + base::Bind(&FileSystem::GetResourceEntryByPathAfterGetEntry2, weak_ptr_factory_.GetWeakPtr(), callback)); } -void FileSystem::GetEntryInfoByPathAfterGetEntry2( +void FileSystem::GetResourceEntryByPathAfterGetEntry2( const GetResourceEntryCallback& callback, FileError error, scoped_ptr<ResourceEntry> entry) { @@ -741,7 +743,7 @@ void FileSystem::LoadDirectoryIfNeeded(const base::FilePath& directory_path, DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(!callback.is_null()); - // As described in GetEntryInfoByPath(), ResourceMetadata may know + // As described in GetResourceEntryByPath(), ResourceMetadata may know // about the entry even if the file system is not yet fully loaded, hence we // should just ask ResourceMetadata first. resource_metadata_->GetResourceEntryByPathOnUIThread( @@ -1140,13 +1142,13 @@ void FileSystem::RefreshDirectory( // Make sure the destination directory exists. resource_metadata_->GetResourceEntryByPathOnUIThread( directory_path, - base::Bind(&FileSystem::RefreshDirectoryAfterGetEntryInfo, + base::Bind(&FileSystem::RefreshDirectoryAfterGetResourceEntry, weak_ptr_factory_.GetWeakPtr(), directory_path, callback)); } -void FileSystem::RefreshDirectoryAfterGetEntryInfo( +void FileSystem::RefreshDirectoryAfterGetResourceEntry( const base::FilePath& directory_path, const FileOperationCallback& callback, FileError error, @@ -1355,13 +1357,13 @@ void FileSystem::MarkCacheFileAsMounted( DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(!callback.is_null()); - GetEntryInfoByPath( + GetResourceEntryByPath( drive_file_path, - base::Bind(&FileSystem::MarkCacheFileAsMountedAfterGetEntryInfo, + base::Bind(&FileSystem::MarkCacheFileAsMountedAfterGetResourceEntry, weak_ptr_factory_.GetWeakPtr(), callback)); } -void FileSystem::MarkCacheFileAsMountedAfterGetEntryInfo( +void FileSystem::MarkCacheFileAsMountedAfterGetResourceEntry( const OpenFileCallback& callback, FileError error, scoped_ptr<ResourceEntry> entry) { @@ -1456,7 +1458,7 @@ void FileSystem::OpenFile(const base::FilePath& file_path, resource_metadata_->GetResourceEntryByPathOnUIThread( file_path, - base::Bind(&FileSystem::OnGetEntryInfoCompleteForOpenFile, + base::Bind(&FileSystem::OnGetResourceEntryCompleteForOpenFile, weak_ptr_factory_.GetWeakPtr(), file_path, base::Bind(&FileSystem::OnOpenFileFinished, @@ -1465,7 +1467,7 @@ void FileSystem::OpenFile(const base::FilePath& file_path, callback))); } -void FileSystem::OnGetEntryInfoCompleteForOpenFile( +void FileSystem::OnGetResourceEntryCompleteForOpenFile( const base::FilePath& file_path, const OpenFileCallback& callback, FileError error, @@ -1579,7 +1581,7 @@ void FileSystem::CloseFile(const base::FilePath& file_path, // Step 1 of CloseFile: Get resource_id and md5 for |file_path|. resource_metadata_->GetResourceEntryByPathOnUIThread( file_path, - base::Bind(&FileSystem::CloseFileAfterGetEntryInfo, + base::Bind(&FileSystem::CloseFileAfterGetResourceEntry, weak_ptr_factory_.GetWeakPtr(), file_path, base::Bind(&FileSystem::CloseFileFinalize, @@ -1588,7 +1590,7 @@ void FileSystem::CloseFile(const base::FilePath& file_path, callback))); } -void FileSystem::CloseFileAfterGetEntryInfo( +void FileSystem::CloseFileAfterGetResourceEntry( const base::FilePath& file_path, const FileOperationCallback& callback, FileError error, @@ -1638,7 +1640,8 @@ void FileSystem::CheckLocalModificationAndRun( DCHECK(entry.get()); DCHECK(!callback.is_null()); - // For entries that will never be cached, use the original entry info as is. + // For entries that will never be cached, use the original resource entry + // as is. if (!entry->has_file_specific_info() || entry->file_specific_info().is_hosted_document()) { callback.Run(FILE_ERROR_OK, entry.Pass()); @@ -1666,7 +1669,7 @@ void FileSystem::CheckLocalModificationAndRunAfterGetCacheEntry( DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(!callback.is_null()); - // When no dirty cache is found, use the original entry info as is. + // When no dirty cache is found, use the original resource entry as is. if (!success || !cache_entry.is_dirty()) { callback.Run(FILE_ERROR_OK, entry.Pass()); return; @@ -1693,7 +1696,7 @@ void FileSystem::CheckLocalModificationAndRunAfterGetCacheFile( DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(!callback.is_null()); - // When no dirty cache is found, use the original entry info as is. + // When no dirty cache is found, use the original resource entry as is. if (error != FILE_ERROR_OK) { callback.Run(FILE_ERROR_OK, entry.Pass()); return; diff --git a/chrome/browser/chromeos/drive/file_system.h b/chrome/browser/chromeos/drive/file_system.h index d151424..6a47743 100644 --- a/chrome/browser/chromeos/drive/file_system.h +++ b/chrome/browser/chromeos/drive/file_system.h @@ -65,7 +65,7 @@ class FileSystem : public FileSystemInterface, virtual void AddObserver(FileSystemObserver* observer) OVERRIDE; virtual void RemoveObserver(FileSystemObserver* observer) OVERRIDE; virtual void CheckForUpdates() OVERRIDE; - virtual void GetEntryInfoByResourceId( + virtual void GetResourceEntryById( const std::string& resource_id, const GetResourceEntryWithFilePathCallback& callback) OVERRIDE; virtual void Search(const std::string& search_query, @@ -123,7 +123,7 @@ class FileSystem : public FileSystemInterface, const std::string& resource_id, const DriveClientContext& context, const FileOperationCallback& callback) OVERRIDE; - virtual void GetEntryInfoByPath( + virtual void GetResourceEntryByPath( const base::FilePath& file_path, const GetResourceEntryCallback& callback) OVERRIDE; virtual void ReadDirectoryByPath( @@ -204,28 +204,28 @@ class FileSystem : public FileSystemInterface, FileError load_error); // Used to implement Pin(). - void PinAfterGetEntryInfoByPath(const FileOperationCallback& callback, - FileError error, - scoped_ptr<ResourceEntry> entry); + void PinAfterGetResourceEntryByPath(const FileOperationCallback& callback, + FileError error, + scoped_ptr<ResourceEntry> entry); // Used to implement Unpin(). - void UnpinAfterGetEntryInfoByPath(const FileOperationCallback& callback, - FileError error, - scoped_ptr<ResourceEntry> entry); + void UnpinAfterGetResourceEntryByPath(const FileOperationCallback& callback, + FileError error, + scoped_ptr<ResourceEntry> entry); - // Invoked upon completion of GetEntryInfoByPath initiated by + // Invoked upon completion of GetResourceEntryByPath initiated by // GetFileByPath. It then continues to invoke GetResolvedFileByPath. // |callback| must not be null. - void OnGetEntryInfoCompleteForGetFileByPath( + void OnGetResourceEntryCompleteForGetFileByPath( const base::FilePath& file_path, const GetFileCallback& callback, FileError error, scoped_ptr<ResourceEntry> file_info); - // Invoked upon completion of GetEntryInfoByPath initiated by OpenFile. + // Invoked upon completion of GetResourceEntryByPath initiated by OpenFile. // It then continues to invoke GetResolvedFileByPath and proceeds to // OnGetFileCompleteForOpenFile. - void OnGetEntryInfoCompleteForOpenFile( + void OnGetResourceEntryCompleteForOpenFile( const base::FilePath& file_path, const OpenFileCallback& callback, FileError error, @@ -245,10 +245,10 @@ class FileSystem : public FileSystemInterface, // 3) Removes the |file_path| from the remembered set of opened files. // 4) Invokes the user-supplied |callback|. // |callback| must not be null. - void CloseFileAfterGetEntryInfo(const base::FilePath& file_path, - const FileOperationCallback& callback, - FileError error, - scoped_ptr<ResourceEntry> entry); + void CloseFileAfterGetResourceEntry(const base::FilePath& file_path, + const FileOperationCallback& callback, + FileError error, + scoped_ptr<ResourceEntry> entry); void CloseFileFinalize(const base::FilePath& file_path, const FileOperationCallback& callback, FileError result); @@ -288,21 +288,21 @@ class FileSystem : public FileSystemInterface, // Initializes preference change observer. void InitializePreferenceObserver(); - // Part of GetEntryInfoByPath() - // 1) Called when ResourceMetadata::GetEntryInfoByPath() is complete. - // If succeeded, GetEntryInfoByPath() returns immediately here. + // Part of GetResourceEntryByPath() + // 1) Called when ResourceMetadata::GetResourceEntryByPath() is complete. + // If succeeded, GetResourceEntryByPath() returns immediately here. // Otherwise, starts loading the file system. // 2) Called when LoadIfNeeded() is complete. - // 3) Called when ResourceMetadata::GetEntryInfoByPath() is complete. - void GetEntryInfoByPathAfterGetEntry1( + // 3) Called when ResourceMetadata::GetResourceEntryByPath() is complete. + void GetResourceEntryByPathAfterGetEntry1( const base::FilePath& file_path, const GetResourceEntryCallback& callback, FileError error, scoped_ptr<ResourceEntry> entry); - void GetEntryInfoByPathAfterLoad(const base::FilePath& file_path, - const GetResourceEntryCallback& callback, - FileError error); - void GetEntryInfoByPathAfterGetEntry2( + void GetResourceEntryByPathAfterLoad(const base::FilePath& file_path, + const GetResourceEntryCallback& callback, + FileError error); + void GetResourceEntryByPathAfterGetEntry2( const GetResourceEntryCallback& callback, FileError error, scoped_ptr<ResourceEntry> entry); @@ -332,7 +332,7 @@ class FileSystem : public FileSystemInterface, // Gets the file at |file_path| from the cache (if found in the cache), // or the server (if not found in the cache) after the file info is - // already resolved with GetEntryInfoByPath() or GetEntryInfoByResourceId(). + // already resolved with GetResourceEntryByPath() or GetResourceEntryById(). void GetResolvedFileByPath(scoped_ptr<GetResolvedFileParams> params); void GetResolvedFileByPathAfterCreateDocumentJsonFile( scoped_ptr<GetResolvedFileParams> params, @@ -379,17 +379,17 @@ class FileSystem : public FileSystemInterface, FileError error, const base::FilePath& cache_file); - // Part of GetEntryInfoByResourceId(). Called after - // ResourceMetadata::GetEntryInfoByResourceId() is complete. + // Part of GetResourceEntryById(). Called after + // ResourceMetadata::GetResourceEntryById() is complete. // |callback| must not be null. - void GetEntryInfoByResourceIdAfterGetEntry( + void GetResourceEntryByIdAfterGetEntry( const GetResourceEntryWithFilePathCallback& callback, FileError error, const base::FilePath& file_path, scoped_ptr<ResourceEntry> entry); // Part of GetFileByResourceId(). Called after - // ResourceMetadata::GetEntryInfoByResourceId() is complete. + // ResourceMetadata::GetResourceEntryById() is complete. // |get_file_callback| must not be null. // |get_content_callback| may be null. void GetFileByResourceIdAfterGetEntry( @@ -401,7 +401,7 @@ class FileSystem : public FileSystemInterface, scoped_ptr<ResourceEntry> entry); // Part of GetFileContentByPath(). Called after - // ResourceMetadata::GetEntryInfoByPath() is complete. + // ResourceMetadata::GetResourceEntryByPath() is complete. // |initialized_callback|, |get_content_callback| and |completion_callback| // must not be null. void GetFileContentByPathAfterGetEntry( @@ -413,8 +413,8 @@ class FileSystem : public FileSystemInterface, scoped_ptr<ResourceEntry> entry); // Part of RefreshDirectory(). Called after - // GetEntryInfoByPath() is complete. - void RefreshDirectoryAfterGetEntryInfo( + // GetResourceEntryByPath() is complete. + void RefreshDirectoryAfterGetResourceEntry( const base::FilePath& directory_path, const FileOperationCallback& callback, FileError error, @@ -442,9 +442,9 @@ class FileSystem : public FileSystemInterface, base::PlatformFileInfo* file_info, bool get_file_info_result); - // Part of MarkCacheFileAsMounted. Called after GetEntryInfoByPath is + // Part of MarkCacheFileAsMounted. Called after GetResourceEntryByPath is // completed. |callback| must not be null. - void MarkCacheFileAsMountedAfterGetEntryInfo( + void MarkCacheFileAsMountedAfterGetResourceEntry( const OpenFileCallback& callback, FileError error, scoped_ptr<ResourceEntry> entry); diff --git a/chrome/browser/chromeos/drive/file_system/copy_operation.cc b/chrome/browser/chromeos/drive/file_system/copy_operation.cc index 62c3854..8c50dd0 100644 --- a/chrome/browser/chromeos/drive/file_system/copy_operation.cc +++ b/chrome/browser/chromeos/drive/file_system/copy_operation.cc @@ -93,7 +93,7 @@ void CopyOperation::Copy(const base::FilePath& src_file_path, metadata_->GetResourceEntryPairByPathsOnUIThread( src_file_path, dest_file_path.DirName(), - base::Bind(&CopyOperation::CopyAfterGetEntryInfoPair, + base::Bind(&CopyOperation::CopyAfterGetResourceEntryPair, weak_ptr_factory_.GetWeakPtr(), dest_file_path, callback)); @@ -151,7 +151,7 @@ void CopyOperation::TransferFileFromLocalToRemote( metadata_->GetResourceEntryByPathOnUIThread( remote_dest_file_path.DirName(), base::Bind( - &CopyOperation::TransferFileFromLocalToRemoteAfterGetEntryInfo, + &CopyOperation::TransferFileFromLocalToRemoteAfterGetResourceEntry, weak_ptr_factory_.GetWeakPtr(), local_src_file_path, remote_dest_file_path, @@ -188,13 +188,14 @@ void CopyOperation::ScheduleTransferRegularFileAfterCreate( metadata_->GetResourceEntryByPathOnUIThread( remote_dest_file_path, - base::Bind(&CopyOperation::ScheduleTransferRegularFileAfterGetEntryInfo, - weak_ptr_factory_.GetWeakPtr(), - local_file_path, - callback)); + base::Bind( + &CopyOperation::ScheduleTransferRegularFileAfterGetResourceEntry, + weak_ptr_factory_.GetWeakPtr(), + local_file_path, + callback)); } -void CopyOperation::ScheduleTransferRegularFileAfterGetEntryInfo( +void CopyOperation::ScheduleTransferRegularFileAfterGetResourceEntry( const base::FilePath& local_file_path, const FileOperationCallback& callback, FileError error, @@ -276,7 +277,7 @@ void CopyOperation::MoveEntryFromRootDirectory( callback); } -void CopyOperation::CopyAfterGetEntryInfoPair( +void CopyOperation::CopyAfterGetResourceEntryPair( const base::FilePath& dest_file_path, const FileOperationCallback& callback, scoped_ptr<EntryInfoPairResult> result) { @@ -346,7 +347,7 @@ void CopyOperation::OnGetFileCompleteForCopy( ScheduleTransferRegularFile(local_file_path, remote_dest_file_path, callback); } -void CopyOperation::TransferFileFromLocalToRemoteAfterGetEntryInfo( +void CopyOperation::TransferFileFromLocalToRemoteAfterGetResourceEntry( const base::FilePath& local_src_file_path, const base::FilePath& remote_dest_file_path, const FileOperationCallback& callback, diff --git a/chrome/browser/chromeos/drive/file_system/copy_operation.h b/chrome/browser/chromeos/drive/file_system/copy_operation.h index f3e44f5..f1fadfd 100644 --- a/chrome/browser/chromeos/drive/file_system/copy_operation.h +++ b/chrome/browser/chromeos/drive/file_system/copy_operation.h @@ -88,7 +88,7 @@ class CopyOperation { const base::FilePath& remote_dest_file_path, const FileOperationCallback& callback, FileError error); - void ScheduleTransferRegularFileAfterGetEntryInfo( + void ScheduleTransferRegularFileAfterGetResourceEntry( const base::FilePath& local_file_path, const FileOperationCallback& callback, FileError error, @@ -137,9 +137,9 @@ class CopyOperation { FileError error, const base::FilePath& file_path); - // Part of Copy(). Called after GetEntryInfoPairByPaths() is + // Part of Copy(). Called after GetResourceEntryPairByPaths() is // complete. |callback| must not be null. - void CopyAfterGetEntryInfoPair(const base::FilePath& dest_file_path, + void CopyAfterGetResourceEntryPair(const base::FilePath& dest_file_path, const FileOperationCallback& callback, scoped_ptr<EntryInfoPairResult> result); @@ -155,8 +155,8 @@ class CopyOperation { scoped_ptr<ResourceEntry> entry); // Part of TransferFileFromLocalToRemote(). Called after - // GetEntryInfoByPath() is complete. - void TransferFileFromLocalToRemoteAfterGetEntryInfo( + // GetResourceEntryByPath() is complete. + void TransferFileFromLocalToRemoteAfterGetResourceEntry( const base::FilePath& local_src_file_path, const base::FilePath& remote_dest_file_path, const FileOperationCallback& callback, diff --git a/chrome/browser/chromeos/drive/file_system/create_directory_operation.h b/chrome/browser/chromeos/drive/file_system/create_directory_operation.h index 5d536165..42bfaa9 100644 --- a/chrome/browser/chromeos/drive/file_system/create_directory_operation.h +++ b/chrome/browser/chromeos/drive/file_system/create_directory_operation.h @@ -137,7 +137,7 @@ class CreateDirectoryOperation { void FindFirstMissingParentDirectoryInternal( scoped_ptr<FindFirstMissingParentDirectoryParams> params); - // Callback for ResourceMetadata::GetEntryInfoByPath from + // Callback for ResourceMetadata::GetResourceEntryByPath from // FindFirstMissingParentDirectory. void ContinueFindFirstMissingParentDirectory( scoped_ptr<FindFirstMissingParentDirectoryParams> params, diff --git a/chrome/browser/chromeos/drive/file_system/create_file_operation.cc b/chrome/browser/chromeos/drive/file_system/create_file_operation.cc index 513fb1b..6ae3be2 100644 --- a/chrome/browser/chromeos/drive/file_system/create_file_operation.cc +++ b/chrome/browser/chromeos/drive/file_system/create_file_operation.cc @@ -51,14 +51,14 @@ void CreateFileOperation::CreateFile(const base::FilePath& file_path, metadata_->GetResourceEntryPairByPathsOnUIThread( file_path.DirName(), file_path, - base::Bind(&CreateFileOperation::CreateFileAfterGetEntryInfo, + base::Bind(&CreateFileOperation::CreateFileAfterGetResourceEntry, weak_ptr_factory_.GetWeakPtr(), file_path, is_exclusive, callback)); } -void CreateFileOperation::CreateFileAfterGetEntryInfo( +void CreateFileOperation::CreateFileAfterGetResourceEntry( const base::FilePath& file_path, bool is_exclusive, const FileOperationCallback& callback, diff --git a/chrome/browser/chromeos/drive/file_system/create_file_operation.h b/chrome/browser/chromeos/drive/file_system/create_file_operation.h index 795f7ba..2e6ac1b 100644 --- a/chrome/browser/chromeos/drive/file_system/create_file_operation.h +++ b/chrome/browser/chromeos/drive/file_system/create_file_operation.h @@ -51,10 +51,11 @@ class CreateFileOperation { const FileOperationCallback& callback); private: - void CreateFileAfterGetEntryInfo(const base::FilePath& file_path, - bool is_exclusive, - const FileOperationCallback& callback, - scoped_ptr<EntryInfoPairResult> pair_result); + void CreateFileAfterGetResourceEntry( + const base::FilePath& file_path, + bool is_exclusive, + const FileOperationCallback& callback, + scoped_ptr<EntryInfoPairResult> pair_result); void CreateFileAfterGetMimeType(const base::FilePath& file_path, const std::string& parent_resource_id, diff --git a/chrome/browser/chromeos/drive/file_system/move_operation.cc b/chrome/browser/chromeos/drive/file_system/move_operation.cc index 1cd76bd..3053bef 100644 --- a/chrome/browser/chromeos/drive/file_system/move_operation.cc +++ b/chrome/browser/chromeos/drive/file_system/move_operation.cc @@ -39,13 +39,13 @@ void MoveOperation::Move(const base::FilePath& src_file_path, metadata_->GetResourceEntryPairByPathsOnUIThread( src_file_path, dest_file_path.DirName(), - base::Bind(&MoveOperation::MoveAfterGetEntryInfoPair, + base::Bind(&MoveOperation::MoveAfterGetResourceEntryPair, weak_ptr_factory_.GetWeakPtr(), dest_file_path, callback)); } -void MoveOperation::MoveAfterGetEntryInfoPair( +void MoveOperation::MoveAfterGetResourceEntryPair( const base::FilePath& dest_file_path, const FileOperationCallback& callback, scoped_ptr<EntryInfoPairResult> src_dest_info) { diff --git a/chrome/browser/chromeos/drive/file_system/move_operation.h b/chrome/browser/chromeos/drive/file_system/move_operation.h index c4367f6..61fac1a 100644 --- a/chrome/browser/chromeos/drive/file_system/move_operation.h +++ b/chrome/browser/chromeos/drive/file_system/move_operation.h @@ -47,12 +47,13 @@ class MoveOperation { const base::FilePath& dest_file_path, const FileOperationCallback& callback); private: - // Step 1 of Move(), called after the entry info of the source resource and - // the destination directory is obtained. It renames the resource in the - // source directory, before moving between directories. - void MoveAfterGetEntryInfoPair(const base::FilePath& dest_file_path, - const FileOperationCallback& callback, - scoped_ptr<EntryInfoPairResult> src_dest_info); + // Step 1 of Move(), called after the resource entry of the source and the + // destination directory is obtained. It renames the resource in the source + // directory, before moving between directories. + void MoveAfterGetResourceEntryPair( + const base::FilePath& dest_file_path, + const FileOperationCallback& callback, + scoped_ptr<EntryInfoPairResult> src_dest_info); // Step 2 of Move(), called after renaming is completed. It adds the resource // to the destination directory. diff --git a/chrome/browser/chromeos/drive/file_system/remove_operation.cc b/chrome/browser/chromeos/drive/file_system/remove_operation.cc index f8ddd0a..819df87 100644 --- a/chrome/browser/chromeos/drive/file_system/remove_operation.cc +++ b/chrome/browser/chromeos/drive/file_system/remove_operation.cc @@ -50,12 +50,12 @@ void RemoveOperation::Remove( metadata_->GetResourceEntryByPathOnUIThread( file_path, base::Bind( - &RemoveOperation::RemoveAfterGetEntryInfo, + &RemoveOperation::RemoveAfterGetResourceEntry, weak_ptr_factory_.GetWeakPtr(), callback)); } -void RemoveOperation::RemoveAfterGetEntryInfo( +void RemoveOperation::RemoveAfterGetResourceEntry( const FileOperationCallback& callback, FileError error, scoped_ptr<ResourceEntry> entry) { diff --git a/chrome/browser/chromeos/drive/file_system/remove_operation.h b/chrome/browser/chromeos/drive/file_system/remove_operation.h index eda6633..a13686a 100644 --- a/chrome/browser/chromeos/drive/file_system/remove_operation.h +++ b/chrome/browser/chromeos/drive/file_system/remove_operation.h @@ -51,9 +51,9 @@ class RemoveOperation { const FileOperationCallback& callback); private: - // Part of Remove(). Called after GetEntryInfoByPath() is complete. + // Part of Remove(). Called after GetResourceEntryByPath() is complete. // |callback| must not be null. - void RemoveAfterGetEntryInfo( + void RemoveAfterGetResourceEntry( const FileOperationCallback& callback, FileError error, scoped_ptr<ResourceEntry> entry); diff --git a/chrome/browser/chromeos/drive/file_system/update_operation.cc b/chrome/browser/chromeos/drive/file_system/update_operation.cc index d887d9c..8cea06b 100644 --- a/chrome/browser/chromeos/drive/file_system/update_operation.cc +++ b/chrome/browser/chromeos/drive/file_system/update_operation.cc @@ -44,7 +44,7 @@ void UpdateOperation::UpdateFileByResourceId( DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(!callback.is_null()); - // TODO(satorux): GetEntryInfoByResourceId() is called twice for + // TODO(satorux): GetResourceEntryById() is called twice for // UpdateFileByResourceId(). crbug.com/143873 metadata_->GetResourceEntryByIdOnUIThread( resource_id, diff --git a/chrome/browser/chromeos/drive/file_system/update_operation.h b/chrome/browser/chromeos/drive/file_system/update_operation.h index a32ba28..372d6b4 100644 --- a/chrome/browser/chromeos/drive/file_system/update_operation.h +++ b/chrome/browser/chromeos/drive/file_system/update_operation.h @@ -58,7 +58,7 @@ class UpdateOperation { private: // Part of UpdateFileByResourceId(). Called when - // ResourceMetadata::GetEntryInfoByResourceId() is complete. + // ResourceMetadata::GetResourceEntryById() is complete. // |callback| must not be null. void UpdateFileByEntryInfo( DriveClientContext context, diff --git a/chrome/browser/chromeos/drive/file_system_interface.h b/chrome/browser/chromeos/drive/file_system_interface.h index 35d817e7..aeace09 100644 --- a/chrome/browser/chromeos/drive/file_system_interface.h +++ b/chrome/browser/chromeos/drive/file_system_interface.h @@ -167,7 +167,7 @@ class FileSystemInterface { // does not initiate content refreshing. // // |callback| must not be null. - virtual void GetEntryInfoByResourceId( + virtual void GetResourceEntryById( const std::string& resource_id, const GetResourceEntryWithFilePathCallback& callback) = 0; @@ -353,7 +353,7 @@ class FileSystemInterface { // retrieve and refresh file system content from server and disk cache. // // |callback| must not be null. - virtual void GetEntryInfoByPath( + virtual void GetResourceEntryByPath( const base::FilePath& file_path, const GetResourceEntryCallback& callback) = 0; diff --git a/chrome/browser/chromeos/drive/file_system_proxy.cc b/chrome/browser/chromeos/drive/file_system_proxy.cc index 9d6310f..6a7c598 100644 --- a/chrome/browser/chromeos/drive/file_system_proxy.cc +++ b/chrome/browser/chromeos/drive/file_system_proxy.cc @@ -196,7 +196,7 @@ void FileSystemProxy::GetFileInfo( } CallFileSystemMethodOnUIThread( - base::Bind(&FileSystemInterface::GetEntryInfoByPath, + base::Bind(&FileSystemInterface::GetResourceEntryByPath, base::Unretained(file_system_), file_path, google_apis::CreateRelayCallback( @@ -644,17 +644,17 @@ void FileSystemProxy::CreateSnapshotFile( } CallFileSystemMethodOnUIThread( - base::Bind(&FileSystemInterface::GetEntryInfoByPath, + base::Bind(&FileSystemInterface::GetResourceEntryByPath, base::Unretained(file_system_), file_path, google_apis::CreateRelayCallback( - base::Bind(&FileSystemProxy::OnGetEntryInfoByPath, + base::Bind(&FileSystemProxy::OnGetResourceEntryByPath, this, file_path, callback)))); } -void FileSystemProxy::OnGetEntryInfoByPath( +void FileSystemProxy::OnGetResourceEntryByPath( const base::FilePath& entry_path, const FileSystemOperation::SnapshotFileCallback& callback, FileError error, diff --git a/chrome/browser/chromeos/drive/file_system_proxy.h b/chrome/browser/chromeos/drive/file_system_proxy.h index c21bb9c..21d1fcc 100644 --- a/chrome/browser/chromeos/drive/file_system_proxy.h +++ b/chrome/browser/chromeos/drive/file_system_proxy.h @@ -127,9 +127,9 @@ class FileSystemProxy : public fileapi::RemoteFileSystemProxyInterface { FileError error, scoped_ptr<ResourceEntry> entry); - // Helper callback for relaying reply for GetEntryInfoByPath() to the + // Helper callback for relaying reply for GetResourceEntryByPath() to the // calling thread. - void OnGetEntryInfoByPath( + void OnGetResourceEntryByPath( const base::FilePath& entry_path, const fileapi::FileSystemOperation::SnapshotFileCallback& callback, diff --git a/chrome/browser/chromeos/drive/file_system_unittest.cc b/chrome/browser/chromeos/drive/file_system_unittest.cc index 6d959a5..4742ddb 100644 --- a/chrome/browser/chromeos/drive/file_system_unittest.cc +++ b/chrome/browser/chromeos/drive/file_system_unittest.cc @@ -233,12 +233,12 @@ class DriveFileSystemTest : public testing::Test { return error == FILE_ERROR_OK; } - // Gets entry info by path synchronously. - scoped_ptr<ResourceEntry> GetEntryInfoByPathSync( + // Gets resource entry by path synchronously. + scoped_ptr<ResourceEntry> GetResourceEntryByPathSync( const base::FilePath& file_path) { FileError error = FILE_ERROR_FAILED; scoped_ptr<ResourceEntry> entry; - file_system_->GetEntryInfoByPath( + file_system_->GetResourceEntryByPath( file_path, google_apis::test_util::CreateCopyResultCallback(&error, &entry)); google_apis::test_util::RunBlockingPoolTask(); @@ -263,13 +263,13 @@ class DriveFileSystemTest : public testing::Test { // Returns true if an entry exists at |file_path|. bool EntryExists(const base::FilePath& file_path) { - return GetEntryInfoByPathSync(file_path); + return GetResourceEntryByPathSync(file_path); } // Gets the resource ID of |file_path|. Returns an empty string if not found. std::string GetResourceIdByPath(const base::FilePath& file_path) { scoped_ptr<ResourceEntry> entry = - GetEntryInfoByPathSync(file_path); + GetResourceEntryByPathSync(file_path); if (entry) return entry->resource_id(); else @@ -466,14 +466,14 @@ TEST_F(DriveFileSystemTest, DuplicatedAsyncInitialization) { const GetResourceEntryCallback& callback = base::Bind( &AsyncInitializationCallback, &counter, 2, &message_loop_); - file_system_->GetEntryInfoByPath( + file_system_->GetResourceEntryByPath( base::FilePath(FILE_PATH_LITERAL("drive/root")), callback); - file_system_->GetEntryInfoByPath( + file_system_->GetResourceEntryByPath( base::FilePath(FILE_PATH_LITERAL("drive/root")), callback); message_loop_.Run(); // Wait to get our result EXPECT_EQ(2, counter); - // Although GetEntryInfoByPath() was called twice, the resource list + // Although GetResourceEntryByPath() was called twice, the resource list // should only be loaded once. In the past, there was a bug that caused // it to be loaded twice. EXPECT_EQ(1, fake_drive_service_->resource_list_load_count()); @@ -483,7 +483,7 @@ TEST_F(DriveFileSystemTest, DuplicatedAsyncInitialization) { TEST_F(DriveFileSystemTest, GetGrandRootEntry) { const base::FilePath kFilePath(FILE_PATH_LITERAL("drive")); - scoped_ptr<ResourceEntry> entry = GetEntryInfoByPathSync(kFilePath); + scoped_ptr<ResourceEntry> entry = GetResourceEntryByPathSync(kFilePath); ASSERT_TRUE(entry); EXPECT_EQ(util::kDriveGrandRootSpecialResourceId, entry->resource_id()); @@ -494,7 +494,7 @@ TEST_F(DriveFileSystemTest, GetGrandRootEntry) { TEST_F(DriveFileSystemTest, GetOtherDirEntry) { const base::FilePath kFilePath(FILE_PATH_LITERAL("drive/other")); - scoped_ptr<ResourceEntry> entry = GetEntryInfoByPathSync(kFilePath); + scoped_ptr<ResourceEntry> entry = GetResourceEntryByPathSync(kFilePath); ASSERT_TRUE(entry); EXPECT_EQ(util::kDriveOtherDirSpecialResourceId, entry->resource_id()); @@ -510,7 +510,7 @@ TEST_F(DriveFileSystemTest, GetMyDriveRoot) { Eq(base::FilePath(FILE_PATH_LITERAL("drive"))))).Times(1); const base::FilePath kFilePath(FILE_PATH_LITERAL("drive/root")); - scoped_ptr<ResourceEntry> entry = GetEntryInfoByPathSync(kFilePath); + scoped_ptr<ResourceEntry> entry = GetResourceEntryByPathSync(kFilePath); ASSERT_TRUE(entry); EXPECT_EQ(fake_drive_service_->GetRootResourceId(), entry->resource_id()); @@ -529,7 +529,7 @@ TEST_F(DriveFileSystemTest, GetMyDriveRoot) { TEST_F(DriveFileSystemTest, GetExistingFile) { const base::FilePath kFilePath(FILE_PATH_LITERAL("drive/root/File 1.txt")); - scoped_ptr<ResourceEntry> entry = GetEntryInfoByPathSync(kFilePath); + scoped_ptr<ResourceEntry> entry = GetResourceEntryByPathSync(kFilePath); ASSERT_TRUE(entry); EXPECT_EQ("file:2_file_resource_id", entry->resource_id()); @@ -540,7 +540,7 @@ TEST_F(DriveFileSystemTest, GetExistingFile) { TEST_F(DriveFileSystemTest, GetExistingDocument) { const base::FilePath kFilePath( FILE_PATH_LITERAL("drive/root/Document 1 excludeDir-test.gdoc")); - scoped_ptr<ResourceEntry> entry = GetEntryInfoByPathSync(kFilePath); + scoped_ptr<ResourceEntry> entry = GetResourceEntryByPathSync(kFilePath); ASSERT_TRUE(entry); EXPECT_EQ("document:5_document_resource_id", entry->resource_id()); } @@ -548,25 +548,25 @@ TEST_F(DriveFileSystemTest, GetExistingDocument) { TEST_F(DriveFileSystemTest, GetNonExistingFile) { const base::FilePath kFilePath( FILE_PATH_LITERAL("drive/root/nonexisting.file")); - scoped_ptr<ResourceEntry> entry = GetEntryInfoByPathSync(kFilePath); + scoped_ptr<ResourceEntry> entry = GetResourceEntryByPathSync(kFilePath); EXPECT_FALSE(entry); } TEST_F(DriveFileSystemTest, GetEncodedFileNames) { const base::FilePath kFilePath1( FILE_PATH_LITERAL("drive/root/Slash / in file 1.txt")); - scoped_ptr<ResourceEntry> entry = GetEntryInfoByPathSync(kFilePath1); + scoped_ptr<ResourceEntry> entry = GetResourceEntryByPathSync(kFilePath1); ASSERT_FALSE(entry); const base::FilePath kFilePath2 = base::FilePath::FromUTF8Unsafe( "drive/root/Slash \xE2\x88\x95 in file 1.txt"); - entry = GetEntryInfoByPathSync(kFilePath2); + entry = GetResourceEntryByPathSync(kFilePath2); ASSERT_TRUE(entry); EXPECT_EQ("file:slash_file_resource_id", entry->resource_id()); const base::FilePath kFilePath3 = base::FilePath::FromUTF8Unsafe( "drive/root/Slash \xE2\x88\x95 in directory/Slash SubDir File.txt"); - entry = GetEntryInfoByPathSync(kFilePath3); + entry = GetResourceEntryByPathSync(kFilePath3); ASSERT_TRUE(entry); EXPECT_EQ("file:slash_subdir_file", entry->resource_id()); } @@ -574,13 +574,13 @@ TEST_F(DriveFileSystemTest, GetEncodedFileNames) { TEST_F(DriveFileSystemTest, GetDuplicateNames) { const base::FilePath kFilePath1( FILE_PATH_LITERAL("drive/root/Duplicate Name.txt")); - scoped_ptr<ResourceEntry> entry = GetEntryInfoByPathSync(kFilePath1); + scoped_ptr<ResourceEntry> entry = GetResourceEntryByPathSync(kFilePath1); ASSERT_TRUE(entry); const std::string resource_id1 = entry->resource_id(); const base::FilePath kFilePath2( FILE_PATH_LITERAL("drive/root/Duplicate Name (2).txt")); - entry = GetEntryInfoByPathSync(kFilePath2); + entry = GetResourceEntryByPathSync(kFilePath2); ASSERT_TRUE(entry); const std::string resource_id2 = entry->resource_id(); @@ -596,7 +596,7 @@ TEST_F(DriveFileSystemTest, GetDuplicateNames) { TEST_F(DriveFileSystemTest, GetExistingDirectory) { const base::FilePath kFilePath(FILE_PATH_LITERAL("drive/root/Directory 1")); - scoped_ptr<ResourceEntry> entry = GetEntryInfoByPathSync(kFilePath); + scoped_ptr<ResourceEntry> entry = GetResourceEntryByPathSync(kFilePath); ASSERT_TRUE(entry); ASSERT_EQ("folder:1_folder_resource_id", entry->resource_id()); @@ -609,7 +609,7 @@ TEST_F(DriveFileSystemTest, GetInSubSubdir) { const base::FilePath kFilePath( FILE_PATH_LITERAL("drive/root/Directory 1/Sub Directory Folder/" "Sub Sub Directory Folder")); - scoped_ptr<ResourceEntry> entry = GetEntryInfoByPathSync(kFilePath); + scoped_ptr<ResourceEntry> entry = GetResourceEntryByPathSync(kFilePath); ASSERT_TRUE(entry); ASSERT_EQ("folder:sub_sub_directory_folder_id", entry->resource_id()); } @@ -617,7 +617,7 @@ TEST_F(DriveFileSystemTest, GetInSubSubdir) { TEST_F(DriveFileSystemTest, GetOrphanFile) { const base::FilePath kFilePath( FILE_PATH_LITERAL("drive/other/Orphan File 1.txt")); - scoped_ptr<ResourceEntry> entry = GetEntryInfoByPathSync(kFilePath); + scoped_ptr<ResourceEntry> entry = GetResourceEntryByPathSync(kFilePath); ASSERT_TRUE(entry); EXPECT_EQ("file:1_orphanfile_resource_id", entry->resource_id()); } @@ -914,18 +914,18 @@ TEST_F(DriveFileSystemTest, ReadDirectoryWhileRefreshing) { EXPECT_EQ(1, fake_drive_service_->directory_load_count()); } -TEST_F(DriveFileSystemTest, GetEntryInfoExistingWhileRefreshing) { +TEST_F(DriveFileSystemTest, GetResourceEntryExistingWhileRefreshing) { // Enter the "refreshing" state. ASSERT_TRUE(SetUpTestFileSystem(USE_OLD_TIMESTAMP)); file_system_->CheckForUpdates(); // If an entry is already found in local metadata, no directory fetch happens. - EXPECT_TRUE(GetEntryInfoByPathSync(base::FilePath( + EXPECT_TRUE(GetResourceEntryByPathSync(base::FilePath( FILE_PATH_LITERAL("drive/root/Dir1/File2")))); EXPECT_EQ(0, fake_drive_service_->directory_load_count()); } -TEST_F(DriveFileSystemTest, GetEntryInfoNonExistentWhileRefreshing) { +TEST_F(DriveFileSystemTest, GetResourceEntryNonExistentWhileRefreshing) { EXPECT_CALL(*mock_directory_observer_, OnDirectoryChanged(_)) .Times(AtLeast(1)); @@ -934,7 +934,7 @@ TEST_F(DriveFileSystemTest, GetEntryInfoNonExistentWhileRefreshing) { file_system_->CheckForUpdates(); // If an entry is not found, parent directory's resource list is fetched. - EXPECT_FALSE(GetEntryInfoByPathSync(base::FilePath( + EXPECT_FALSE(GetResourceEntryByPathSync(base::FilePath( FILE_PATH_LITERAL("drive/root/Dir1/NonExistentFile")))); EXPECT_EQ(1, fake_drive_service_->directory_load_count()); } @@ -1042,7 +1042,7 @@ TEST_F(DriveFileSystemTest, TransferFileFromRemoteToLocal_RegularFile) { base::FilePath remote_src_file_path( FILE_PATH_LITERAL("drive/root/File 1.txt")); - scoped_ptr<ResourceEntry> file = GetEntryInfoByPathSync( + scoped_ptr<ResourceEntry> file = GetResourceEntryByPathSync( remote_src_file_path); const int64 file_size = file->file_info().size(); @@ -1097,7 +1097,7 @@ TEST_F(DriveFileSystemTest, TransferFileFromRemoteToLocal_HostedDocument) { EXPECT_EQ(FILE_ERROR_OK, error); - scoped_ptr<ResourceEntry> entry = GetEntryInfoByPathSync( + scoped_ptr<ResourceEntry> entry = GetResourceEntryByPathSync( remote_src_file_path); ASSERT_TRUE(entry); VerifyHostedDocumentJSONFile(*entry, local_dest_file_path); @@ -1131,7 +1131,7 @@ TEST_F(DriveFileSystemTest, CopyFileToNonExistingDirectory) { ASSERT_TRUE(LoadRootFeedDocument()); ASSERT_TRUE(EntryExists(src_file_path)); - scoped_ptr<ResourceEntry> src_entry = GetEntryInfoByPathSync( + scoped_ptr<ResourceEntry> src_entry = GetResourceEntryByPathSync( src_file_path); ASSERT_TRUE(src_entry); std::string src_file_path_resource_id = src_entry->resource_id(); @@ -1164,13 +1164,13 @@ TEST_F(DriveFileSystemTest, CopyFileToInvalidPath) { ASSERT_TRUE(LoadRootFeedDocument()); ASSERT_TRUE(EntryExists(src_file_path)); - scoped_ptr<ResourceEntry> src_entry = GetEntryInfoByPathSync( + scoped_ptr<ResourceEntry> src_entry = GetResourceEntryByPathSync( src_file_path); ASSERT_TRUE(src_entry); std::string src_file_resource_id = src_entry->resource_id(); ASSERT_TRUE(EntryExists(dest_parent_path)); - scoped_ptr<ResourceEntry> dest_entry = GetEntryInfoByPathSync( + scoped_ptr<ResourceEntry> dest_entry = GetResourceEntryByPathSync( dest_parent_path); ASSERT_TRUE(dest_entry); @@ -1200,7 +1200,7 @@ TEST_F(DriveFileSystemTest, RenameFile) { ASSERT_TRUE(LoadRootFeedDocument()); ASSERT_TRUE(EntryExists(src_file_path)); - scoped_ptr<ResourceEntry> src_entry = GetEntryInfoByPathSync( + scoped_ptr<ResourceEntry> src_entry = GetResourceEntryByPathSync( src_file_path); ASSERT_TRUE(src_entry); std::string src_file_resource_id = @@ -1232,13 +1232,13 @@ TEST_F(DriveFileSystemTest, MoveFileFromRootToSubDirectory) { ASSERT_TRUE(LoadRootFeedDocument()); ASSERT_TRUE(EntryExists(src_file_path)); - scoped_ptr<ResourceEntry> src_entry = GetEntryInfoByPathSync( + scoped_ptr<ResourceEntry> src_entry = GetResourceEntryByPathSync( src_file_path); ASSERT_TRUE(src_entry); std::string src_file_resource_id = src_entry->resource_id(); ASSERT_TRUE(EntryExists(dest_parent_path)); - scoped_ptr<ResourceEntry> dest_parent_proto = GetEntryInfoByPathSync( + scoped_ptr<ResourceEntry> dest_parent_proto = GetResourceEntryByPathSync( dest_parent_path); ASSERT_TRUE(dest_parent_proto); ASSERT_TRUE(dest_parent_proto->file_info().is_directory()); @@ -1272,13 +1272,13 @@ TEST_F(DriveFileSystemTest, MoveFileFromSubDirectoryToRoot) { ASSERT_TRUE(LoadRootFeedDocument()); ASSERT_TRUE(EntryExists(src_file_path)); - scoped_ptr<ResourceEntry> src_entry = GetEntryInfoByPathSync( + scoped_ptr<ResourceEntry> src_entry = GetResourceEntryByPathSync( src_file_path); ASSERT_TRUE(src_entry); std::string src_file_resource_id = src_entry->resource_id(); ASSERT_TRUE(EntryExists(src_parent_path)); - scoped_ptr<ResourceEntry> src_parent_proto = GetEntryInfoByPathSync( + scoped_ptr<ResourceEntry> src_parent_proto = GetResourceEntryByPathSync( src_parent_path); ASSERT_TRUE(src_parent_proto); ASSERT_TRUE(src_parent_proto->file_info().is_directory()); @@ -1320,19 +1320,19 @@ TEST_F(DriveFileSystemTest, MoveFileBetweenSubDirectories) { EXPECT_EQ(FILE_ERROR_OK, AddDirectory(dest_parent_path)); ASSERT_TRUE(EntryExists(src_file_path)); - scoped_ptr<ResourceEntry> src_entry = GetEntryInfoByPathSync( + scoped_ptr<ResourceEntry> src_entry = GetResourceEntryByPathSync( src_file_path); ASSERT_TRUE(src_entry); std::string src_file_resource_id = src_entry->resource_id(); ASSERT_TRUE(EntryExists(src_parent_path)); - scoped_ptr<ResourceEntry> src_parent_proto = GetEntryInfoByPathSync( + scoped_ptr<ResourceEntry> src_parent_proto = GetResourceEntryByPathSync( src_parent_path); ASSERT_TRUE(src_parent_proto); ASSERT_TRUE(src_parent_proto->file_info().is_directory()); ASSERT_TRUE(EntryExists(dest_parent_path)); - scoped_ptr<ResourceEntry> dest_parent_proto = GetEntryInfoByPathSync( + scoped_ptr<ResourceEntry> dest_parent_proto = GetResourceEntryByPathSync( dest_parent_path); ASSERT_TRUE(dest_parent_proto); ASSERT_TRUE(dest_parent_proto->file_info().is_directory()); @@ -1391,7 +1391,7 @@ TEST_F(DriveFileSystemTest, MoveFileToNonExistingDirectory) { ASSERT_TRUE(LoadRootFeedDocument()); ASSERT_TRUE(EntryExists(src_file_path)); - scoped_ptr<ResourceEntry> src_entry = GetEntryInfoByPathSync( + scoped_ptr<ResourceEntry> src_entry = GetResourceEntryByPathSync( src_file_path); ASSERT_TRUE(src_entry); std::string src_file_resource_id = src_entry->resource_id(); @@ -1422,13 +1422,13 @@ TEST_F(DriveFileSystemTest, MoveFileToInvalidPath) { ASSERT_TRUE(LoadRootFeedDocument()); ASSERT_TRUE(EntryExists(src_file_path)); - scoped_ptr<ResourceEntry> src_entry = GetEntryInfoByPathSync( + scoped_ptr<ResourceEntry> src_entry = GetResourceEntryByPathSync( src_file_path); ASSERT_TRUE(src_entry); std::string src_file_resource_id = src_entry->resource_id(); ASSERT_TRUE(EntryExists(dest_parent_path)); - scoped_ptr<ResourceEntry> dest_parent_proto = GetEntryInfoByPathSync( + scoped_ptr<ResourceEntry> dest_parent_proto = GetResourceEntryByPathSync( dest_parent_path); ASSERT_TRUE(dest_parent_proto); @@ -1456,18 +1456,18 @@ TEST_F(DriveFileSystemTest, RemoveEntries) { FILE_PATH_LITERAL("drive/root/Directory 1/SubDirectory File 1.txt")); ASSERT_TRUE(EntryExists(file_in_root)); - scoped_ptr<ResourceEntry> file_in_root_proto = GetEntryInfoByPathSync( + scoped_ptr<ResourceEntry> file_in_root_proto = GetResourceEntryByPathSync( file_in_root); ASSERT_TRUE(file_in_root_proto); ASSERT_TRUE(EntryExists(dir_in_root)); - scoped_ptr<ResourceEntry> dir_in_root_proto = GetEntryInfoByPathSync( + scoped_ptr<ResourceEntry> dir_in_root_proto = GetResourceEntryByPathSync( dir_in_root); ASSERT_TRUE(dir_in_root_proto); ASSERT_TRUE(dir_in_root_proto->file_info().is_directory()); ASSERT_TRUE(EntryExists(file_in_subdir)); - scoped_ptr<ResourceEntry> file_in_subdir_proto = GetEntryInfoByPathSync( + scoped_ptr<ResourceEntry> file_in_subdir_proto = GetResourceEntryByPathSync( file_in_subdir); ASSERT_TRUE(file_in_subdir_proto); @@ -1548,7 +1548,7 @@ TEST_F(DriveFileSystemTest, PinAndUnpin) { base::FilePath file_path(FILE_PATH_LITERAL("drive/root/File 1.txt")); // Get the file info. - scoped_ptr<ResourceEntry> entry(GetEntryInfoByPathSync(file_path)); + scoped_ptr<ResourceEntry> entry(GetResourceEntryByPathSync(file_path)); ASSERT_TRUE(entry); // Pin the file. @@ -1581,7 +1581,7 @@ TEST_F(DriveFileSystemTest, GetFileByPath_FromGData_EnoughSpace) { Eq(base::FilePath(FILE_PATH_LITERAL("drive/root"))))).Times(1); base::FilePath file_in_root(FILE_PATH_LITERAL("drive/root/File 1.txt")); - scoped_ptr<ResourceEntry> entry(GetEntryInfoByPathSync(file_in_root)); + scoped_ptr<ResourceEntry> entry(GetResourceEntryByPathSync(file_in_root)); const int64 file_size = entry->file_info().size(); // Pretend we have enough space. @@ -1637,7 +1637,7 @@ TEST_F(DriveFileSystemTest, GetFileByPath_FromGData_NoEnoughSpaceButCanFreeUp) { Eq(base::FilePath(FILE_PATH_LITERAL("drive/root"))))).Times(1); base::FilePath file_in_root(FILE_PATH_LITERAL("drive/root/File 1.txt")); - scoped_ptr<ResourceEntry> entry(GetEntryInfoByPathSync(file_in_root)); + scoped_ptr<ResourceEntry> entry(GetResourceEntryByPathSync(file_in_root)); const int64 file_size = entry->file_info().size(); // Pretend we have no space first (checked before downloading a file), @@ -1687,7 +1687,7 @@ TEST_F(DriveFileSystemTest, GetFileByPath_FromGData_EnoughSpaceButBecomeFull) { ASSERT_TRUE(LoadRootFeedDocument()); base::FilePath file_in_root(FILE_PATH_LITERAL("drive/root/File 1.txt")); - scoped_ptr<ResourceEntry> entry(GetEntryInfoByPathSync(file_in_root)); + scoped_ptr<ResourceEntry> entry(GetResourceEntryByPathSync(file_in_root)); const int64 file_size = entry->file_info().size(); // Pretend we have enough space first (checked before downloading a file), @@ -1718,7 +1718,7 @@ TEST_F(DriveFileSystemTest, GetFileByPath_FromCache) { ASSERT_TRUE(LoadRootFeedDocument()); base::FilePath file_in_root(FILE_PATH_LITERAL("drive/root/File 1.txt")); - scoped_ptr<ResourceEntry> entry(GetEntryInfoByPathSync(file_in_root)); + scoped_ptr<ResourceEntry> entry(GetResourceEntryByPathSync(file_in_root)); // Store something as cached version of this file. FileError error = FILE_ERROR_OK; @@ -1749,7 +1749,7 @@ TEST_F(DriveFileSystemTest, GetFileByPath_HostedDocument) { base::FilePath file_in_root(FILE_PATH_LITERAL( "drive/root/Document 1 excludeDir-test.gdoc")); scoped_ptr<ResourceEntry> src_entry = - GetEntryInfoByPathSync(file_in_root); + GetResourceEntryByPathSync(file_in_root); ASSERT_TRUE(src_entry); FileError error = FILE_ERROR_FAILED; @@ -1780,7 +1780,7 @@ TEST_F(DriveFileSystemTest, GetFileByResourceId) { ASSERT_TRUE(LoadRootFeedDocument()); base::FilePath file_in_root(FILE_PATH_LITERAL("drive/root/File 1.txt")); - scoped_ptr<ResourceEntry> entry(GetEntryInfoByPathSync(file_in_root)); + scoped_ptr<ResourceEntry> entry(GetResourceEntryByPathSync(file_in_root)); std::string resource_id = entry->resource_id(); FileError error = FILE_ERROR_OK; @@ -1884,7 +1884,7 @@ TEST_F(DriveFileSystemTest, GetFileByResourceId_FromCache) { ASSERT_TRUE(LoadRootFeedDocument()); base::FilePath file_in_root(FILE_PATH_LITERAL("drive/root/File 1.txt")); - scoped_ptr<ResourceEntry> entry(GetEntryInfoByPathSync(file_in_root)); + scoped_ptr<ResourceEntry> entry(GetResourceEntryByPathSync(file_in_root)); // Store something as cached version of this file. FileError error = FILE_ERROR_FAILED; @@ -2122,7 +2122,7 @@ TEST_F(DriveFileSystemTest, OpenAndCloseFile) { Eq(base::FilePath(FILE_PATH_LITERAL("drive/root"))))).Times(1); const base::FilePath kFileInRoot(FILE_PATH_LITERAL("drive/root/File 1.txt")); - scoped_ptr<ResourceEntry> entry(GetEntryInfoByPathSync(kFileInRoot)); + scoped_ptr<ResourceEntry> entry(GetResourceEntryByPathSync(kFileInRoot)); const int64 file_size = entry->file_info().size(); const std::string& file_resource_id = entry->resource_id(); @@ -2236,7 +2236,7 @@ TEST_F(DriveFileSystemTest, MarkCacheFileAsMountedAndUnmounted) { ASSERT_TRUE(LoadRootFeedDocument()); base::FilePath file_in_root(FILE_PATH_LITERAL("drive/root/File 1.txt")); - scoped_ptr<ResourceEntry> entry(GetEntryInfoByPathSync(file_in_root)); + scoped_ptr<ResourceEntry> entry(GetResourceEntryByPathSync(file_in_root)); ASSERT_TRUE(entry); // Write to cache. diff --git a/chrome/browser/chromeos/drive/file_task_executor.cc b/chrome/browser/chromeos/drive/file_task_executor.cc index ffda5b7..3e0944b 100644 --- a/chrome/browser/chromeos/drive/file_task_executor.cc +++ b/chrome/browser/chromeos/drive/file_task_executor.cc @@ -67,7 +67,7 @@ bool FileTaskExecutor::ExecuteAndNotify( for (std::vector<base::FilePath>::const_iterator iter = raw_paths.begin(); iter != raw_paths.end(); ++iter) { - file_system->GetEntryInfoByPath( + file_system->GetResourceEntryByPath( *iter, base::Bind(&FileTaskExecutor::OnFileEntryFetched, this)); } diff --git a/chrome/browser/chromeos/drive/mock_file_system.h b/chrome/browser/chromeos/drive/mock_file_system.h index f02853a..88bf8d6 100644 --- a/chrome/browser/chromeos/drive/mock_file_system.h +++ b/chrome/browser/chromeos/drive/mock_file_system.h @@ -26,7 +26,7 @@ class MockFileSystem : public FileSystemInterface { MOCK_METHOD1(RemoveObserver, void(FileSystemObserver* observer)); MOCK_METHOD0(CheckForUpdates, void()); - MOCK_METHOD2(GetEntryInfoByResourceId, + MOCK_METHOD2(GetResourceEntryById, void(const std::string& resource_id, const GetResourceEntryWithFilePathCallback& callback)); MOCK_METHOD3(Search, void(const std::string& search_query, @@ -89,7 +89,7 @@ class MockFileSystem : public FileSystemInterface { void(const std::string& resource_id, const DriveClientContext& context, const FileOperationCallback& callback)); - MOCK_METHOD2(GetEntryInfoByPath, + MOCK_METHOD2(GetResourceEntryByPath, void(const base::FilePath& file_path, const GetResourceEntryCallback& callback)); MOCK_METHOD2(ReadDirectoryByPath, diff --git a/chrome/browser/chromeos/drive/resource_metadata_storage.h b/chrome/browser/chromeos/drive/resource_metadata_storage.h index 8f1d64e..fe609a9 100644 --- a/chrome/browser/chromeos/drive/resource_metadata_storage.h +++ b/chrome/browser/chromeos/drive/resource_metadata_storage.h @@ -23,8 +23,8 @@ namespace drive { class ResourceEntry; class ResourceMetadataHeader; -// Storage for ResourceMetadata which is responsible to manage entry info -// and child-parent relationships between entries. +// Storage for ResourceMetadata which is responsible to manage resource +// entries and child-parent relationships between entries. class ResourceMetadataStorage { public: // This should be incremented when incompatibility change is made to DB diff --git a/chrome/browser/chromeos/drive/resource_metadata_unittest.cc b/chrome/browser/chromeos/drive/resource_metadata_unittest.cc index 0c351fd..af0c518 100644 --- a/chrome/browser/chromeos/drive/resource_metadata_unittest.cc +++ b/chrome/browser/chromeos/drive/resource_metadata_unittest.cc @@ -102,7 +102,7 @@ class ResourceMetadataTest : public testing::Test { base::ThreadRestrictions::SetIOAllowed(true); } - // Gets the entry info by path synchronously. Returns NULL on failure. + // Gets the resource entry by path synchronously. Returns NULL on failure. scoped_ptr<ResourceEntry> GetResourceEntryByPathSync( const base::FilePath& file_path) { FileError error = FILE_ERROR_OK; diff --git a/chrome/browser/chromeos/drive/stale_cache_files_remover.cc b/chrome/browser/chromeos/drive/stale_cache_files_remover.cc index 93d6332..c304127 100644 --- a/chrome/browser/chromeos/drive/stale_cache_files_remover.cc +++ b/chrome/browser/chromeos/drive/stale_cache_files_remover.cc @@ -45,17 +45,17 @@ void StaleCacheFilesRemover::OnInitialLoadFinished() { cache_->IterateOnUIThread( base::Bind( - &StaleCacheFilesRemover::GetEntryInfoAndRemoveCacheIfNecessary, + &StaleCacheFilesRemover::GetResourceEntryAndRemoveCacheIfNecessary, weak_ptr_factory_.GetWeakPtr()), base::Bind(&base::DoNothing)); } -void StaleCacheFilesRemover::GetEntryInfoAndRemoveCacheIfNecessary( +void StaleCacheFilesRemover::GetResourceEntryAndRemoveCacheIfNecessary( const std::string& resource_id, const FileCacheEntry& cache_entry) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - file_system_->GetEntryInfoByResourceId( + file_system_->GetResourceEntryById( resource_id, base::Bind(&StaleCacheFilesRemover::RemoveCacheIfNecessary, weak_ptr_factory_.GetWeakPtr(), diff --git a/chrome/browser/chromeos/drive/stale_cache_files_remover.h b/chrome/browser/chromeos/drive/stale_cache_files_remover.h index b96a316..26a433f 100644 --- a/chrome/browser/chromeos/drive/stale_cache_files_remover.h +++ b/chrome/browser/chromeos/drive/stale_cache_files_remover.h @@ -39,7 +39,7 @@ class StaleCacheFilesRemover : public FileSystemObserver { // Gets the file entry and calls RemoveCacheIfNecessary() with the file entry. // This is called from StaleCacheFilesRemover::OnInitialLoadFinished. - void GetEntryInfoAndRemoveCacheIfNecessary( + void GetResourceEntryAndRemoveCacheIfNecessary( const std::string& resource_id, const FileCacheEntry& cache_entry); diff --git a/chrome/browser/chromeos/drive/stale_cache_files_remover_unittest.cc b/chrome/browser/chromeos/drive/stale_cache_files_remover_unittest.cc index 3d42c50..685f3b6 100644 --- a/chrome/browser/chromeos/drive/stale_cache_files_remover_unittest.cc +++ b/chrome/browser/chromeos/drive/stale_cache_files_remover_unittest.cc @@ -139,7 +139,7 @@ TEST_F(StaleCacheFilesRemoverTest, RemoveStaleCacheFiles) { base::FilePath unused; scoped_ptr<ResourceEntry> entry; - file_system_->GetEntryInfoByResourceId( + file_system_->GetResourceEntryById( resource_id, google_apis::test_util::CreateCopyResultCallback( &error, &unused, &entry)); diff --git a/chrome/browser/chromeos/drive/sync_client.cc b/chrome/browser/chromeos/drive/sync_client.cc index d9c401e..e429494 100644 --- a/chrome/browser/chromeos/drive/sync_client.cc +++ b/chrome/browser/chromeos/drive/sync_client.cc @@ -232,16 +232,16 @@ void SyncClient::OnGetResourceIdOfExistingPinnedFile( DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (cache_entry.is_pinned() && cache_entry.is_present()) { - file_system_->GetEntryInfoByResourceId( + file_system_->GetResourceEntryById( resource_id, - base::Bind(&SyncClient::OnGetEntryInfoByResourceId, + base::Bind(&SyncClient::OnGetResourceEntryById, weak_ptr_factory_.GetWeakPtr(), resource_id, cache_entry)); } } -void SyncClient::OnGetEntryInfoByResourceId( +void SyncClient::OnGetResourceEntryById( const std::string& resource_id, const FileCacheEntry& cache_entry, FileError error, diff --git a/chrome/browser/chromeos/drive/sync_client.h b/chrome/browser/chromeos/drive/sync_client.h index 04de7a3..4c1e356 100644 --- a/chrome/browser/chromeos/drive/sync_client.h +++ b/chrome/browser/chromeos/drive/sync_client.h @@ -108,11 +108,11 @@ class SyncClient : public FileSystemObserver, const FileCacheEntry& cache_entry); // Called when a file entry is obtained. - void OnGetEntryInfoByResourceId(const std::string& resource_id, - const FileCacheEntry& cache_entry, - FileError error, - const base::FilePath& file_path, - scoped_ptr<ResourceEntry> entry); + void OnGetResourceEntryById(const std::string& resource_id, + const FileCacheEntry& cache_entry, + FileError error, + const base::FilePath& file_path, + scoped_ptr<ResourceEntry> entry); // Called when a cache entry is obtained. void OnGetCacheEntry(const std::string& resource_id, diff --git a/chrome/browser/chromeos/drive/sync_client_unittest.cc b/chrome/browser/chromeos/drive/sync_client_unittest.cc index 63848c4..356fd97 100644 --- a/chrome/browser/chromeos/drive/sync_client_unittest.cc +++ b/chrome/browser/chromeos/drive/sync_client_unittest.cc @@ -187,7 +187,7 @@ class SyncClientTest : public testing::Test { const std::string& resource_id, const std::string& new_md5) { EXPECT_CALL(*mock_file_system_, - GetEntryInfoByResourceId(resource_id, _)) + GetResourceEntryById(resource_id, _)) .WillOnce(MockUpdateFileByResourceId( FILE_ERROR_OK, new_md5)); diff --git a/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api.cc b/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api.cc index 8013857..92a8566 100644 --- a/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api.cc +++ b/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api.cc @@ -2335,7 +2335,7 @@ bool GetDriveEntryPropertiesFunction::RunImpl() { return true; } - system_service->file_system()->GetEntryInfoByPath( + system_service->file_system()->GetResourceEntryByPath( file_path_, base::Bind(&GetDriveEntryPropertiesFunction::OnGetFileInfo, this)); return true; diff --git a/chrome/browser/chromeos/extensions/file_manager/file_manager_browsertest.cc b/chrome/browser/chromeos/extensions/file_manager/file_manager_browsertest.cc index 51b9616..097638f 100644 --- a/chrome/browser/chromeos/extensions/file_manager/file_manager_browsertest.cc +++ b/chrome/browser/chromeos/extensions/file_manager/file_manager_browsertest.cc @@ -472,7 +472,7 @@ class DriveTestVolume : public TestVolume, drive::FileError error = drive::FILE_ERROR_FAILED; scoped_ptr<drive::ResourceEntry> entry_proto; - system_service_->file_system()->GetEntryInfoByPath( + system_service_->file_system()->GetResourceEntryByPath( file_path, google_apis::test_util::CreateCopyResultCallback(&error, &entry_proto)); google_apis::test_util::RunBlockingPoolTask(); @@ -533,7 +533,7 @@ class DriveTestVolume : public TestVolume, drive::FileError error = drive::FILE_ERROR_FAILED; scoped_ptr<drive::ResourceEntry> entry_proto; - system_service_->file_system()->GetEntryInfoByPath( + system_service_->file_system()->GetResourceEntryByPath( file_path, google_apis::test_util::CreateCopyResultCallback(&error, &entry_proto)); google_apis::test_util::RunBlockingPoolTask(); @@ -550,7 +550,7 @@ class DriveTestVolume : public TestVolume, drive::FileError error = drive::FILE_ERROR_FAILED; scoped_ptr<drive::ResourceEntry> entry_proto; - system_service_->file_system()->GetEntryInfoByPath( + system_service_->file_system()->GetResourceEntryByPath( file_path, google_apis::test_util::CreateCopyResultCallback(&error, &entry_proto)); google_apis::test_util::RunBlockingPoolTask(); diff --git a/chrome/browser/ui/webui/chromeos/drive_internals_ui.cc b/chrome/browser/ui/webui/chromeos/drive_internals_ui.cc index e7b25a7..ee8ffd4 100644 --- a/chrome/browser/ui/webui/chromeos/drive_internals_ui.cc +++ b/chrome/browser/ui/webui/chromeos/drive_internals_ui.cc @@ -232,10 +232,10 @@ class DriveInternalsWebUIHandler : public content::WebUIMessageHandler { void OnGetGCacheContents(base::ListValue* gcache_contents, base::DictionaryValue* cache_summary); - // Called when GetEntryInfoByPath() is complete. - void OnGetEntryInfoByPath(const base::FilePath& path, - drive::FileError error, - scoped_ptr<drive::ResourceEntry> entry); + // Called when GetResourceEntryByPath() is complete. + void OnGetResourceEntryByPath(const base::FilePath& path, + drive::FileError error, + scoped_ptr<drive::ResourceEntry> entry); // Called when ReadDirectoryByPath() is complete. void OnReadDirectoryByPath(const base::FilePath& parent_path, @@ -626,9 +626,9 @@ void DriveInternalsWebUIHandler::UpdateFileSystemContentsSection() { // Start rendering the file system tree as text. const base::FilePath root_path = drive::util::GetDriveGrandRootPath(); - system_service->file_system()->GetEntryInfoByPath( + system_service->file_system()->GetResourceEntryByPath( root_path, - base::Bind(&DriveInternalsWebUIHandler::OnGetEntryInfoByPath, + base::Bind(&DriveInternalsWebUIHandler::OnGetResourceEntryByPath, weak_ptr_factory_.GetWeakPtr(), root_path)); @@ -703,7 +703,7 @@ void DriveInternalsWebUIHandler::OnGetGCacheContents( *gcache_summary); } -void DriveInternalsWebUIHandler::OnGetEntryInfoByPath( +void DriveInternalsWebUIHandler::OnGetResourceEntryByPath( const base::FilePath& path, drive::FileError error, scoped_ptr<drive::ResourceEntry> entry) { |