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 scoped_ptr
<base::Value
> ItemActivatedNetLogCallback(
30 const DownloadItem
* download_item
,
31 DownloadType download_type
,
32 const std::string
* file_name
,
33 net::NetLogCaptureMode capture_mode
);
35 // Returns NetLog parameters when a DownloadItem is checked for danger.
36 scoped_ptr
<base::Value
> ItemCheckedNetLogCallback(
37 DownloadDangerType danger_type
,
38 net::NetLogCaptureMode capture_mode
);
40 // Returns NetLog parameters when a DownloadItem is renamed.
41 scoped_ptr
<base::Value
> ItemRenamedNetLogCallback(
42 const base::FilePath
* old_filename
,
43 const base::FilePath
* new_filename
,
44 net::NetLogCaptureMode capture_mode
);
46 // Returns NetLog parameters when a DownloadItem is interrupted.
47 scoped_ptr
<base::Value
> ItemInterruptedNetLogCallback(
48 DownloadInterruptReason reason
,
50 const std::string
* hash_state
,
51 net::NetLogCaptureMode capture_mode
);
53 // Returns NetLog parameters when a DownloadItem is resumed.
54 scoped_ptr
<base::Value
> ItemResumingNetLogCallback(
56 DownloadInterruptReason reason
,
58 const std::string
* hash_state
,
59 net::NetLogCaptureMode capture_mode
);
61 // Returns NetLog parameters when a DownloadItem is completing.
62 scoped_ptr
<base::Value
> ItemCompletingNetLogCallback(
64 const std::string
* final_hash
,
65 net::NetLogCaptureMode capture_mode
);
67 // Returns NetLog parameters when a DownloadItem is finished.
68 scoped_ptr
<base::Value
> ItemFinishedNetLogCallback(
70 net::NetLogCaptureMode capture_mode
);
72 // Returns NetLog parameters when a DownloadItem is canceled.
73 scoped_ptr
<base::Value
> ItemCanceledNetLogCallback(
75 const std::string
* hash_state
,
76 net::NetLogCaptureMode capture_mode
);
78 // Returns NetLog parameters when a DownloadFile is opened.
79 scoped_ptr
<base::Value
> FileOpenedNetLogCallback(
80 const base::FilePath
* file_name
,
82 net::NetLogCaptureMode capture_mode
);
84 // Returns NetLog parameters when a DownloadFile is opened.
85 scoped_ptr
<base::Value
> FileStreamDrainedNetLogCallback(
88 net::NetLogCaptureMode capture_mode
);
90 // Returns NetLog parameters when a DownloadFile is renamed.
91 scoped_ptr
<base::Value
> FileRenamedNetLogCallback(
92 const base::FilePath
* old_filename
,
93 const base::FilePath
* new_filename
,
94 net::NetLogCaptureMode capture_mode
);
96 // Returns NetLog parameters when a File has an error.
97 scoped_ptr
<base::Value
> FileErrorNetLogCallback(
98 const char* operation
,
100 net::NetLogCaptureMode capture_mode
);
102 // Returns NetLog parameters for a download interruption.
103 scoped_ptr
<base::Value
> FileInterruptedNetLogCallback(
104 const char* operation
,
106 DownloadInterruptReason reason
,
107 net::NetLogCaptureMode capture_mode
);
109 } // namespace content
111 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_NET_LOG_PARAMETERS_H_