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 507ace3f58836cc192837a19cf459b4915197981..4599601ead4c4ce2f57e7f488d41bf21a2b673ac 100644 |
--- a/content/browser/download/download_item_impl.cc |
+++ b/content/browser/download/download_item_impl.cc |
@@ -1165,9 +1165,6 @@ void DownloadItemImpl::Init(bool active, |
DownloadType download_type) { |
DCHECK_CURRENTLY_ON(BrowserThread::UI); |
- if (active) |
- RecordDownloadCount(START_COUNT); |
- |
std::string file_name; |
if (download_type == SRC_HISTORY_IMPORT) { |
// target_path_ works for History and Save As versions. |
@@ -1265,6 +1262,15 @@ void DownloadItemImpl::Start( |
return; |
} |
+ if (state_ == INITIAL_INTERNAL) { |
+ RecordDownloadCount(START_COUNT); |
asanka
2017/03/23 14:34:43
START_COUNT is probably better if recorded for all
shaktisahu
2017/03/23 15:33:28
Oh, I misunderstood the comments of Init() that |a
asanka
2017/03/23 16:23:45
Count of all resumptions = Count of (Download.Sour
shaktisahu
2017/03/23 23:05:34
Done.
|
+ RecordDownloadMimeType(mime_type_); |
asanka
2017/03/23 14:34:43
Ditto here, but in this case it's probably easier
shaktisahu
2017/03/23 15:33:28
Are you saying it is okay to remove the old metric
asanka
2017/03/23 16:23:45
We need to keep the old one in histograms.xml sinc
shaktisahu
2017/03/23 23:05:34
Done.
|
+ if (!GetBrowserContext()->IsOffTheRecord()) { |
+ RecordDownloadCount(START_COUNT_NORMAL_PROFILE); |
+ RecordDownloadMimeTypeForNormalProfile(mime_type_); |
+ } |
+ } |
+ |
// Successful download start. |
DCHECK(download_file_); |
DCHECK(job_); |
@@ -1563,6 +1569,9 @@ void DownloadItemImpl::Completed() { |
end_time_ = base::Time::Now(); |
TransitionTo(COMPLETE_INTERNAL); |
RecordDownloadCompleted(start_tick_, received_bytes_); |
+ if (!GetBrowserContext()->IsOffTheRecord()) { |
+ RecordDownloadCount(COMPLETED_COUNT_NORMAL_PROFILE); |
+ } |
if (auto_opened_) { |
// If it was already handled by the delegate, do nothing. |