| 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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 DictionaryValue* dict = new DictionaryValue(); | 211 DictionaryValue* dict = new DictionaryValue(); |
| 212 | 212 |
| 213 dict->SetString("file_name", file_name_); | 213 dict->SetString("file_name", file_name_); |
| 214 dict->SetString("start_offset", base::Int64ToString(start_offset_)); | 214 dict->SetString("start_offset", base::Int64ToString(start_offset_)); |
| 215 | 215 |
| 216 return dict; | 216 return dict; |
| 217 } | 217 } |
| 218 | 218 |
| 219 FileOpenedParameters::~FileOpenedParameters() {} | 219 FileOpenedParameters::~FileOpenedParameters() {} |
| 220 | 220 |
| 221 FileStreamDrainedParameters::FileStreamDrainedParameters( |
| 222 size_t stream_size, size_t num_buffers) |
| 223 : stream_size_(stream_size), num_buffers_(num_buffers) { |
| 224 } |
| 225 |
| 226 Value* FileStreamDrainedParameters::ToValue() const { |
| 227 DictionaryValue* dict = new DictionaryValue(); |
| 228 |
| 229 dict->SetInteger("stream_size", static_cast<int>(stream_size_)); |
| 230 dict->SetInteger("num_buffers", static_cast<int>(num_buffers_)); |
| 231 |
| 232 return dict; |
| 233 } |
| 234 |
| 235 FileStreamDrainedParameters::~FileStreamDrainedParameters() { } |
| 236 |
| 221 FileRenamedParameters::FileRenamedParameters( | 237 FileRenamedParameters::FileRenamedParameters( |
| 222 const std::string& old_filename, const std::string& new_filename) | 238 const std::string& old_filename, const std::string& new_filename) |
| 223 : old_filename_(old_filename), new_filename_(new_filename) { | 239 : old_filename_(old_filename), new_filename_(new_filename) { |
| 224 } | 240 } |
| 225 | 241 |
| 226 Value* FileRenamedParameters::ToValue() const { | 242 Value* FileRenamedParameters::ToValue() const { |
| 227 DictionaryValue* dict = new DictionaryValue(); | 243 DictionaryValue* dict = new DictionaryValue(); |
| 228 | 244 |
| 229 dict->SetString("old_filename", old_filename_); | 245 dict->SetString("old_filename", old_filename_); |
| 230 dict->SetString("new_filename", new_filename_); | 246 dict->SetString("new_filename", new_filename_); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 244 | 260 |
| 245 dict->SetString("operation", operation_); | 261 dict->SetString("operation", operation_); |
| 246 dict->SetInteger("net_error", net_error_); | 262 dict->SetInteger("net_error", net_error_); |
| 247 | 263 |
| 248 return dict; | 264 return dict; |
| 249 } | 265 } |
| 250 | 266 |
| 251 FileErrorParameters::~FileErrorParameters() {} | 267 FileErrorParameters::~FileErrorParameters() {} |
| 252 | 268 |
| 253 } // namespace download_net_logs | 269 } // namespace download_net_logs |
| OLD | NEW |