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 1240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1251 | 1251 |
1252 // Otherwise, this was a resumption attempt which ended with an | 1252 // Otherwise, this was a resumption attempt which ended with an |
1253 // interruption. Continue with current target path. | 1253 // interruption. Continue with current target path. |
1254 TransitionTo(TARGET_RESOLVED_INTERNAL); | 1254 TransitionTo(TARGET_RESOLVED_INTERNAL); |
1255 InterruptWithPartialState( | 1255 InterruptWithPartialState( |
1256 offset, std::move(hash_state), new_create_info.result); | 1256 offset, std::move(hash_state), new_create_info.result); |
1257 UpdateObservers(); | 1257 UpdateObservers(); |
1258 return; | 1258 return; |
1259 } | 1259 } |
1260 | 1260 |
1261 RecordDownloadMimeType(mime_type_); | |
shaktisahu
2017/03/16 23:39:49
asanka@ - I moved this from DownloadRequestCore::O
asanka
2017/03/17 15:19:27
This is fine. The early return at DownloadResource
| |
1262 if (GetWebContents() && | |
1263 !GetWebContents()->GetBrowserContext()->IsOffTheRecord()) { | |
1264 RecordDownloadMimeTypeForNormalProfile(mime_type_); | |
1265 } | |
1266 | |
1261 // Successful download start. | 1267 // Successful download start. |
1262 DCHECK(download_file_); | 1268 DCHECK(download_file_); |
1263 DCHECK(job_); | 1269 DCHECK(job_); |
1264 | 1270 |
1265 if (state_ == RESUMING_INTERNAL) | 1271 if (state_ == RESUMING_INTERNAL) |
1266 UpdateValidatorsOnResumption(new_create_info); | 1272 UpdateValidatorsOnResumption(new_create_info); |
1267 | 1273 |
1268 TransitionTo(TARGET_PENDING_INTERNAL); | 1274 TransitionTo(TARGET_PENDING_INTERNAL); |
1269 | 1275 |
1270 job_->Start(); | 1276 job_->Start(); |
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2165 case RESUME_MODE_USER_CONTINUE: | 2171 case RESUME_MODE_USER_CONTINUE: |
2166 return "USER_CONTINUE"; | 2172 return "USER_CONTINUE"; |
2167 case RESUME_MODE_USER_RESTART: | 2173 case RESUME_MODE_USER_RESTART: |
2168 return "USER_RESTART"; | 2174 return "USER_RESTART"; |
2169 } | 2175 } |
2170 NOTREACHED() << "Unknown resume mode " << mode; | 2176 NOTREACHED() << "Unknown resume mode " << mode; |
2171 return "unknown"; | 2177 return "unknown"; |
2172 } | 2178 } |
2173 | 2179 |
2174 } // namespace content | 2180 } // namespace content |
OLD | NEW |