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_NET_LOG_PARAMETERS_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_NET_LOG_PARAMETERS_H_ |
6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_NET_LOG_PARAMETERS_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_NET_LOG_PARAMETERS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "content/public/browser/download_item.h" | 10 #include "content/public/browser/download_item.h" |
11 #include "net/base/net_errors.h" | 11 #include "net/base/net_errors.h" |
12 #include "net/base/net_log.h" | 12 #include "net/base/net_log.h" |
13 | 13 |
| 14 class GURL; |
| 15 |
| 16 namespace base { |
14 class FilePath; | 17 class FilePath; |
15 class GURL; | 18 } |
16 | 19 |
17 namespace content { | 20 namespace content { |
18 | 21 |
19 enum DownloadType { | 22 enum DownloadType { |
20 SRC_ACTIVE_DOWNLOAD, | 23 SRC_ACTIVE_DOWNLOAD, |
21 SRC_HISTORY_IMPORT, | 24 SRC_HISTORY_IMPORT, |
22 SRC_SAVE_PAGE_AS | 25 SRC_SAVE_PAGE_AS |
23 }; | 26 }; |
24 | 27 |
25 // Returns NetLog parameters when a DownloadItem is activated. | 28 // Returns NetLog parameters when a DownloadItem is activated. |
26 base::Value* ItemActivatedNetLogCallback( | 29 base::Value* ItemActivatedNetLogCallback( |
27 const DownloadItem* download_item, | 30 const DownloadItem* download_item, |
28 DownloadType download_type, | 31 DownloadType download_type, |
29 const std::string* file_name, | 32 const std::string* file_name, |
30 net::NetLog::LogLevel log_level); | 33 net::NetLog::LogLevel log_level); |
31 | 34 |
32 // Returns NetLog parameters when a DownloadItem is checked for danger. | 35 // Returns NetLog parameters when a DownloadItem is checked for danger. |
33 base::Value* ItemCheckedNetLogCallback( | 36 base::Value* ItemCheckedNetLogCallback( |
34 DownloadDangerType danger_type, | 37 DownloadDangerType danger_type, |
35 net::NetLog::LogLevel log_level); | 38 net::NetLog::LogLevel log_level); |
36 | 39 |
37 // Returns NetLog parameters when a DownloadItem is renamed. | 40 // Returns NetLog parameters when a DownloadItem is renamed. |
38 base::Value* ItemRenamedNetLogCallback(const FilePath* old_filename, | 41 base::Value* ItemRenamedNetLogCallback(const base::FilePath* old_filename, |
39 const FilePath* new_filename, | 42 const base::FilePath* new_filename, |
40 net::NetLog::LogLevel log_level); | 43 net::NetLog::LogLevel log_level); |
41 | 44 |
42 // Returns NetLog parameters when a DownloadItem is interrupted. | 45 // Returns NetLog parameters when a DownloadItem is interrupted. |
43 base::Value* ItemInterruptedNetLogCallback(DownloadInterruptReason reason, | 46 base::Value* ItemInterruptedNetLogCallback(DownloadInterruptReason reason, |
44 int64 bytes_so_far, | 47 int64 bytes_so_far, |
45 const std::string* hash_state, | 48 const std::string* hash_state, |
46 net::NetLog::LogLevel log_level); | 49 net::NetLog::LogLevel log_level); |
47 | 50 |
48 // Returns NetLog parameters when a DownloadItem is resumed. | 51 // Returns NetLog parameters when a DownloadItem is resumed. |
49 base::Value* ItemResumingNetLogCallback(bool user_initiated, | 52 base::Value* ItemResumingNetLogCallback(bool user_initiated, |
(...skipping 10 matching lines...) Expand all Loading... |
60 // Returns NetLog parameters when a DownloadItem is finished. | 63 // Returns NetLog parameters when a DownloadItem is finished. |
61 base::Value* ItemFinishedNetLogCallback(bool auto_opened, | 64 base::Value* ItemFinishedNetLogCallback(bool auto_opened, |
62 net::NetLog::LogLevel log_level); | 65 net::NetLog::LogLevel log_level); |
63 | 66 |
64 // Returns NetLog parameters when a DownloadItem is canceled. | 67 // Returns NetLog parameters when a DownloadItem is canceled. |
65 base::Value* ItemCanceledNetLogCallback(int64 bytes_so_far, | 68 base::Value* ItemCanceledNetLogCallback(int64 bytes_so_far, |
66 const std::string* hash_state, | 69 const std::string* hash_state, |
67 net::NetLog::LogLevel log_level); | 70 net::NetLog::LogLevel log_level); |
68 | 71 |
69 // Returns NetLog parameters when a DownloadFile is opened. | 72 // Returns NetLog parameters when a DownloadFile is opened. |
70 base::Value* FileOpenedNetLogCallback(const FilePath* file_name, | 73 base::Value* FileOpenedNetLogCallback(const base::FilePath* file_name, |
71 int64 start_offset, | 74 int64 start_offset, |
72 net::NetLog::LogLevel log_level); | 75 net::NetLog::LogLevel log_level); |
73 | 76 |
74 // Returns NetLog parameters when a DownloadFile is opened. | 77 // Returns NetLog parameters when a DownloadFile is opened. |
75 base::Value* FileStreamDrainedNetLogCallback(size_t stream_size, | 78 base::Value* FileStreamDrainedNetLogCallback(size_t stream_size, |
76 size_t num_buffers, | 79 size_t num_buffers, |
77 net::NetLog::LogLevel log_level); | 80 net::NetLog::LogLevel log_level); |
78 | 81 |
79 // Returns NetLog parameters when a DownloadFile is renamed. | 82 // Returns NetLog parameters when a DownloadFile is renamed. |
80 base::Value* FileRenamedNetLogCallback(const FilePath* old_filename, | 83 base::Value* FileRenamedNetLogCallback(const base::FilePath* old_filename, |
81 const FilePath* new_filename, | 84 const base::FilePath* new_filename, |
82 net::NetLog::LogLevel log_level); | 85 net::NetLog::LogLevel log_level); |
83 | 86 |
84 // Returns NetLog parameters when a File has an error. | 87 // Returns NetLog parameters when a File has an error. |
85 base::Value* FileErrorNetLogCallback(const char* operation, | 88 base::Value* FileErrorNetLogCallback(const char* operation, |
86 net::Error net_error, | 89 net::Error net_error, |
87 net::NetLog::LogLevel log_level); | 90 net::NetLog::LogLevel log_level); |
88 | 91 |
89 // Returns NetLog parameters for a download interruption. | 92 // Returns NetLog parameters for a download interruption. |
90 base::Value* FileInterruptedNetLogCallback(const char* operation, | 93 base::Value* FileInterruptedNetLogCallback(const char* operation, |
91 int os_error, | 94 int os_error, |
92 DownloadInterruptReason reason, | 95 DownloadInterruptReason reason, |
93 net::NetLog::LogLevel log_level); | 96 net::NetLog::LogLevel log_level); |
94 | 97 |
95 } // namespace content | 98 } // namespace content |
96 | 99 |
97 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_NET_LOG_PARAMETERS_H_ | 100 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_NET_LOG_PARAMETERS_H_ |
OLD | NEW |