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
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_NET_LOG_PARAMETERS_H_
6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_NET_LOG_PARAMETERS_H_
10 #include "content/public/browser/download_item.h"
11 #include "net/base/net_errors.h"
12 #include "net/log/net_log.h"
28 // Returns NetLog parameters when a DownloadItem is activated.
29 base::Value
* ItemActivatedNetLogCallback(const DownloadItem
* download_item
,
30 DownloadType download_type
,
31 const std::string
* file_name
,
32 net::NetLogCaptureMode capture_mode
);
34 // Returns NetLog parameters when a DownloadItem is checked for danger.
35 base::Value
* ItemCheckedNetLogCallback(DownloadDangerType danger_type
,
36 net::NetLogCaptureMode capture_mode
);
38 // Returns NetLog parameters when a DownloadItem is renamed.
39 base::Value
* ItemRenamedNetLogCallback(const base::FilePath
* old_filename
,
40 const base::FilePath
* new_filename
,
41 net::NetLogCaptureMode capture_mode
);
43 // Returns NetLog parameters when a DownloadItem is interrupted.
44 base::Value
* ItemInterruptedNetLogCallback(DownloadInterruptReason reason
,
46 const std::string
* hash_state
,
47 net::NetLogCaptureMode capture_mode
);
49 // Returns NetLog parameters when a DownloadItem is resumed.
50 base::Value
* ItemResumingNetLogCallback(bool user_initiated
,
51 DownloadInterruptReason reason
,
53 const std::string
* hash_state
,
54 net::NetLogCaptureMode capture_mode
);
56 // Returns NetLog parameters when a DownloadItem is completing.
57 base::Value
* ItemCompletingNetLogCallback(int64 bytes_so_far
,
58 const std::string
* final_hash
,
59 net::NetLogCaptureMode capture_mode
);
61 // Returns NetLog parameters when a DownloadItem is finished.
62 base::Value
* ItemFinishedNetLogCallback(bool auto_opened
,
63 net::NetLogCaptureMode capture_mode
);
65 // Returns NetLog parameters when a DownloadItem is canceled.
66 base::Value
* ItemCanceledNetLogCallback(int64 bytes_so_far
,
67 const std::string
* hash_state
,
68 net::NetLogCaptureMode capture_mode
);
70 // Returns NetLog parameters when a DownloadFile is opened.
71 base::Value
* FileOpenedNetLogCallback(const base::FilePath
* file_name
,
73 net::NetLogCaptureMode capture_mode
);
75 // Returns NetLog parameters when a DownloadFile is opened.
76 base::Value
* FileStreamDrainedNetLogCallback(
79 net::NetLogCaptureMode capture_mode
);
81 // Returns NetLog parameters when a DownloadFile is renamed.
82 base::Value
* FileRenamedNetLogCallback(const base::FilePath
* old_filename
,
83 const base::FilePath
* new_filename
,
84 net::NetLogCaptureMode capture_mode
);
86 // Returns NetLog parameters when a File has an error.
87 base::Value
* FileErrorNetLogCallback(const char* operation
,
89 net::NetLogCaptureMode capture_mode
);
91 // Returns NetLog parameters for a download interruption.
92 base::Value
* FileInterruptedNetLogCallback(const char* operation
,
94 DownloadInterruptReason reason
,
95 net::NetLogCaptureMode capture_mode
);
97 } // namespace content
99 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_NET_LOG_PARAMETERS_H_