OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #include "content/browser/tracing/tracing_controller_impl.h" | 4 #include "content/browser/tracing/tracing_controller_impl.h" |
5 | 5 |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/cpu.h" | 7 #include "base/cpu.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/guid.h" | 9 #include "base/guid.h" |
10 #include "base/json/string_escape.h" | 10 #include "base/json/string_escape.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
110 | 110 |
111 std::unique_ptr<base::DictionaryValue> GenerateTracingMetadataDict() { | 111 std::unique_ptr<base::DictionaryValue> GenerateTracingMetadataDict() { |
112 std::unique_ptr<base::DictionaryValue> metadata_dict( | 112 std::unique_ptr<base::DictionaryValue> metadata_dict( |
113 new base::DictionaryValue()); | 113 new base::DictionaryValue()); |
114 | 114 |
115 metadata_dict->SetString("network-type", GetNetworkTypeString()); | 115 metadata_dict->SetString("network-type", GetNetworkTypeString()); |
116 metadata_dict->SetString("product-version", GetContentClient()->GetProduct()); | 116 metadata_dict->SetString("product-version", GetContentClient()->GetProduct()); |
117 metadata_dict->SetString("user-agent", GetContentClient()->GetUserAgent()); | 117 metadata_dict->SetString("user-agent", GetContentClient()->GetUserAgent()); |
118 | 118 |
119 // OS | 119 // OS |
120 #if defined(OS_CHROMEOS) | |
121 metadata_dict->SetString("os-name", "CrOS"); | |
122 int32_t major_version; | |
123 int32_t minor_version; | |
124 int32_t bugfix_version; | |
125 base::SysInfo::OperatingSystemVersionNumbers(&major_version, &minor_version, | |
oystein (OOO til 10th of July)
2016/06/19 08:59:44
What's the functional difference between setting o
| |
126 &bugfix_version); | |
127 metadata_dict->SetString( | |
128 "os-version", base::StringPrintf("%d.%d.%d", major_version, minor_version, | |
129 bugfix_version)); | |
130 #elif | |
oystein (OOO til 10th of July)
2016/06/19 08:59:44
#else i guess :)
| |
120 metadata_dict->SetString("os-name", base::SysInfo::OperatingSystemName()); | 131 metadata_dict->SetString("os-name", base::SysInfo::OperatingSystemName()); |
121 metadata_dict->SetString("os-version", | 132 metadata_dict->SetString("os-version", |
122 base::SysInfo::OperatingSystemVersion()); | 133 base::SysInfo::OperatingSystemVersion()); |
134 #endif | |
123 metadata_dict->SetString("os-arch", | 135 metadata_dict->SetString("os-arch", |
124 base::SysInfo::OperatingSystemArchitecture()); | 136 base::SysInfo::OperatingSystemArchitecture()); |
125 | 137 |
126 // CPU | 138 // CPU |
127 base::CPU cpu; | 139 base::CPU cpu; |
128 metadata_dict->SetInteger("cpu-family", cpu.family()); | 140 metadata_dict->SetInteger("cpu-family", cpu.family()); |
129 metadata_dict->SetInteger("cpu-model", cpu.model()); | 141 metadata_dict->SetInteger("cpu-model", cpu.model()); |
130 metadata_dict->SetInteger("cpu-stepping", cpu.stepping()); | 142 metadata_dict->SetInteger("cpu-stepping", cpu.stepping()); |
131 metadata_dict->SetInteger("num-cpus", base::SysInfo::NumberOfProcessors()); | 143 metadata_dict->SetInteger("num-cpus", base::SysInfo::NumberOfProcessors()); |
132 metadata_dict->SetInteger("physical-memory", | 144 metadata_dict->SetInteger("physical-memory", |
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1029 const bool global_success = failed_memory_dump_count_ == 0; | 1041 const bool global_success = failed_memory_dump_count_ == 0; |
1030 if (!pending_memory_dump_callback_.is_null()) { | 1042 if (!pending_memory_dump_callback_.is_null()) { |
1031 pending_memory_dump_callback_.Run(pending_memory_dump_guid_, | 1043 pending_memory_dump_callback_.Run(pending_memory_dump_guid_, |
1032 global_success); | 1044 global_success); |
1033 pending_memory_dump_callback_.Reset(); | 1045 pending_memory_dump_callback_.Reset(); |
1034 } | 1046 } |
1035 pending_memory_dump_guid_ = 0; | 1047 pending_memory_dump_guid_ = 0; |
1036 } | 1048 } |
1037 | 1049 |
1038 } // namespace content | 1050 } // namespace content |
OLD | NEW |