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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 class ItemActivatedParameters : public net::NetLog::EventParameters { | 24 class ItemActivatedParameters : public net::NetLog::EventParameters { |
25 public: | 25 public: |
26 ItemActivatedParameters(DownloadType download_type, | 26 ItemActivatedParameters(DownloadType download_type, |
27 int64 id, | 27 int64 id, |
28 const std::string& original_url, | 28 const std::string& original_url, |
29 const std::string& final_url, | 29 const std::string& final_url, |
30 const std::string& file_name, | 30 const std::string& file_name, |
31 content::DownloadDangerType danger_type, | 31 content::DownloadDangerType danger_type, |
32 content::DownloadItem::SafetyState safety_state, | 32 content::DownloadItem::SafetyState safety_state, |
33 int64 start_offset); | 33 int64 start_offset); |
| 34 virtual base::Value* ToValue() const OVERRIDE; |
| 35 |
| 36 protected: |
34 virtual ~ItemActivatedParameters(); | 37 virtual ~ItemActivatedParameters(); |
35 virtual base::Value* ToValue() const OVERRIDE; | |
36 | 38 |
37 private: | 39 private: |
38 const DownloadType type_; | 40 const DownloadType type_; |
39 const int64 id_; | 41 const int64 id_; |
40 const std::string original_url_; | 42 const std::string original_url_; |
41 const std::string final_url_; | 43 const std::string final_url_; |
42 const std::string file_name_; | 44 const std::string file_name_; |
43 const content::DownloadDangerType danger_type_; | 45 const content::DownloadDangerType danger_type_; |
44 const content::DownloadItem::SafetyState safety_state_; | 46 const content::DownloadItem::SafetyState safety_state_; |
45 const int64 start_offset_; | 47 const int64 start_offset_; |
46 | 48 |
47 DISALLOW_COPY_AND_ASSIGN(ItemActivatedParameters); | 49 DISALLOW_COPY_AND_ASSIGN(ItemActivatedParameters); |
48 }; | 50 }; |
49 | 51 |
50 // NetLog parameters when a DownloadItem is checked for danger. | 52 // NetLog parameters when a DownloadItem is checked for danger. |
51 class ItemCheckedParameters : public net::NetLog::EventParameters { | 53 class ItemCheckedParameters : public net::NetLog::EventParameters { |
52 public: | 54 public: |
53 ItemCheckedParameters(content::DownloadDangerType danger_type, | 55 ItemCheckedParameters(content::DownloadDangerType danger_type, |
54 content::DownloadItem::SafetyState safety_state); | 56 content::DownloadItem::SafetyState safety_state); |
55 virtual base::Value* ToValue() const OVERRIDE; | 57 virtual base::Value* ToValue() const OVERRIDE; |
56 | 58 |
| 59 protected: |
| 60 virtual ~ItemCheckedParameters(); |
| 61 |
57 private: | 62 private: |
58 const content::DownloadDangerType danger_type_; | 63 const content::DownloadDangerType danger_type_; |
59 const content::DownloadItem::SafetyState safety_state_; | 64 const content::DownloadItem::SafetyState safety_state_; |
60 | 65 |
61 DISALLOW_COPY_AND_ASSIGN(ItemCheckedParameters); | 66 DISALLOW_COPY_AND_ASSIGN(ItemCheckedParameters); |
62 }; | 67 }; |
63 | 68 |
64 // NetLog parameters when a DownloadItem is added to the history database. | 69 // NetLog parameters when a DownloadItem is added to the history database. |
65 class ItemInHistoryParameters : public net::NetLog::EventParameters { | 70 class ItemInHistoryParameters : public net::NetLog::EventParameters { |
66 public: | 71 public: |
67 ItemInHistoryParameters(int64 handle); | 72 ItemInHistoryParameters(int64 handle); |
68 virtual base::Value* ToValue() const OVERRIDE; | 73 virtual base::Value* ToValue() const OVERRIDE; |
69 | 74 |
| 75 protected: |
| 76 virtual ~ItemInHistoryParameters(); |
| 77 |
70 private: | 78 private: |
71 const int64 db_handle_; | 79 const int64 db_handle_; |
72 | 80 |
73 DISALLOW_COPY_AND_ASSIGN(ItemInHistoryParameters); | 81 DISALLOW_COPY_AND_ASSIGN(ItemInHistoryParameters); |
74 }; | 82 }; |
75 | 83 |
76 // NetLog parameters when a DownloadItem is updated. | 84 // NetLog parameters when a DownloadItem is updated. |
77 class ItemUpdatedParameters : public net::NetLog::EventParameters { | 85 class ItemUpdatedParameters : public net::NetLog::EventParameters { |
78 public: | 86 public: |
79 ItemUpdatedParameters(int64 bytes_so_far); | 87 ItemUpdatedParameters(int64 bytes_so_far); |
80 virtual base::Value* ToValue() const OVERRIDE; | 88 virtual base::Value* ToValue() const OVERRIDE; |
81 | 89 |
| 90 protected: |
| 91 virtual ~ItemUpdatedParameters(); |
| 92 |
82 private: | 93 private: |
83 const int64 bytes_so_far_; | 94 const int64 bytes_so_far_; |
84 | 95 |
85 DISALLOW_COPY_AND_ASSIGN(ItemUpdatedParameters); | 96 DISALLOW_COPY_AND_ASSIGN(ItemUpdatedParameters); |
86 }; | 97 }; |
87 | 98 |
88 // NetLog parameters when a DownloadItem is renamed. | 99 // NetLog parameters when a DownloadItem is renamed. |
89 class ItemRenamedParameters : public net::NetLog::EventParameters { | 100 class ItemRenamedParameters : public net::NetLog::EventParameters { |
90 public: | 101 public: |
91 ItemRenamedParameters( | 102 ItemRenamedParameters( |
92 const std::string& old_filename, const std::string& new_filename); | 103 const std::string& old_filename, const std::string& new_filename); |
93 virtual base::Value* ToValue() const OVERRIDE; | 104 virtual base::Value* ToValue() const OVERRIDE; |
94 | 105 |
| 106 protected: |
| 107 virtual ~ItemRenamedParameters(); |
| 108 |
95 private: | 109 private: |
96 const std::string old_filename_; | 110 const std::string old_filename_; |
97 const std::string new_filename_; | 111 const std::string new_filename_; |
98 | 112 |
99 DISALLOW_COPY_AND_ASSIGN(ItemRenamedParameters); | 113 DISALLOW_COPY_AND_ASSIGN(ItemRenamedParameters); |
100 }; | 114 }; |
101 | 115 |
102 // NetLog parameters when a DownloadItem is interrupted. | 116 // NetLog parameters when a DownloadItem is interrupted. |
103 class ItemInterruptedParameters : public net::NetLog::EventParameters { | 117 class ItemInterruptedParameters : public net::NetLog::EventParameters { |
104 public: | 118 public: |
105 ItemInterruptedParameters(content::DownloadInterruptReason reason, | 119 ItemInterruptedParameters(content::DownloadInterruptReason reason, |
106 int64 bytes_so_far, | 120 int64 bytes_so_far, |
107 const std::string& hash_state); | 121 const std::string& hash_state); |
108 virtual base::Value* ToValue() const OVERRIDE; | 122 virtual base::Value* ToValue() const OVERRIDE; |
109 | 123 |
| 124 protected: |
| 125 virtual ~ItemInterruptedParameters(); |
| 126 |
110 private: | 127 private: |
111 const content::DownloadInterruptReason reason_; | 128 const content::DownloadInterruptReason reason_; |
112 const int64 bytes_so_far_; | 129 const int64 bytes_so_far_; |
113 const std::string hash_state_; | 130 const std::string hash_state_; |
114 | 131 |
115 DISALLOW_COPY_AND_ASSIGN(ItemInterruptedParameters); | 132 DISALLOW_COPY_AND_ASSIGN(ItemInterruptedParameters); |
116 }; | 133 }; |
117 | 134 |
118 // NetLog parameters when a DownloadItem is finished. | 135 // NetLog parameters when a DownloadItem is finished. |
119 class ItemFinishedParameters : public net::NetLog::EventParameters { | 136 class ItemFinishedParameters : public net::NetLog::EventParameters { |
120 public: | 137 public: |
121 ItemFinishedParameters(int64 bytes_so_far, const std::string& final_hash); | 138 ItemFinishedParameters(int64 bytes_so_far, const std::string& final_hash); |
122 virtual base::Value* ToValue() const OVERRIDE; | 139 virtual base::Value* ToValue() const OVERRIDE; |
123 | 140 |
| 141 protected: |
| 142 virtual ~ItemFinishedParameters(); |
| 143 |
124 private: | 144 private: |
125 const int64 bytes_so_far_; | 145 const int64 bytes_so_far_; |
126 const std::string final_hash_; | 146 const std::string final_hash_; |
127 | 147 |
128 DISALLOW_COPY_AND_ASSIGN(ItemFinishedParameters); | 148 DISALLOW_COPY_AND_ASSIGN(ItemFinishedParameters); |
129 }; | 149 }; |
130 | 150 |
131 // NetLog parameters when a DownloadItem is canceled. | 151 // NetLog parameters when a DownloadItem is canceled. |
132 class ItemCanceledParameters : public net::NetLog::EventParameters { | 152 class ItemCanceledParameters : public net::NetLog::EventParameters { |
133 public: | 153 public: |
134 ItemCanceledParameters(int64 bytes_so_far, const std::string& hash_state); | 154 ItemCanceledParameters(int64 bytes_so_far, const std::string& hash_state); |
135 virtual base::Value* ToValue() const OVERRIDE; | 155 virtual base::Value* ToValue() const OVERRIDE; |
136 | 156 |
| 157 protected: |
| 158 virtual ~ItemCanceledParameters(); |
| 159 |
137 private: | 160 private: |
138 const int64 bytes_so_far_; | 161 const int64 bytes_so_far_; |
139 const std::string hash_state_; | 162 const std::string hash_state_; |
140 | 163 |
141 DISALLOW_COPY_AND_ASSIGN(ItemCanceledParameters); | 164 DISALLOW_COPY_AND_ASSIGN(ItemCanceledParameters); |
142 }; | 165 }; |
143 | 166 |
144 // NetLog parameters when a DownloadFile is opened. | 167 // NetLog parameters when a DownloadFile is opened. |
145 class FileOpenedParameters : public net::NetLog::EventParameters { | 168 class FileOpenedParameters : public net::NetLog::EventParameters { |
146 public: | 169 public: |
147 FileOpenedParameters(const std::string& file_name, | 170 FileOpenedParameters(const std::string& file_name, |
148 int64 start_offset); | 171 int64 start_offset); |
149 virtual base::Value* ToValue() const OVERRIDE; | 172 virtual base::Value* ToValue() const OVERRIDE; |
150 | 173 |
| 174 protected: |
| 175 virtual ~FileOpenedParameters(); |
| 176 |
151 private: | 177 private: |
152 const std::string file_name_; | 178 const std::string file_name_; |
153 const int64 start_offset_; | 179 const int64 start_offset_; |
154 | 180 |
155 DISALLOW_COPY_AND_ASSIGN(FileOpenedParameters); | 181 DISALLOW_COPY_AND_ASSIGN(FileOpenedParameters); |
156 }; | 182 }; |
157 | 183 |
158 // NetLog parameters when a DownloadFile is renamed. | 184 // NetLog parameters when a DownloadFile is renamed. |
159 class FileRenamedParameters : public net::NetLog::EventParameters { | 185 class FileRenamedParameters : public net::NetLog::EventParameters { |
160 public: | 186 public: |
161 FileRenamedParameters( | 187 FileRenamedParameters( |
162 const std::string& old_filename, const std::string& new_filename); | 188 const std::string& old_filename, const std::string& new_filename); |
163 virtual base::Value* ToValue() const OVERRIDE; | 189 virtual base::Value* ToValue() const OVERRIDE; |
164 | 190 |
| 191 protected: |
| 192 virtual ~FileRenamedParameters(); |
| 193 |
165 private: | 194 private: |
166 const std::string old_filename_; | 195 const std::string old_filename_; |
167 const std::string new_filename_; | 196 const std::string new_filename_; |
168 | 197 |
169 DISALLOW_COPY_AND_ASSIGN(FileRenamedParameters); | 198 DISALLOW_COPY_AND_ASSIGN(FileRenamedParameters); |
170 }; | 199 }; |
171 | 200 |
172 // NetLog parameters when a File has an error. | 201 // NetLog parameters when a File has an error. |
173 class FileErrorParameters : public net::NetLog::EventParameters { | 202 class FileErrorParameters : public net::NetLog::EventParameters { |
174 public: | 203 public: |
175 FileErrorParameters(const std::string& operation, net::Error net_error); | 204 FileErrorParameters(const std::string& operation, net::Error net_error); |
176 virtual base::Value* ToValue() const OVERRIDE; | 205 virtual base::Value* ToValue() const OVERRIDE; |
177 | 206 |
| 207 protected: |
| 208 virtual ~FileErrorParameters(); |
| 209 |
178 private: | 210 private: |
179 const std::string operation_; | 211 const std::string operation_; |
180 const net::Error net_error_; | 212 const net::Error net_error_; |
181 | 213 |
182 DISALLOW_COPY_AND_ASSIGN(FileErrorParameters); | 214 DISALLOW_COPY_AND_ASSIGN(FileErrorParameters); |
183 }; | 215 }; |
184 | 216 |
185 } // namespace download_net_logs | 217 } // namespace download_net_logs |
186 | 218 |
187 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_NET_LOG_PARAMETERS_H_ | 219 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_NET_LOG_PARAMETERS_H_ |
OLD | NEW |