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

Unified Diff: chrome/browser/chromeos/gdata/gdata_file_system.cc

Issue 10854180: Pass const ref instead of pointer for FromDocumentEntry() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix for comments. Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/gdata/gdata_file_system.cc
diff --git a/chrome/browser/chromeos/gdata/gdata_file_system.cc b/chrome/browser/chromeos/gdata/gdata_file_system.cc
index aacb34b8191a7fe59e58be4a5011f6a439b2620e..51f4a4c6a4b9023216b39626beb33981af6823ff 100644
--- a/chrome/browser/chromeos/gdata/gdata_file_system.cc
+++ b/chrome/browser/chromeos/gdata/gdata_file_system.cc
@@ -1820,9 +1820,8 @@ void GDataFileSystem::OnGetDocumentEntry(const FilePath& cache_file_path,
scoped_ptr<GDataEntry> fresh_entry;
if (error == GDATA_FILE_OK) {
scoped_ptr<DocumentEntry> doc_entry(DocumentEntry::ExtractAndParse(*data));
- if (doc_entry.get()) {
- fresh_entry.reset(directory_service_->FromDocumentEntry(doc_entry.get()));
- }
+ if (doc_entry.get())
+ fresh_entry.reset(directory_service_->FromDocumentEntry(*doc_entry));
if (!fresh_entry.get() || !fresh_entry->AsGDataFile()) {
LOG(ERROR) << "Got invalid entry from server for " << params.resource_id;
error = GDATA_FILE_ERROR_FAILED;
@@ -2386,7 +2385,7 @@ void GDataFileSystem::OnSearch(const SearchCallback& callback,
// result directory.
for (size_t i = 0; i < feed->entries().size(); ++i) {
DocumentEntry* doc = const_cast<DocumentEntry*>(feed->entries()[i]);
- scoped_ptr<GDataEntry> entry(directory_service_->FromDocumentEntry(doc));
+ scoped_ptr<GDataEntry> entry(directory_service_->FromDocumentEntry(*doc));
if (!entry.get())
continue;
@@ -2522,7 +2521,7 @@ void GDataFileSystem::OnCopyDocumentCompleted(
return;
}
- GDataEntry* entry = directory_service_->FromDocumentEntry(doc_entry.get());
+ GDataEntry* entry = directory_service_->FromDocumentEntry(*doc_entry);
if (!entry) {
callback.Run(GDATA_FILE_ERROR_FAILED);
return;
@@ -2885,7 +2884,7 @@ GDataFileError GDataFileSystem::AddNewDirectory(
return GDATA_FILE_ERROR_FAILED;
GDataEntry* new_entry =
- directory_service_->FromDocumentEntry(doc_entry.get());
+ directory_service_->FromDocumentEntry(*doc_entry);
if (!new_entry)
return GDATA_FILE_ERROR_FAILED;
@@ -3010,7 +3009,7 @@ void GDataFileSystem::AddUploadedFileOnUIThread(
return;
scoped_ptr<GDataEntry> new_entry(
- directory_service_->FromDocumentEntry(entry.get()));
+ directory_service_->FromDocumentEntry(*entry));
if (!new_entry.get())
return;
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_directory_service.cc ('k') | chrome/browser/chromeos/gdata/gdata_files.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698