OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/browser/download/download_net_log_parameters.h" |
| 6 |
| 7 #include "base/basictypes.h" |
| 8 #include "base/logging.h" |
| 9 #include "base/string_number_conversions.h" |
| 10 #include "base/values.h" |
| 11 #include "content/browser/download/interrupt_reasons.h" |
| 12 #include "net/base/net_errors.h" |
| 13 |
| 14 namespace download_net_logs { |
| 15 |
| 16 FileOpenedParameters::FileOpenedParameters(const std::string& file_name, |
| 17 int64 start_offset) |
| 18 : file_name_(file_name), start_offset_(start_offset) { |
| 19 } |
| 20 |
| 21 Value* FileOpenedParameters::ToValue() const { |
| 22 DictionaryValue* dict = new DictionaryValue(); |
| 23 |
| 24 dict->SetString("file_name", file_name_); |
| 25 dict->SetString("start_offset", base::Int64ToString(start_offset_)); |
| 26 |
| 27 return dict; |
| 28 } |
| 29 |
| 30 FileRenamedParameters::FileRenamedParameters( |
| 31 const std::string& old_filename, const std::string& new_filename) |
| 32 : old_filename_(old_filename), new_filename_(new_filename) { |
| 33 } |
| 34 |
| 35 Value* FileRenamedParameters::ToValue() const { |
| 36 DictionaryValue* dict = new DictionaryValue(); |
| 37 |
| 38 dict->SetString("old_filename", old_filename_); |
| 39 dict->SetString("new_filename", new_filename_); |
| 40 |
| 41 return dict; |
| 42 } |
| 43 |
| 44 FileErrorParameters::FileErrorParameters(const std::string& operation, |
| 45 net::Error net_error) |
| 46 : operation_(operation), net_error_(net_error) { |
| 47 } |
| 48 |
| 49 Value* FileErrorParameters::ToValue() const { |
| 50 DictionaryValue* dict = new DictionaryValue(); |
| 51 |
| 52 dict->SetString("operation", operation_); |
| 53 dict->SetInteger("net_error", net_error_); |
| 54 |
| 55 return dict; |
| 56 } |
| 57 |
| 58 } // namespace download_net_logs |
OLD | NEW |