Chromium Code Reviews| 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 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ |
| 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 206 private: | 206 private: |
| 207 // Fine grained states of a download. | 207 // Fine grained states of a download. |
| 208 enum DownloadInternalState { | 208 enum DownloadInternalState { |
| 209 // Unless otherwise specified, state transitions are linear forward | 209 // Unless otherwise specified, state transitions are linear forward |
| 210 // in this list. | 210 // in this list. |
| 211 | 211 |
| 212 // Includes both before and after file name determination. | 212 // Includes both before and after file name determination. |
| 213 // TODO(rdsmith): Put in state variable for file name determination. | 213 // TODO(rdsmith): Put in state variable for file name determination. |
| 214 IN_PROGRESS_INTERNAL, | 214 IN_PROGRESS_INTERNAL, |
| 215 | 215 |
| 216 // Between commit point (dispatch of download file release) and | 216 // Between commit point (dispatch of download file release) and completed. |
| 217 // completed. Embedder may be opening the file in this state. | 217 // Embedder may be opening the file in this state. Note that the |
| 218 // Note that the DownloadItem may be deleted (by shutdown) in this | 218 // DownloadItem may be deleted (by shutdown) or interrupted (e.g. due to a |
| 219 // state. | 219 // failure during AnnotateWithSourceInformation()) in this state. |
| 220 COMPLETING_INTERNAL, | 220 COMPLETING_INTERNAL, |
| 221 | 221 |
| 222 // After embedder has had a chance to auto-open. User may now open | 222 // After embedder has had a chance to auto-open. User may now open |
| 223 // or auto-open based on extension. | 223 // or auto-open based on extension. |
| 224 COMPLETE_INTERNAL, | 224 COMPLETE_INTERNAL, |
| 225 | 225 |
| 226 // User has cancelled the download. | 226 // User has cancelled the download. |
| 227 // Only incoming transition IN_PROGRESS-> | 227 // Only incoming transition IN_PROGRESS-> |
| 228 CANCELLED_INTERNAL, | 228 CANCELLED_INTERNAL, |
| 229 | 229 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 279 | 279 |
| 280 // Called after the delegate has given the go-ahead to actually complete | 280 // Called after the delegate has given the go-ahead to actually complete |
| 281 // the download. | 281 // the download. |
| 282 void ReadyForDownloadCompletionDone(); | 282 void ReadyForDownloadCompletionDone(); |
| 283 | 283 |
| 284 void OnDownloadRenamedToFinalName(content::DownloadInterruptReason reason, | 284 void OnDownloadRenamedToFinalName(content::DownloadInterruptReason reason, |
| 285 const FilePath& full_path); | 285 const FilePath& full_path); |
| 286 | 286 |
| 287 void ReleaseDownloadFile(); | 287 void ReleaseDownloadFile(); |
| 288 | 288 |
| 289 void OnDownloadFileReleased(); | 289 void OnDownloadFileReleased(content::DownloadInterruptReason reason); |
|
Randy Smith (Not in Mondays)
2012/10/27 23:54:28
After having banged my head against the state mach
asanka
2012/10/29 15:33:59
Done.
| |
| 290 | 290 |
| 291 // Called when the entire download operation (including renaming etc) | 291 // Called when the entire download operation (including renaming etc) |
| 292 // is completed. | 292 // is completed. |
| 293 void Completed(); | 293 void Completed(); |
| 294 | 294 |
| 295 // Helper routines ----------------------------------------------------------- | 295 // Helper routines ----------------------------------------------------------- |
| 296 | 296 |
| 297 // Cancel the DownloadFile if we have it. | 297 // Cancel the DownloadFile if we have it. |
| 298 void CancelDownloadFile(); | 298 void CancelDownloadFile(); |
| 299 | 299 |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 484 | 484 |
| 485 // Net log to use for this download. | 485 // Net log to use for this download. |
| 486 const net::BoundNetLog bound_net_log_; | 486 const net::BoundNetLog bound_net_log_; |
| 487 | 487 |
| 488 base::WeakPtrFactory<DownloadItemImpl> weak_ptr_factory_; | 488 base::WeakPtrFactory<DownloadItemImpl> weak_ptr_factory_; |
| 489 | 489 |
| 490 DISALLOW_COPY_AND_ASSIGN(DownloadItemImpl); | 490 DISALLOW_COPY_AND_ASSIGN(DownloadItemImpl); |
| 491 }; | 491 }; |
| 492 | 492 |
| 493 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ | 493 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ |
| OLD | NEW |