Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(871)

Unified Diff: net/base/net_log_event_type_list.h

Issue 9121053: Added net logging to DownloadItem. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged with parent. Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/base/net_log_event_type_list.h
diff --git a/net/base/net_log_event_type_list.h b/net/base/net_log_event_type_list.h
index 8de58d0a5981554595e20ab8e681655ae8863342..814dc8cf7ed71a5aaeb8de0724cfd40d9b8772f8 100644
--- a/net/base/net_log_event_type_list.h
+++ b/net/base/net_log_event_type_list.h
@@ -1451,6 +1451,105 @@ EVENT_TYPE(HTTP_PIPELINED_CONNECTION_RECEIVED_HEADERS)
EVENT_TYPE(HTTP_PIPELINED_CONNECTION_STREAM_CLOSED)
// ------------------------------------------------------------------------
+// Download start events.
+// ------------------------------------------------------------------------
+
+// This event is created when a download is started, and lets the URL request
+// event source know what download source it is using.
mmenke 2012/02/03 17:59:45 nit: Think this and the comment for DOWNLOAD_URL_
ahendrickson 2012/02/04 05:24:04 Done.
+// {
+// "source_dependency": <Source id of the download>,
+// }
+EVENT_TYPE(DOWNLOAD_STARTED)
+
+// This event is created when a download is started, and lets the download
+// event source know what URL request it's associated with.
+// {
+// "source_dependency": <Source id of the request being waited on>,
+// }
+EVENT_TYPE(DOWNLOAD_URL_REQUEST)
+
+// ------------------------------------------------------------------------
+// DownloadItem events.
+// ------------------------------------------------------------------------
+
+// This event lives for as long as a download item is active.
+// The BEGIN event occurs right after constrction, and has the following
+// parameters:
+// {
+// "type": New/history/save page.
+// "id": Download ID.
+// "original_url": URL that initiated the download.
+// "final_url": URL of the actual download file.
+// "intermediate_name": The current file name.
+// "suggested_name": The suggested final file name.
+// "file": Initial (temporary) file name.
+// "safety_state": SAFE, DANGEROUS, DANGEROUS_BUT_VALIDATED.
+// "start_offset": Where to start writing (defaults to 0)
mmenke 2012/02/03 17:59:45 nit: Format like other comments in this file - do
ahendrickson 2012/02/04 05:24:04 Done.
+// }
+// The END event will occur when the download is interrupted, canceled or
+// completed.
+EVENT_TYPE(DOWNLOAD_ITEM_ACTIVE)
+
+// This event is created when a download item has been checked by the
+// safe browsing system.
+// {
+// "safety_state": SAFE, DANGEROUS, DANGEROUS_BUT_VALIDATED.
+// }
+EVENT_TYPE(DOWNLOAD_ITEM_CHECKED)
mmenke 2012/02/03 18:12:28 nit: Suggest a clearer name for this. DOWNLOAD_I
ahendrickson 2012/02/04 05:24:04 Done.
+
+// This event is created when a download item has been inserted into the
+// history database.
+// {
+// "db_handle": The database handle for the item.
+// }
+EVENT_TYPE(DOWNLOAD_ITEM_IN_HISTORY)
+
+// This event is created when a download item is updated.
+// {
+// "bytes_so_far": Number of bytes received.
+// "hash_state": Current hash state, as a hex-encoded binary string.
+// }
+EVENT_TYPE(DOWNLOAD_ITEM_UPDATED)
+
+// This event is created when a download item is renamed.
+// {
+// "old_filename": Old file name.
+// "new_filename": New file name.
+// }
+EVENT_TYPE(DOWNLOAD_ITEM_RENAMED)
+
+// This event is created when a download item is interrupted.
+// {
+// "reason": The reason for the interruption.
+// "bytes_so_far": Number of bytes received.
+// "hash_state": Current hash state, as a hex-encoded binary string.
+// }
+EVENT_TYPE(DOWNLOAD_ITEM_INTERRUPTED)
+
+// This event is created when a download item is resumed.
+// {
+// "user_initiated": True if user initiated resume.
+// "reason": The reason for the interruption.
+// "bytes_so_far": Number of bytes received.
+// "hash_state": Current hash state, as a hex-encoded binary string.
+// }
+EVENT_TYPE(DOWNLOAD_ITEM_RESUMED)
+
+// This event is created when a download item is finished.
+// {
+// "bytes_so_far": Number of bytes received.
+// "final_hash": Final hash, as a hex-encoded binary string.
+// }
+EVENT_TYPE(DOWNLOAD_ITEM_FINISHED)
+
+// This event is created when a download item is canceled.
+// {
+// "bytes_so_far": Number of bytes received.
+// "hash_state": Current hash state, as a hex-encoded binary string.
+// }
+EVENT_TYPE(DOWNLOAD_ITEM_CANCELED)
+
+// ------------------------------------------------------------------------
// DownloadFile events.
// ------------------------------------------------------------------------

Powered by Google App Engine
This is Rietveld 408576698