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 #include "content/browser/download/download_net_log_parameters.h" | 5 #include "content/browser/download/download_net_log_parameters.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 DictionaryValue* dict = new DictionaryValue(); | 99 DictionaryValue* dict = new DictionaryValue(); |
100 | 100 |
101 dict->SetString("interrupt_reason", InterruptReasonDebugString(reason)); | 101 dict->SetString("interrupt_reason", InterruptReasonDebugString(reason)); |
102 dict->SetString("bytes_so_far", base::Int64ToString(bytes_so_far)); | 102 dict->SetString("bytes_so_far", base::Int64ToString(bytes_so_far)); |
103 dict->SetString("hash_state", | 103 dict->SetString("hash_state", |
104 base::HexEncode(hash_state->data(), hash_state->size())); | 104 base::HexEncode(hash_state->data(), hash_state->size())); |
105 | 105 |
106 return dict; | 106 return dict; |
107 } | 107 } |
108 | 108 |
109 base::Value* ItemFinishedCallback(int64 bytes_so_far, | 109 base::Value* ItemCompletingCallback(int64 bytes_so_far, |
110 const std::string* final_hash, | 110 const std::string* final_hash, |
111 net::NetLog::LogLevel /* log_level */) { | 111 net::NetLog::LogLevel /* log_level */) { |
112 DictionaryValue* dict = new DictionaryValue(); | 112 DictionaryValue* dict = new DictionaryValue(); |
113 | 113 |
114 dict->SetString("bytes_so_far", base::Int64ToString(bytes_so_far)); | 114 dict->SetString("bytes_so_far", base::Int64ToString(bytes_so_far)); |
115 dict->SetString("final_hash", | 115 dict->SetString("final_hash", |
116 base::HexEncode(final_hash->data(), final_hash->size())); | 116 base::HexEncode(final_hash->data(), final_hash->size())); |
117 | 117 |
118 return dict; | 118 return dict; |
119 } | 119 } |
120 | 120 |
| 121 base::Value* ItemFinishedCallback(bool auto_opened, |
| 122 net::NetLog::LogLevel /* log_level */) { |
| 123 DictionaryValue* dict = new DictionaryValue(); |
| 124 |
| 125 dict->SetString("auto_opened", auto_opened ? "yes" : "no"); |
| 126 |
| 127 return dict; |
| 128 } |
| 129 |
121 base::Value* ItemCanceledCallback(int64 bytes_so_far, | 130 base::Value* ItemCanceledCallback(int64 bytes_so_far, |
122 const std::string* hash_state, | 131 const std::string* hash_state, |
123 net::NetLog::LogLevel /* log_level */) { | 132 net::NetLog::LogLevel /* log_level */) { |
124 DictionaryValue* dict = new DictionaryValue(); | 133 DictionaryValue* dict = new DictionaryValue(); |
125 | 134 |
126 dict->SetString("bytes_so_far", base::Int64ToString(bytes_so_far)); | 135 dict->SetString("bytes_so_far", base::Int64ToString(bytes_so_far)); |
127 dict->SetString("hash_state", | 136 dict->SetString("hash_state", |
128 base::HexEncode(hash_state->data(), hash_state->size())); | 137 base::HexEncode(hash_state->data(), hash_state->size())); |
129 | 138 |
130 return dict; | 139 return dict; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 net::NetLog::LogLevel /* log_level */) { | 177 net::NetLog::LogLevel /* log_level */) { |
169 DictionaryValue* dict = new DictionaryValue(); | 178 DictionaryValue* dict = new DictionaryValue(); |
170 | 179 |
171 dict->SetString("operation", operation); | 180 dict->SetString("operation", operation); |
172 dict->SetInteger("net_error", net_error); | 181 dict->SetInteger("net_error", net_error); |
173 | 182 |
174 return dict; | 183 return dict; |
175 } | 184 } |
176 | 185 |
177 } // namespace download_net_logs | 186 } // namespace download_net_logs |
OLD | NEW |