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( | |
17 const std::string& file_name, | |
18 int64 start_offset) | |
19 : file_name_(file_name), start_offset_(start_offset) { | |
mmenke1
2012/02/03 18:32:32
nit: Fix indent
ahendrickson
2012/02/04 05:27:14
Done.
| |
20 } | |
21 | |
22 Value* FileOpenedParameters::ToValue() const { | |
23 DictionaryValue* dict = new DictionaryValue(); | |
24 | |
25 dict->SetString("file_name", file_name_); | |
26 dict->SetDouble("start_offset", start_offset_); | |
27 | |
28 return dict; | |
29 } | |
30 | |
31 FileWrittenParameters::FileWrittenParameters( | |
32 int64 bytes_in_write, int64 bytes_so_far) | |
33 : bytes_in_write_(bytes_in_write), bytes_so_far_(bytes_so_far) { | |
34 } | |
35 | |
36 Value* FileWrittenParameters::ToValue() const { | |
37 DictionaryValue* dict = new DictionaryValue(); | |
38 | |
39 dict->SetDouble("bytes_in_write", bytes_in_write_); | |
40 dict->SetDouble("bytes_so_far", bytes_so_far_); | |
mmenke1
2012/02/03 18:32:32
nit: These names seem a little weird. I'd sugges
ahendrickson
2012/02/04 05:27:14
Done.
| |
41 | |
42 return dict; | |
43 } | |
44 | |
45 FileRenamedParameters::FileRenamedParameters( | |
46 const std::string& old_filename, const std::string& new_filename) | |
47 : old_filename_(old_filename), new_filename_(new_filename) { | |
48 } | |
49 | |
50 Value* FileRenamedParameters::ToValue() const { | |
51 DictionaryValue* dict = new DictionaryValue(); | |
52 | |
53 dict->SetString("old_filename", old_filename_); | |
54 dict->SetString("new_filename", new_filename_); | |
55 | |
56 return dict; | |
57 } | |
58 | |
59 FileErrorParameters::FileErrorParameters(const std::string& operation, | |
60 net::Error net_error) | |
61 : operation_(operation), net_error_(net_error) { | |
62 } | |
63 | |
64 Value* FileErrorParameters::ToValue() const { | |
65 DictionaryValue* dict = new DictionaryValue(); | |
66 | |
67 dict->SetString("operation", operation_); | |
68 dict->SetInteger("net_error", net_error_); | |
69 | |
70 return dict; | |
71 } | |
72 | |
73 } // namespace download_net_logs | |
OLD | NEW |