OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // File method ordering: Methods in this file are in the same order as | 5 // File method ordering: Methods in this file are in the same order as |
6 // in download_item_impl.h, with the following exception: The public | 6 // in download_item_impl.h, with the following exception: The public |
7 // interface Start is placed in chronological order with the other | 7 // interface Start is placed in chronological order with the other |
8 // (private) routines that together define a DownloadItem's state | 8 // (private) routines that together define a DownloadItem's state |
9 // transitions as the download progresses. See "Download progression | 9 // transitions as the download progresses. See "Download progression |
10 // cascade" later in this file. | 10 // cascade" later in this file. |
(...skipping 1254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1265 return; | 1265 return; |
1266 } | 1266 } |
1267 | 1267 |
1268 // Successful download start. | 1268 // Successful download start. |
1269 DCHECK(download_file_); | 1269 DCHECK(download_file_); |
1270 DCHECK(job_); | 1270 DCHECK(job_); |
1271 | 1271 |
1272 if (state_ == RESUMING_INTERNAL) | 1272 if (state_ == RESUMING_INTERNAL) |
1273 UpdateValidatorsOnResumption(new_create_info); | 1273 UpdateValidatorsOnResumption(new_create_info); |
1274 | 1274 |
| 1275 if (state_ == INITIAL_INTERNAL && job_->UsesParallelRequests()) |
| 1276 RecordDownloadCount(USES_PARALLEL_REQUESTS); |
| 1277 |
1275 TransitionTo(TARGET_PENDING_INTERNAL); | 1278 TransitionTo(TARGET_PENDING_INTERNAL); |
1276 | 1279 |
1277 job_->Start(); | 1280 job_->Start(); |
1278 } | 1281 } |
1279 | 1282 |
1280 void DownloadItemImpl::StartDownload() { | 1283 void DownloadItemImpl::StartDownload() { |
1281 BrowserThread::PostTask( | 1284 BrowserThread::PostTask( |
1282 BrowserThread::FILE, FROM_HERE, | 1285 BrowserThread::FILE, FROM_HERE, |
1283 base::Bind(&DownloadFile::Initialize, | 1286 base::Bind(&DownloadFile::Initialize, |
1284 // Safe because we control download file lifetime. | 1287 // Safe because we control download file lifetime. |
(...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2172 case RESUME_MODE_USER_CONTINUE: | 2175 case RESUME_MODE_USER_CONTINUE: |
2173 return "USER_CONTINUE"; | 2176 return "USER_CONTINUE"; |
2174 case RESUME_MODE_USER_RESTART: | 2177 case RESUME_MODE_USER_RESTART: |
2175 return "USER_RESTART"; | 2178 return "USER_RESTART"; |
2176 } | 2179 } |
2177 NOTREACHED() << "Unknown resume mode " << mode; | 2180 NOTREACHED() << "Unknown resume mode " << mode; |
2178 return "unknown"; | 2181 return "unknown"; |
2179 } | 2182 } |
2180 | 2183 |
2181 } // namespace content | 2184 } // namespace content |
OLD | NEW |