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

Unified Diff: sync/internal_api/attachments/attachment_downloader_impl.cc

Issue 982883002: [Sync] Add size and crc32c to AttachmentId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix argument evaluation order bug. Created 5 years, 10 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: sync/internal_api/attachments/attachment_downloader_impl.cc
diff --git a/sync/internal_api/attachments/attachment_downloader_impl.cc b/sync/internal_api/attachments/attachment_downloader_impl.cc
index 56a2c346d7cdb2492afb92fbeec23ef834285a77..813892bf4305e6df566949316deb2a8f136ca663 100644
--- a/sync/internal_api/attachments/attachment_downloader_impl.cc
+++ b/sync/internal_api/attachments/attachment_downloader_impl.cc
@@ -132,7 +132,7 @@ void AttachmentDownloaderImpl::OnGetTokenFailure(
DownloadState* download_state = *iter;
scoped_refptr<base::RefCountedString> null_attachment_data;
ReportResult(*download_state, DOWNLOAD_TRANSIENT_ERROR,
- null_attachment_data, 0);
+ null_attachment_data);
DCHECK(state_map_.find(download_state->attachment_url) != state_map_.end());
state_map_.erase(download_state->attachment_url);
}
@@ -193,7 +193,7 @@ void AttachmentDownloaderImpl::OnURLFetchComplete(
} else if (response_code == net::URLFetcher::RESPONSE_CODE_INVALID) {
result = DOWNLOAD_TRANSIENT_ERROR;
}
- ReportResult(download_state, result, attachment_data, attachment_crc32c);
+ ReportResult(download_state, result, attachment_data);
pavely 2015/03/07 00:07:25 I feel there should be a check here to make sure t
maniscalco 2015/03/09 17:09:00 Done and added test case to verify.
state_map_.erase(iter);
}
@@ -221,8 +221,7 @@ void AttachmentDownloaderImpl::RequestAccessToken(
void AttachmentDownloaderImpl::ReportResult(
const DownloadState& download_state,
const DownloadResult& result,
- const scoped_refptr<base::RefCountedString>& attachment_data,
- uint32_t attachment_crc32c) {
+ const scoped_refptr<base::RefCountedString>& attachment_data) {
std::vector<DownloadCallback>::const_iterator iter;
for (iter = download_state.user_callbacks.begin();
iter != download_state.user_callbacks.end();
@@ -230,7 +229,7 @@ void AttachmentDownloaderImpl::ReportResult(
scoped_ptr<Attachment> attachment;
if (result == DOWNLOAD_SUCCESS) {
attachment.reset(new Attachment(Attachment::CreateFromParts(
- download_state.attachment_id, attachment_data, attachment_crc32c)));
+ download_state.attachment_id, attachment_data)));
}
base::MessageLoop::current()->PostTask(

Powered by Google App Engine
This is Rietveld 408576698