| 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/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 | 196 |
| 197 Value* FileOpenedParameters::ToValue() const { | 197 Value* FileOpenedParameters::ToValue() const { |
| 198 DictionaryValue* dict = new DictionaryValue(); | 198 DictionaryValue* dict = new DictionaryValue(); |
| 199 | 199 |
| 200 dict->SetString("file_name", file_name_); | 200 dict->SetString("file_name", file_name_); |
| 201 dict->SetString("start_offset", base::Int64ToString(start_offset_)); | 201 dict->SetString("start_offset", base::Int64ToString(start_offset_)); |
| 202 | 202 |
| 203 return dict; | 203 return dict; |
| 204 } | 204 } |
| 205 | 205 |
| 206 FilePipeDrainedParameters::FilePipeDrainedParameters( |
| 207 size_t pipe_size, size_t num_buffers) |
| 208 : pipe_size_(pipe_size), num_buffers_(num_buffers) { |
| 209 } |
| 210 |
| 211 Value* FilePipeDrainedParameters::ToValue() const { |
| 212 DictionaryValue* dict = new DictionaryValue(); |
| 213 |
| 214 dict->SetInteger("pipe_size", static_cast<int>(pipe_size_)); |
| 215 dict->SetInteger("num_buffers", static_cast<int>(num_buffers_)); |
| 216 |
| 217 return dict; |
| 218 } |
| 219 |
| 206 FileRenamedParameters::FileRenamedParameters( | 220 FileRenamedParameters::FileRenamedParameters( |
| 207 const std::string& old_filename, const std::string& new_filename) | 221 const std::string& old_filename, const std::string& new_filename) |
| 208 : old_filename_(old_filename), new_filename_(new_filename) { | 222 : old_filename_(old_filename), new_filename_(new_filename) { |
| 209 } | 223 } |
| 210 | 224 |
| 211 Value* FileRenamedParameters::ToValue() const { | 225 Value* FileRenamedParameters::ToValue() const { |
| 212 DictionaryValue* dict = new DictionaryValue(); | 226 DictionaryValue* dict = new DictionaryValue(); |
| 213 | 227 |
| 214 dict->SetString("old_filename", old_filename_); | 228 dict->SetString("old_filename", old_filename_); |
| 215 dict->SetString("new_filename", new_filename_); | 229 dict->SetString("new_filename", new_filename_); |
| 216 | 230 |
| 217 return dict; | 231 return dict; |
| 218 } | 232 } |
| 219 | 233 |
| 220 FileErrorParameters::FileErrorParameters(const std::string& operation, | 234 FileErrorParameters::FileErrorParameters(const std::string& operation, |
| 221 net::Error net_error) | 235 net::Error net_error) |
| 222 : operation_(operation), net_error_(net_error) { | 236 : operation_(operation), net_error_(net_error) { |
| 223 } | 237 } |
| 224 | 238 |
| 225 Value* FileErrorParameters::ToValue() const { | 239 Value* FileErrorParameters::ToValue() const { |
| 226 DictionaryValue* dict = new DictionaryValue(); | 240 DictionaryValue* dict = new DictionaryValue(); |
| 227 | 241 |
| 228 dict->SetString("operation", operation_); | 242 dict->SetString("operation", operation_); |
| 229 dict->SetInteger("net_error", net_error_); | 243 dict->SetInteger("net_error", net_error_); |
| 230 | 244 |
| 231 return dict; | 245 return dict; |
| 232 } | 246 } |
| 233 | 247 |
| 234 } // namespace download_net_logs | 248 } // namespace download_net_logs |
| OLD | NEW |