Chromium Code Reviews| 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 10 matching lines...) Expand all Loading... | |
| 21 #include "content/browser/tracing/trace_message_filter.h" | 21 #include "content/browser/tracing/trace_message_filter.h" |
| 22 #include "content/browser/tracing/tracing_ui.h" | 22 #include "content/browser/tracing/tracing_ui.h" |
| 23 #include "content/common/child_process_messages.h" | 23 #include "content/common/child_process_messages.h" |
| 24 #include "content/public/browser/browser_message_filter.h" | 24 #include "content/public/browser/browser_message_filter.h" |
| 25 #include "content/public/browser/content_browser_client.h" | 25 #include "content/public/browser/content_browser_client.h" |
| 26 #include "content/public/browser/gpu_data_manager.h" | 26 #include "content/public/browser/gpu_data_manager.h" |
| 27 #include "content/public/browser/tracing_delegate.h" | 27 #include "content/public/browser/tracing_delegate.h" |
| 28 #include "content/public/common/child_process_host.h" | 28 #include "content/public/common/child_process_host.h" |
| 29 #include "content/public/common/content_client.h" | 29 #include "content/public/common/content_client.h" |
| 30 #include "content/public/common/content_switches.h" | 30 #include "content/public/common/content_switches.h" |
| 31 #include "content/public/common/user_agent.h" | |
| 31 #include "gpu/config/gpu_info.h" | 32 #include "gpu/config/gpu_info.h" |
| 32 #include "net/base/network_change_notifier.h" | 33 #include "net/base/network_change_notifier.h" |
| 33 | 34 |
| 34 #if (defined(OS_POSIX) && defined(USE_UDEV)) || defined(OS_WIN) || \ | 35 #if (defined(OS_POSIX) && defined(USE_UDEV)) || defined(OS_WIN) || \ |
| 35 defined(OS_MACOSX) | 36 defined(OS_MACOSX) |
| 36 #define ENABLE_POWER_TRACING | 37 #define ENABLE_POWER_TRACING |
| 37 #endif | 38 #endif |
| 38 | 39 |
| 39 #if defined(ENABLE_POWER_TRACING) | 40 #if defined(ENABLE_POWER_TRACING) |
| 40 #include "content/browser/tracing/power_tracing_agent.h" | 41 #include "content/browser/tracing/power_tracing_agent.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 107 NOTREACHED(); | 108 NOTREACHED(); |
| 108 return std::string(); | 109 return std::string(); |
| 109 } | 110 } |
| 110 | 111 |
| 111 std::unique_ptr<base::DictionaryValue> GenerateTracingMetadataDict() { | 112 std::unique_ptr<base::DictionaryValue> GenerateTracingMetadataDict() { |
| 112 std::unique_ptr<base::DictionaryValue> metadata_dict( | 113 std::unique_ptr<base::DictionaryValue> metadata_dict( |
| 113 new base::DictionaryValue()); | 114 new base::DictionaryValue()); |
| 114 | 115 |
| 115 metadata_dict->SetString("network-type", GetNetworkTypeString()); | 116 metadata_dict->SetString("network-type", GetNetworkTypeString()); |
| 116 metadata_dict->SetString("product-version", GetContentClient()->GetProduct()); | 117 metadata_dict->SetString("product-version", GetContentClient()->GetProduct()); |
| 118 metadata_dict->SetString("blink-version", content::GetWebKitVersion()); | |
| 119 metadata_dict->SetString("revision", GetContentClient()->GetLastChange()); | |
|
nednguyen
2016/06/17 20:38:12
Can we also have v8 revision? :)
| |
| 117 metadata_dict->SetString("user-agent", GetContentClient()->GetUserAgent()); | 120 metadata_dict->SetString("user-agent", GetContentClient()->GetUserAgent()); |
| 118 | 121 |
| 119 // OS | 122 // OS |
| 120 metadata_dict->SetString("os-name", base::SysInfo::OperatingSystemName()); | 123 metadata_dict->SetString("os-name", base::SysInfo::OperatingSystemName()); |
| 121 metadata_dict->SetString("os-version", | 124 metadata_dict->SetString("os-version", |
| 122 base::SysInfo::OperatingSystemVersion()); | 125 base::SysInfo::OperatingSystemVersion()); |
| 123 metadata_dict->SetString("os-arch", | 126 metadata_dict->SetString("os-arch", |
| 124 base::SysInfo::OperatingSystemArchitecture()); | 127 base::SysInfo::OperatingSystemArchitecture()); |
| 125 | 128 |
| 126 // CPU | 129 // CPU |
| (...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1029 const bool global_success = failed_memory_dump_count_ == 0; | 1032 const bool global_success = failed_memory_dump_count_ == 0; |
| 1030 if (!pending_memory_dump_callback_.is_null()) { | 1033 if (!pending_memory_dump_callback_.is_null()) { |
| 1031 pending_memory_dump_callback_.Run(pending_memory_dump_guid_, | 1034 pending_memory_dump_callback_.Run(pending_memory_dump_guid_, |
| 1032 global_success); | 1035 global_success); |
| 1033 pending_memory_dump_callback_.Reset(); | 1036 pending_memory_dump_callback_.Reset(); |
| 1034 } | 1037 } |
| 1035 pending_memory_dump_guid_ = 0; | 1038 pending_memory_dump_guid_ = 0; |
| 1036 } | 1039 } |
| 1037 | 1040 |
| 1038 } // namespace content | 1041 } // namespace content |
| OLD | NEW |