Index: content/browser/download/download_item_impl.cc |
diff --git a/content/browser/download/download_item_impl.cc b/content/browser/download/download_item_impl.cc |
index cf4294485a94276b72f032e45cb5f579e315cf18..f36b4b086c392b99038bbc65bccd5220ed6ed230 100644 |
--- a/content/browser/download/download_item_impl.cc |
+++ b/content/browser/download/download_item_impl.cc |
@@ -1038,6 +1038,8 @@ void DownloadItemImpl::DestinationUpdate(int64 bytes_so_far, |
// reporting. |
return; |
} |
+ |
+ int previous_progress = PercentComplete(); |
bytes_per_sec_ = bytes_per_sec; |
hash_state_ = hash_state; |
received_bytes_ = bytes_so_far; |
@@ -1053,7 +1055,10 @@ void DownloadItemImpl::DestinationUpdate(int64 bytes_so_far, |
net::NetLog::Int64Callback("bytes_so_far", received_bytes_)); |
} |
- UpdateObservers(); |
+ // Don't bother to update observers unless the progress percentage has |
+ // actually changed. |
+ if (previous_progress != -1 && PercentComplete() != previous_progress) |
asanka
2015/12/18 03:39:16
This change places the responsibility of throttlin
Evan Stade
2015/12/18 19:01:38
My justification for putting the responsibility he
Evan Stade
2015/12/29 18:57:03
reverted this change
|
+ UpdateObservers(); |
} |
void DownloadItemImpl::DestinationError(DownloadInterruptReason reason) { |