Index: chrome/browser/chromeos/drive/drive_file_system.cc |
diff --git a/chrome/browser/chromeos/drive/drive_file_system.cc b/chrome/browser/chromeos/drive/drive_file_system.cc |
index 42b9c19e21291472195a4b46c577462ce5936066..3bea7f8737cd11f8e07aee43d4fc67010d4f4f01 100644 |
--- a/chrome/browser/chromeos/drive/drive_file_system.cc |
+++ b/chrome/browser/chromeos/drive/drive_file_system.cc |
@@ -38,7 +38,7 @@ |
using content::BrowserThread; |
-namespace gdata { |
+namespace drive { |
namespace { |
const char kMimeTypeJson[] = "application/json"; |
@@ -195,7 +195,7 @@ void GetDocumentResourceIdOnBlockingPool( |
std::string* resource_id) { |
DCHECK(resource_id); |
- if (DocumentEntry::HasHostedDocumentExtension(local_file_path)) { |
+ if (gdata::DocumentEntry::HasHostedDocumentExtension(local_file_path)) { |
std::string error; |
DictionaryValue* dict_value = NULL; |
JSONFileValueSerializer serializer(local_file_path); |
@@ -355,7 +355,7 @@ struct DriveFileSystem::GetFileFromCacheParams { |
const std::string& md5, |
const std::string& mime_type, |
const GetFileCallback& get_file_callback, |
- const GetContentCallback& get_content_callback) |
+ const gdata::GetContentCallback& get_content_callback) |
: virtual_file_path(virtual_file_path), |
local_tmp_path(local_tmp_path), |
content_url(content_url), |
@@ -374,7 +374,7 @@ struct DriveFileSystem::GetFileFromCacheParams { |
std::string md5; |
std::string mime_type; |
GetFileCallback get_file_callback; |
- GetContentCallback get_content_callback; |
+ gdata::GetContentCallback get_content_callback; |
}; |
// DriveFileSystem::StartFileUploadParams implementation. |
@@ -393,9 +393,9 @@ struct DriveFileSystem::StartFileUploadParams { |
// DriveFileSystem::AddUploadedFileParams implementation. |
struct DriveFileSystem::AddUploadedFileParams { |
- AddUploadedFileParams(UploadMode upload_mode, |
+ AddUploadedFileParams(gdata::UploadMode upload_mode, |
const FilePath& directory_path, |
- scoped_ptr<DocumentEntry> doc_entry, |
+ scoped_ptr<gdata::DocumentEntry> doc_entry, |
const FilePath& file_content_path, |
DriveCache::FileOperationType cache_operation, |
const base::Closure& callback) |
@@ -407,9 +407,9 @@ struct DriveFileSystem::AddUploadedFileParams { |
callback(callback) { |
} |
- UploadMode upload_mode; |
+ gdata::UploadMode upload_mode; |
FilePath directory_path; |
- scoped_ptr<DocumentEntry> doc_entry; |
+ scoped_ptr<gdata::DocumentEntry> doc_entry; |
FilePath file_content_path; |
DriveCache::FileOperationType cache_operation; |
base::Closure callback; |
@@ -575,11 +575,11 @@ void DriveFileSystem::GetEntryInfoByResourceId( |
BrowserThread::CurrentlyOn(BrowserThread::IO)); |
DCHECK(!callback.is_null()); |
- RunTaskOnUIThread( |
+ gdata::RunTaskOnUIThread( |
base::Bind(&DriveFileSystem::GetEntryInfoByResourceIdOnUIThread, |
ui_weak_ptr_, |
resource_id, |
- CreateRelayCallback(callback))); |
+ gdata::CreateRelayCallback(callback))); |
} |
void DriveFileSystem::GetEntryInfoByResourceIdOnUIThread( |
@@ -659,7 +659,7 @@ void DriveFileSystem::TransferFileFromRemoteToLocal( |
ui_weak_ptr_, |
local_dest_file_path, |
callback), |
- GetContentCallback()); |
+ gdata::GetContentCallback()); |
} |
void DriveFileSystem::TransferFileFromLocalToRemote( |
@@ -702,7 +702,7 @@ void DriveFileSystem::TransferFileFromLocalToRemoteAfterGetEntryInfo( |
} |
std::string* resource_id = new std::string; |
- util::PostBlockingPoolSequencedTaskAndReply( |
+ gdata::util::PostBlockingPoolSequencedTaskAndReply( |
FROM_HERE, |
blocking_task_runner_, |
base::Bind(&GetDocumentResourceIdOnBlockingPool, |
@@ -752,7 +752,7 @@ void DriveFileSystem::TransferRegularFile( |
new DriveFileError(DRIVE_FILE_OK); |
int64* file_size = new int64; |
std::string* content_type = new std::string; |
- util::PostBlockingPoolSequencedTaskAndReply( |
+ gdata::util::PostBlockingPoolSequencedTaskAndReply( |
FROM_HERE, |
blocking_task_runner_, |
base::Bind(&GetLocalFileInfoOnBlockingPool, |
@@ -836,11 +836,11 @@ void DriveFileSystem::OnTransferCompleted( |
DriveFileError error, |
const FilePath& drive_path, |
const FilePath& file_path, |
- scoped_ptr<DocumentEntry> document_entry) { |
+ scoped_ptr<gdata::DocumentEntry> document_entry) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
if (error == DRIVE_FILE_OK && document_entry.get()) { |
- AddUploadedFile(UPLOAD_NEW_FILE, |
+ AddUploadedFile(gdata::UPLOAD_NEW_FILE, |
drive_path.DirName(), |
document_entry.Pass(), |
file_path, |
@@ -858,11 +858,11 @@ void DriveFileSystem::Copy(const FilePath& src_file_path, |
BrowserThread::CurrentlyOn(BrowserThread::IO)); |
DCHECK(!callback.is_null()); |
- RunTaskOnUIThread(base::Bind(&DriveFileSystem::CopyOnUIThread, |
+ gdata::RunTaskOnUIThread(base::Bind(&DriveFileSystem::CopyOnUIThread, |
satorux1
2012/10/12 05:32:56
fixed the indent, and elsewhere in the file.
|
ui_weak_ptr_, |
src_file_path, |
dest_file_path, |
- CreateRelayCallback(callback))); |
+ gdata::CreateRelayCallback(callback))); |
} |
void DriveFileSystem::CopyOnUIThread(const FilePath& src_file_path, |
@@ -928,7 +928,7 @@ void DriveFileSystem::CopyOnUIThreadAfterGetEntryInfoPair( |
ui_weak_ptr_, |
dest_file_path, |
callback), |
- GetContentCallback()); |
+ gdata::GetContentCallback()); |
} |
void DriveFileSystem::OnGetFileCompleteForCopy( |
@@ -971,7 +971,7 @@ void DriveFileSystem::OnGetFileCompleteForTransferFile( |
// CopyLocalFileOnBlockingPool. |
DriveFileError* copy_file_error = |
new DriveFileError(DRIVE_FILE_OK); |
- util::PostBlockingPoolSequencedTaskAndReply( |
+ gdata::util::PostBlockingPoolSequencedTaskAndReply( |
FROM_HERE, |
blocking_task_runner_, |
base::Bind(&CopyLocalFileOnBlockingPool, |
@@ -1005,11 +1005,11 @@ void DriveFileSystem::Move(const FilePath& src_file_path, |
BrowserThread::CurrentlyOn(BrowserThread::IO)); |
DCHECK(!callback.is_null()); |
- RunTaskOnUIThread(base::Bind(&DriveFileSystem::MoveOnUIThread, |
+ gdata::RunTaskOnUIThread(base::Bind(&DriveFileSystem::MoveOnUIThread, |
ui_weak_ptr_, |
src_file_path, |
dest_file_path, |
- CreateRelayCallback(callback))); |
+ gdata::CreateRelayCallback(callback))); |
} |
void DriveFileSystem::MoveOnUIThread(const FilePath& src_file_path, |
@@ -1087,11 +1087,11 @@ void DriveFileSystem::Remove(const FilePath& file_path, |
BrowserThread::CurrentlyOn(BrowserThread::IO)); |
DCHECK(!callback.is_null()); |
- RunTaskOnUIThread(base::Bind(&DriveFileSystem::RemoveOnUIThread, |
+ gdata::RunTaskOnUIThread(base::Bind(&DriveFileSystem::RemoveOnUIThread, |
ui_weak_ptr_, |
file_path, |
is_recursive, |
- CreateRelayCallback(callback))); |
+ gdata::CreateRelayCallback(callback))); |
} |
void DriveFileSystem::RemoveOnUIThread( |
@@ -1113,12 +1113,13 @@ void DriveFileSystem::CreateDirectory( |
BrowserThread::CurrentlyOn(BrowserThread::IO)); |
DCHECK(!callback.is_null()); |
- RunTaskOnUIThread(base::Bind(&DriveFileSystem::CreateDirectoryOnUIThread, |
- ui_weak_ptr_, |
- directory_path, |
- is_exclusive, |
- is_recursive, |
- CreateRelayCallback(callback))); |
+ gdata::RunTaskOnUIThread( |
+ base::Bind(&DriveFileSystem::CreateDirectoryOnUIThread, |
+ ui_weak_ptr_, |
+ directory_path, |
+ is_exclusive, |
+ is_recursive, |
+ gdata::CreateRelayCallback(callback))); |
} |
void DriveFileSystem::CreateDirectoryOnUIThread( |
@@ -1195,11 +1196,11 @@ void DriveFileSystem::CreateFile(const FilePath& file_path, |
BrowserThread::CurrentlyOn(BrowserThread::IO)); |
DCHECK(!callback.is_null()); |
- RunTaskOnUIThread(base::Bind(&DriveFileSystem::CreateFileOnUIThread, |
+ gdata::RunTaskOnUIThread(base::Bind(&DriveFileSystem::CreateFileOnUIThread, |
ui_weak_ptr_, |
file_path, |
is_exclusive, |
- CreateRelayCallback(callback))); |
+ gdata::CreateRelayCallback(callback))); |
} |
void DriveFileSystem::CreateFileOnUIThread( |
@@ -1261,23 +1262,23 @@ void DriveFileSystem::OnGetEntryInfoForCreateFile( |
void DriveFileSystem::GetFileByPath( |
const FilePath& file_path, |
const GetFileCallback& get_file_callback, |
- const GetContentCallback& get_content_callback) { |
+ const gdata::GetContentCallback& get_content_callback) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) || |
BrowserThread::CurrentlyOn(BrowserThread::IO)); |
DCHECK(!get_file_callback.is_null()); |
- RunTaskOnUIThread( |
+ gdata::RunTaskOnUIThread( |
base::Bind(&DriveFileSystem::GetFileByPathOnUIThread, |
ui_weak_ptr_, |
file_path, |
- CreateRelayCallback(get_file_callback), |
- CreateRelayCallback(get_content_callback))); |
+ gdata::CreateRelayCallback(get_file_callback), |
+ gdata::CreateRelayCallback(get_content_callback))); |
} |
void DriveFileSystem::GetFileByPathOnUIThread( |
const FilePath& file_path, |
const GetFileCallback& get_file_callback, |
- const GetContentCallback& get_content_callback) { |
+ const gdata::GetContentCallback& get_content_callback) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
DCHECK(!get_file_callback.is_null()); |
@@ -1286,14 +1287,14 @@ void DriveFileSystem::GetFileByPathOnUIThread( |
base::Bind(&DriveFileSystem::OnGetEntryInfoCompleteForGetFileByPath, |
ui_weak_ptr_, |
file_path, |
- CreateRelayCallback(get_file_callback), |
- CreateRelayCallback(get_content_callback))); |
+ gdata::CreateRelayCallback(get_file_callback), |
+ gdata::CreateRelayCallback(get_content_callback))); |
} |
void DriveFileSystem::OnGetEntryInfoCompleteForGetFileByPath( |
const FilePath& file_path, |
const GetFileCallback& get_file_callback, |
- const GetContentCallback& get_content_callback, |
+ const gdata::GetContentCallback& get_content_callback, |
DriveFileError error, |
scoped_ptr<DriveEntryProto> entry_proto) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
@@ -1314,7 +1315,7 @@ void DriveFileSystem::OnGetEntryInfoCompleteForGetFileByPath( |
void DriveFileSystem::GetResolvedFileByPath( |
const FilePath& file_path, |
const GetFileCallback& get_file_callback, |
- const GetContentCallback& get_content_callback, |
+ const gdata::GetContentCallback& get_content_callback, |
scoped_ptr<DriveEntryProto> entry_proto) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
DCHECK(!get_file_callback.is_null()); |
@@ -1338,7 +1339,7 @@ void DriveFileSystem::GetResolvedFileByPath( |
FilePath* temp_file_path = new FilePath; |
std::string* mime_type = new std::string; |
DriveFileType* file_type = new DriveFileType(REGULAR_FILE); |
- util::PostBlockingPoolSequencedTaskAndReply( |
+ gdata::util::PostBlockingPoolSequencedTaskAndReply( |
FROM_HERE, |
blocking_task_runner_, |
base::Bind(&CreateDocumentJsonFileOnBlockingPool, |
@@ -1385,21 +1386,21 @@ void DriveFileSystem::GetResolvedFileByPath( |
void DriveFileSystem::GetFileByResourceId( |
const std::string& resource_id, |
const GetFileCallback& get_file_callback, |
- const GetContentCallback& get_content_callback) { |
+ const gdata::GetContentCallback& get_content_callback) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) || |
BrowserThread::CurrentlyOn(BrowserThread::IO)); |
- RunTaskOnUIThread( |
+ gdata::RunTaskOnUIThread( |
base::Bind(&DriveFileSystem::GetFileByResourceIdOnUIThread, |
ui_weak_ptr_, |
resource_id, |
- CreateRelayCallback(get_file_callback), |
- CreateRelayCallback(get_content_callback))); |
+ gdata::CreateRelayCallback(get_file_callback), |
+ gdata::CreateRelayCallback(get_content_callback))); |
} |
void DriveFileSystem::GetFileByResourceIdOnUIThread( |
const std::string& resource_id, |
const GetFileCallback& get_file_callback, |
- const GetContentCallback& get_content_callback) { |
+ const gdata::GetContentCallback& get_content_callback) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
DCHECK(!get_file_callback.is_null()); |
@@ -1413,7 +1414,7 @@ void DriveFileSystem::GetFileByResourceIdOnUIThread( |
void DriveFileSystem::GetFileByResourceIdAfterGetEntry( |
const GetFileCallback& get_file_callback, |
- const GetContentCallback& get_content_callback, |
+ const gdata::GetContentCallback& get_content_callback, |
DriveFileError error, |
const FilePath& file_path, |
scoped_ptr<DriveEntryProto> entry_proto) { |
@@ -1471,7 +1472,7 @@ void DriveFileSystem::OnGetFileFromCache( |
} |
void DriveFileSystem::OnGetDocumentEntry(const GetFileFromCacheParams& params, |
- GDataErrorCode status, |
+ gdata::GDataErrorCode status, |
scoped_ptr<base::Value> data) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
DCHECK(!params.get_file_callback.is_null()); |
@@ -1485,7 +1486,8 @@ void DriveFileSystem::OnGetDocumentEntry(const GetFileFromCacheParams& params, |
return; |
} |
- scoped_ptr<DocumentEntry> doc_entry(DocumentEntry::ExtractAndParse(*data)); |
+ scoped_ptr<gdata::DocumentEntry> doc_entry( |
+ gdata::DocumentEntry::ExtractAndParse(*data)); |
GURL content_url = doc_entry->content_url(); |
int64 file_size = doc_entry->file_size(); |
@@ -1519,7 +1521,7 @@ void DriveFileSystem::CheckForSpaceBeforeDownload( |
} |
bool* has_enough_space = new bool(false); |
- util::PostBlockingPoolSequencedTaskAndReply( |
+ gdata::util::PostBlockingPoolSequencedTaskAndReply( |
FROM_HERE, |
blocking_task_runner_, |
base::Bind(&DriveCache::FreeDiskSpaceIfNeededFor, |
@@ -1568,11 +1570,11 @@ void DriveFileSystem::GetEntryInfoByPath(const FilePath& file_path, |
BrowserThread::CurrentlyOn(BrowserThread::IO)); |
DCHECK(!callback.is_null()); |
- RunTaskOnUIThread( |
+ gdata::RunTaskOnUIThread( |
base::Bind(&DriveFileSystem::GetEntryInfoByPathOnUIThread, |
ui_weak_ptr_, |
file_path, |
- CreateRelayCallback(callback))); |
+ gdata::CreateRelayCallback(callback))); |
} |
void DriveFileSystem::GetEntryInfoByPathOnUIThread( |
@@ -1630,11 +1632,11 @@ void DriveFileSystem::ReadDirectoryByPath( |
BrowserThread::CurrentlyOn(BrowserThread::IO)); |
DCHECK(!callback.is_null()); |
- RunTaskOnUIThread( |
+ gdata::RunTaskOnUIThread( |
base::Bind(&DriveFileSystem::ReadDirectoryByPathOnUIThread, |
ui_weak_ptr_, |
directory_path, |
- CreateRelayCallback(callback))); |
+ gdata::CreateRelayCallback(callback))); |
} |
void DriveFileSystem::ReadDirectoryByPathOnUIThread( |
@@ -1692,7 +1694,7 @@ void DriveFileSystem::ReadDirectoryByPathOnUIThreadAfterRead( |
void DriveFileSystem::RequestDirectoryRefresh(const FilePath& directory_path) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) || |
BrowserThread::CurrentlyOn(BrowserThread::IO)); |
- RunTaskOnUIThread( |
+ gdata::RunTaskOnUIThread( |
base::Bind(&DriveFileSystem::RequestDirectoryRefreshOnUIThread, |
ui_weak_ptr_, |
directory_path)); |
@@ -1774,11 +1776,11 @@ void DriveFileSystem::UpdateFileByResourceId( |
BrowserThread::CurrentlyOn(BrowserThread::IO)); |
DCHECK(!callback.is_null()); |
- RunTaskOnUIThread( |
+ gdata::RunTaskOnUIThread( |
base::Bind(&DriveFileSystem::UpdateFileByResourceIdOnUIThread, |
ui_weak_ptr_, |
resource_id, |
- CreateRelayCallback(callback))); |
+ gdata::CreateRelayCallback(callback))); |
} |
void DriveFileSystem::UpdateFileByResourceIdOnUIThread( |
@@ -1845,7 +1847,7 @@ void DriveFileSystem::OnGetFileCompleteForUpdateFile( |
// file size information stored in DriveEntry is not correct. |
DriveFileError* get_size_error = new DriveFileError(DRIVE_FILE_ERROR_FAILED); |
int64* file_size = new int64(-1); |
- util::PostBlockingPoolSequencedTaskAndReply( |
+ gdata::util::PostBlockingPoolSequencedTaskAndReply( |
FROM_HERE, |
blocking_task_runner_, |
base::Bind(&GetLocalFileSizeOnBlockingPool, |
@@ -1897,7 +1899,7 @@ void DriveFileSystem::OnUpdatedFileUploaded( |
DriveFileError error, |
const FilePath& drive_path, |
const FilePath& file_path, |
- scoped_ptr<DocumentEntry> document_entry) { |
+ scoped_ptr<gdata::DocumentEntry> document_entry) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
if (error != DRIVE_FILE_OK) { |
@@ -1906,7 +1908,7 @@ void DriveFileSystem::OnUpdatedFileUploaded( |
return; |
} |
- AddUploadedFile(UPLOAD_EXISTING_FILE, |
+ AddUploadedFile(gdata::UPLOAD_EXISTING_FILE, |
drive_path.DirName(), |
document_entry.Pass(), |
file_path, |
@@ -1918,9 +1920,10 @@ void DriveFileSystem::GetAvailableSpace( |
const GetAvailableSpaceCallback& callback) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) || |
BrowserThread::CurrentlyOn(BrowserThread::IO)); |
- RunTaskOnUIThread(base::Bind(&DriveFileSystem::GetAvailableSpaceOnUIThread, |
- ui_weak_ptr_, |
- CreateRelayCallback(callback))); |
+ gdata::RunTaskOnUIThread( |
+ base::Bind(&DriveFileSystem::GetAvailableSpaceOnUIThread, |
+ ui_weak_ptr_, |
+ gdata::CreateRelayCallback(callback))); |
} |
void DriveFileSystem::GetAvailableSpaceOnUIThread( |
@@ -1940,7 +1943,7 @@ void DriveFileSystem::GetAvailableSpaceOnUIThread( |
void DriveFileSystem::OnGetAvailableSpace( |
const GetAvailableSpaceCallback& callback, |
- GDataErrorCode status, |
+ gdata::GDataErrorCode status, |
scoped_ptr<base::Value> data) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
DCHECK(!callback.is_null()); |
@@ -1951,9 +1954,9 @@ void DriveFileSystem::OnGetAvailableSpace( |
return; |
} |
- scoped_ptr<AccountMetadataFeed> feed; |
+ scoped_ptr<gdata::AccountMetadataFeed> feed; |
if (data.get()) |
- feed = AccountMetadataFeed::CreateFrom(*data); |
+ feed = gdata::AccountMetadataFeed::CreateFrom(*data); |
if (!feed.get()) { |
callback.Run(DRIVE_FILE_ERROR_FAILED, -1, -1); |
return; |
@@ -1966,7 +1969,7 @@ void DriveFileSystem::OnGetAvailableSpace( |
void DriveFileSystem::OnGetAboutResource( |
const GetAvailableSpaceCallback& callback, |
- GDataErrorCode status, |
+ gdata::GDataErrorCode status, |
scoped_ptr<base::Value> resource_json) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
DCHECK(!callback.is_null()); |
@@ -1977,9 +1980,9 @@ void DriveFileSystem::OnGetAboutResource( |
return; |
} |
- scoped_ptr<AboutResource> about; |
+ scoped_ptr<gdata::AboutResource> about; |
if (resource_json.get()) |
- about = AboutResource::CreateFrom(*resource_json); |
+ about = gdata::AboutResource::CreateFrom(*resource_json); |
if (!about.get()) { |
callback.Run(DRIVE_FILE_ERROR_FAILED, -1, -1); |
@@ -1993,7 +1996,7 @@ void DriveFileSystem::OnGetAboutResource( |
void DriveFileSystem::AddNewDirectory( |
const CreateDirectoryParams& params, |
- GDataErrorCode status, |
+ gdata::GDataErrorCode status, |
scoped_ptr<base::Value> data) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
DCHECK(!params.callback.is_null()); |
@@ -2006,7 +2009,8 @@ void DriveFileSystem::AddNewDirectory( |
resource_metadata_->AddEntryToDirectory( |
params.created_directory_path.DirName(), |
- scoped_ptr<DocumentEntry>(DocumentEntry::ExtractAndParse(*data)), |
+ scoped_ptr<gdata::DocumentEntry>( |
+ gdata::DocumentEntry::ExtractAndParse(*data)), |
base::Bind(&DriveFileSystem::ContinueCreateDirectory, |
ui_weak_ptr_, |
params)); |
@@ -2060,7 +2064,7 @@ void DriveFileSystem::OnSearch(const SearchCallback& search_callback, |
scoped_ptr<std::vector<SearchResultInfo> > result_vec(results); |
DCHECK_EQ(1u, params->feed_list.size()); |
- DocumentFeed* feed = params->feed_list[0]; |
+ gdata::DocumentFeed* feed = params->feed_list[0]; |
// TODO(tbarzic): Limit total number of returned results for the query. |
GURL next_feed; |
@@ -2069,7 +2073,7 @@ void DriveFileSystem::OnSearch(const SearchCallback& search_callback, |
const base::Closure callback = base::Bind( |
search_callback, DRIVE_FILE_OK, next_feed, base::Passed(&result_vec)); |
- std::vector<DocumentEntry*> entries; |
+ std::vector<gdata::DocumentEntry*> entries; |
feed->ReleaseEntries(&entries); |
if (entries.empty()) { |
callback.Run(); |
@@ -2083,7 +2087,7 @@ void DriveFileSystem::OnSearch(const SearchCallback& search_callback, |
// Run the callback if this is the last iteration of the loop. |
const bool should_run_callback = (i+1 == entries.size()); |
resource_metadata_->RefreshFile( |
- scoped_ptr<DocumentEntry>(entries[i]), |
+ scoped_ptr<gdata::DocumentEntry>(entries[i]), |
base::Bind(&DriveFileSystem::AddToSearchResults, |
ui_weak_ptr_, |
results, |
@@ -2125,11 +2129,11 @@ void DriveFileSystem::Search(const std::string& search_query, |
BrowserThread::CurrentlyOn(BrowserThread::IO)); |
DCHECK(!callback.is_null()); |
- RunTaskOnUIThread(base::Bind(&DriveFileSystem::SearchAsyncOnUIThread, |
+ gdata::RunTaskOnUIThread(base::Bind(&DriveFileSystem::SearchAsyncOnUIThread, |
ui_weak_ptr_, |
search_query, |
next_feed, |
- CreateRelayCallback(callback))); |
+ gdata::CreateRelayCallback(callback))); |
} |
void DriveFileSystem::SearchAsyncOnUIThread( |
@@ -2176,7 +2180,7 @@ void DriveFileSystem::LoadRootFeedFromCacheForTesting() { |
} |
DriveFileError DriveFileSystem::UpdateFromFeedForTesting( |
- const ScopedVector<DocumentFeed>& feed_list, |
+ const ScopedVector<gdata::DocumentFeed>& feed_list, |
int64 start_changestamp, |
int64 root_feed_changestamp) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
@@ -2189,7 +2193,7 @@ DriveFileError DriveFileSystem::UpdateFromFeedForTesting( |
void DriveFileSystem::OnCopyDocumentCompleted( |
const FilePath& dir_path, |
const FileOperationCallback& callback, |
- GDataErrorCode status, |
+ gdata::GDataErrorCode status, |
scoped_ptr<base::Value> data) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
DCHECK(!callback.is_null()); |
@@ -2205,7 +2209,8 @@ void DriveFileSystem::OnCopyDocumentCompleted( |
// destination directory by MoveEntryFromRootDirectory(). |
resource_metadata_->AddEntryToDirectory( |
resource_metadata_->root()->GetFilePath(), |
- scoped_ptr<DocumentEntry>(DocumentEntry::ExtractAndParse(*data)), |
+ scoped_ptr<gdata::DocumentEntry>( |
+ gdata::DocumentEntry::ExtractAndParse(*data)), |
base::Bind(&DriveFileSystem::MoveEntryFromRootDirectory, |
ui_weak_ptr_, |
dir_path, |
@@ -2214,7 +2219,7 @@ void DriveFileSystem::OnCopyDocumentCompleted( |
void DriveFileSystem::OnFileDownloaded( |
const GetFileFromCacheParams& params, |
- GDataErrorCode status, |
+ gdata::GDataErrorCode status, |
const GURL& content_url, |
const FilePath& downloaded_file_path) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
@@ -2222,7 +2227,7 @@ void DriveFileSystem::OnFileDownloaded( |
// If user cancels download of a pinned-but-not-fetched file, mark file as |
// unpinned so that we do not sync the file again. |
- if (status == GDATA_CANCELLED) { |
+ if (status == gdata::GDATA_CANCELLED) { |
cache_->GetCacheEntryOnUIThread( |
params.resource_id, |
params.md5, |
@@ -2241,7 +2246,7 @@ void DriveFileSystem::OnFileDownloaded( |
// If we don't have enough space, we return PLATFORM_FILE_ERROR_NO_SPACE, |
// and try to free up space, even if the file was downloaded successfully. |
bool* has_enough_space = new bool(false); |
- util::PostBlockingPoolSequencedTaskAndReply( |
+ gdata::util::PostBlockingPoolSequencedTaskAndReply( |
FROM_HERE, |
blocking_task_runner_, |
base::Bind(&DriveCache::FreeDiskSpaceIfNeededFor, |
@@ -2271,7 +2276,7 @@ void DriveFileSystem::UnpinIfPinned( |
void DriveFileSystem::OnFileDownloadedAndSpaceChecked( |
const GetFileFromCacheParams& params, |
- GDataErrorCode status, |
+ gdata::GDataErrorCode status, |
const GURL& content_url, |
const FilePath& downloaded_file_path, |
bool* has_enough_space) { |
@@ -2295,7 +2300,7 @@ void DriveFileSystem::OnFileDownloadedAndSpaceChecked( |
} else { |
// If we don't have enough space, remove the downloaded file, and |
// report "no space" error. |
- util::PostBlockingPoolSequencedTask( |
+ gdata::util::PostBlockingPoolSequencedTask( |
FROM_HERE, |
blocking_task_runner_, |
base::Bind(base::IgnoreResult(&file_util::Delete), |
@@ -2322,7 +2327,7 @@ void DriveFileSystem::MoveEntryToDirectory( |
const FilePath& file_path, |
const FilePath& directory_path, |
const FileMoveCallback& callback, |
- GDataErrorCode status, |
+ gdata::GDataErrorCode status, |
const GURL& /* document_url */) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
DCHECK(!callback.is_null()); |
@@ -2469,9 +2474,9 @@ void DriveFileSystem::ContinueFindFirstMissingParentDirectory( |
} |
void DriveFileSystem::AddUploadedFile( |
- UploadMode upload_mode, |
+ gdata::UploadMode upload_mode, |
const FilePath& directory_path, |
- scoped_ptr<DocumentEntry> entry, |
+ scoped_ptr<gdata::DocumentEntry> entry, |
const FilePath& file_content_path, |
DriveCache::FileOperationType cache_operation, |
const base::Closure& callback) { |
@@ -2492,9 +2497,9 @@ void DriveFileSystem::AddUploadedFile( |
} |
void DriveFileSystem::AddUploadedFileOnUIThread( |
- UploadMode upload_mode, |
+ gdata::UploadMode upload_mode, |
const FilePath& directory_path, |
- scoped_ptr<DocumentEntry> doc_entry, |
+ scoped_ptr<gdata::DocumentEntry> doc_entry, |
const FilePath& file_content_path, |
DriveCache::FileOperationType cache_operation, |
const base::Closure& callback) { |
@@ -2514,7 +2519,7 @@ void DriveFileSystem::AddUploadedFileOnUIThread( |
base::Bind(&DriveFileSystem::ContinueAddUploadedFile, |
ui_weak_ptr_, base::Passed(¶ms)); |
- if (upload_mode == UPLOAD_EXISTING_FILE) { |
+ if (upload_mode == gdata::UPLOAD_EXISTING_FILE) { |
// Remove the existing entry. |
resource_metadata_->RemoveEntryFromParent(resource_id, file_move_callback); |
} else { |
@@ -2537,7 +2542,7 @@ void DriveFileSystem::ContinueAddUploadedFile( |
// Get parameters before base::Passed() invalidates |params|. |
const FilePath& directory_path = params->directory_path; |
- scoped_ptr<DocumentEntry> doc_entry(params->doc_entry.Pass()); |
+ scoped_ptr<gdata::DocumentEntry> doc_entry(params->doc_entry.Pass()); |
resource_metadata_->AddEntryToDirectory( |
directory_path, |
@@ -2564,7 +2569,7 @@ void DriveFileSystem::AddUploadedFileToCache( |
OnDirectoryChanged(file_path.DirName()); |
- if (params->upload_mode == UPLOAD_NEW_FILE) { |
+ if (params->upload_mode == gdata::UPLOAD_NEW_FILE) { |
// Add the file to the cache if we have uploaded a new file. |
cache_->StoreOnUIThread(params->resource_id, |
params->md5, |
@@ -2572,7 +2577,7 @@ void DriveFileSystem::AddUploadedFileToCache( |
params->cache_operation, |
base::Bind(&OnCacheUpdatedForAddUploadedFile, |
params->callback)); |
- } else if (params->upload_mode == UPLOAD_EXISTING_FILE) { |
+ } else if (params->upload_mode == gdata::UPLOAD_EXISTING_FILE) { |
// Clear the dirty bit if we have updated an existing file. |
cache_->ClearDirtyOnUIThread(params->resource_id, |
params->md5, |
@@ -2589,7 +2594,7 @@ void DriveFileSystem::AddUploadedFileToCache( |
void DriveFileSystem::UpdateEntryData(const std::string& resource_id, |
const std::string& md5, |
- scoped_ptr<DocumentEntry> entry, |
+ scoped_ptr<gdata::DocumentEntry> entry, |
const FilePath& file_content_path, |
const base::Closure& callback) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
@@ -2609,7 +2614,7 @@ void DriveFileSystem::UpdateEntryData(const std::string& resource_id, |
void DriveFileSystem::UpdateEntryDataOnUIThread( |
const UpdateEntryParams& params, |
- scoped_ptr<DocumentEntry> entry) { |
+ scoped_ptr<gdata::DocumentEntry> entry) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
resource_metadata_->RefreshFile( |
@@ -2684,10 +2689,10 @@ void DriveFileSystem::OpenFile(const FilePath& file_path, |
const OpenFileCallback& callback) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) || |
BrowserThread::CurrentlyOn(BrowserThread::IO)); |
- RunTaskOnUIThread(base::Bind(&DriveFileSystem::OpenFileOnUIThread, |
+ gdata::RunTaskOnUIThread(base::Bind(&DriveFileSystem::OpenFileOnUIThread, |
ui_weak_ptr_, |
file_path, |
- CreateRelayCallback(callback))); |
+ gdata::CreateRelayCallback(callback))); |
} |
void DriveFileSystem::OpenFileOnUIThread(const FilePath& file_path, |
@@ -2754,7 +2759,7 @@ void DriveFileSystem::OnGetEntryInfoCompleteForOpenFile( |
GetFileCompleteForOpenParams( |
entry_proto_ptr->resource_id(), |
entry_proto_ptr->file_specific_info().file_md5())), |
- GetContentCallback(), |
+ gdata::GetContentCallback(), |
entry_proto.Pass()); |
} |
@@ -2816,10 +2821,10 @@ void DriveFileSystem::CloseFile(const FilePath& file_path, |
BrowserThread::CurrentlyOn(BrowserThread::IO)); |
DCHECK(!callback.is_null()); |
- RunTaskOnUIThread(base::Bind(&DriveFileSystem::CloseFileOnUIThread, |
+ gdata::RunTaskOnUIThread(base::Bind(&DriveFileSystem::CloseFileOnUIThread, |
ui_weak_ptr_, |
file_path, |
- CreateRelayCallback(callback))); |
+ gdata::CreateRelayCallback(callback))); |
} |
void DriveFileSystem::CloseFileOnUIThread( |
@@ -2973,7 +2978,7 @@ void DriveFileSystem::CheckLocalModificationAndRunAfterGetCacheFile( |
// If the cache is dirty, obtain the file info from the cache file itself. |
base::PlatformFileInfo* file_info = new base::PlatformFileInfo; |
bool* get_file_info_result = new bool(false); |
- util::PostBlockingPoolSequencedTaskAndReply( |
+ gdata::util::PostBlockingPoolSequencedTaskAndReply( |
FROM_HERE, |
blocking_task_runner_, |
base::Bind(&GetFileInfoOnBlockingPool, |
@@ -3007,4 +3012,4 @@ void DriveFileSystem::CheckLocalModificationAndRunAfterGetFileInfo( |
callback.Run(DRIVE_FILE_OK, entry_proto.Pass()); |
} |
-} // namespace gdata |
+} // namespace drive |