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