| 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
|
|
|