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

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

Issue 10069014: Save Page As MHTML (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: non-cros works Created 8 years, 8 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_download_observer.cc
diff --git a/chrome/browser/chromeos/gdata/gdata_download_observer.cc b/chrome/browser/chromeos/gdata/gdata_download_observer.cc
index 3cb89fb37a46dfe357cda973f292628911e1781d..2b3f15d3b44808d0f9f7a6a99e1111317bedb849 100644
--- a/chrome/browser/chromeos/gdata/gdata_download_observer.cc
+++ b/chrome/browser/chromeos/gdata/gdata_download_observer.cc
@@ -133,7 +133,7 @@ bool GDataDownloadObserver::IsReadyToComplete(DownloadItem* download) {
// 2. The upload has completed.
UploadingExternalData* upload_data = GetUploadingExternalData(download);
return !IsGDataDownload(download) ||
- (upload_data && upload_data->is_complete());
+ (upload_data && upload_data->is_complete());
}
// static
@@ -291,10 +291,10 @@ bool GDataDownloadObserver::ShouldUpload(DownloadItem* download) {
// Upload if the item is in pending_downloads_,
// is complete or large enough to stream, and,
// is not already being uploaded.
- return pending_downloads_.count(download->GetId()) != 0 &&
+ return (pending_downloads_.count(download->GetId()) != 0) &&
(download->AllDataSaved() ||
download->GetReceivedBytes() > kStreamingFileSize) &&
- GetUploadingExternalData(download) == NULL;
+ (GetUploadingExternalData(download) == NULL);
}
scoped_ptr<UploadFileInfo> GDataDownloadObserver::CreateUploadFileInfo(
@@ -340,6 +340,9 @@ void GDataDownloadObserver::OnUploadComplete(int32 download_id,
DCHECK(upload_data);
upload_data->MarkAsComplete();
download->MaybeCompleteDownload();
+ // MaybeCompleteDownload() doesn't do what you expect for SavePackage, which
+ // might be waiting for OnDownloadUpdated() before completing the download.
+ download->UpdateObservers();
}
} // namespace gdata

Powered by Google App Engine
This is Rietveld 408576698