| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "chrome/browser/media/webrtc/webrtc_text_log_handler.h" | 5 #include "chrome/browser/media/webrtc/webrtc_text_log_handler.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/cpu.h" | 13 #include "base/cpu.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
| 16 #include "base/strings/stringprintf.h" | 16 #include "base/strings/stringprintf.h" |
| 17 #include "base/sys_info.h" | 17 #include "base/sys_info.h" |
| 18 #include "base/time/time.h" | 18 #include "base/time/time.h" |
| 19 #include "chrome/browser/media/webrtc/webrtc_log_uploader.h" | 19 #include "chrome/browser/media/webrtc/webrtc_log_uploader.h" |
| 20 #include "chrome/common/channel_info.h" | 20 #include "chrome/common/channel_info.h" |
| 21 #include "chrome/common/media/webrtc_logging_messages.h" | 21 #include "chrome/common/media/webrtc_logging_messages.h" |
| 22 #include "components/version_info/version_info.h" | 22 #include "components/version_info/version_info.h" |
| 23 #include "content/public/browser/browser_thread.h" | 23 #include "content/public/browser/browser_thread.h" |
| 24 #include "content/public/browser/gpu_data_manager.h" | 24 #include "content/public/browser/gpu_data_manager.h" |
| 25 #include "content/public/browser/render_process_host.h" | 25 #include "content/public/browser/render_process_host.h" |
| 26 #include "gpu/config/gpu_info.h" | 26 #include "gpu/config/gpu_info.h" |
| 27 #include "media/audio/audio_manager.h" |
| 27 #include "net/base/ip_address.h" | 28 #include "net/base/ip_address.h" |
| 28 #include "net/base/network_change_notifier.h" | 29 #include "net/base/network_change_notifier.h" |
| 29 #include "net/base/network_interfaces.h" | 30 #include "net/base/network_interfaces.h" |
| 30 | 31 |
| 31 #if defined(OS_LINUX) | 32 #if defined(OS_LINUX) |
| 32 #include "base/linux_util.h" | 33 #include "base/linux_util.h" |
| 33 #endif | 34 #endif |
| 34 | 35 |
| 35 #if defined(OS_MACOSX) | 36 #if defined(OS_MACOSX) |
| 36 #include "base/mac/mac_util.h" | 37 #include "base/mac/mac_util.h" |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 "Gpu: machine-model-name=" + gpu_info.machine_model_name + | 468 "Gpu: machine-model-name=" + gpu_info.machine_model_name + |
| 468 ", machine-model-version=" + gpu_info.machine_model_version + | 469 ", machine-model-version=" + gpu_info.machine_model_version + |
| 469 ", vendor-id=" + base::UintToString(gpu_info.gpu.vendor_id) + | 470 ", vendor-id=" + base::UintToString(gpu_info.gpu.vendor_id) + |
| 470 ", device-id=" + base::UintToString(gpu_info.gpu.device_id) + | 471 ", device-id=" + base::UintToString(gpu_info.gpu.device_id) + |
| 471 ", driver-vendor=" + gpu_info.driver_vendor + ", driver-version=" + | 472 ", driver-vendor=" + gpu_info.driver_vendor + ", driver-version=" + |
| 472 gpu_info.driver_version); | 473 gpu_info.driver_version); |
| 473 LogToCircularBuffer("OpenGL: gl-vendor=" + gpu_info.gl_vendor + | 474 LogToCircularBuffer("OpenGL: gl-vendor=" + gpu_info.gl_vendor + |
| 474 ", gl-renderer=" + gpu_info.gl_renderer + | 475 ", gl-renderer=" + gpu_info.gl_renderer + |
| 475 ", gl-version=" + gpu_info.gl_version); | 476 ", gl-version=" + gpu_info.gl_version); |
| 476 | 477 |
| 478 // Audio manager |
| 479 // On some platforms, this can vary depending on build flags and failure |
| 480 // fallbacks. On Linux for example, we fallback on ALSA if PulseAudio fails to |
| 481 // initialize. |
| 482 LogToCircularBuffer(base::StringPrintf( |
| 483 "Audio manager: %s", media::AudioManager::Get()->GetName())); |
| 484 |
| 477 // Network interfaces | 485 // Network interfaces |
| 478 LogToCircularBuffer("Discovered " + base::SizeTToString(network_list.size()) + | 486 LogToCircularBuffer("Discovered " + base::SizeTToString(network_list.size()) + |
| 479 " network interfaces:"); | 487 " network interfaces:"); |
| 480 for (const auto& network : network_list) { | 488 for (const auto& network : network_list) { |
| 481 LogToCircularBuffer( | 489 LogToCircularBuffer( |
| 482 "Name: " + network.friendly_name + ", Address: " + | 490 "Name: " + network.friendly_name + ", Address: " + |
| 483 IPAddressToSensitiveString(network.address) + ", Type: " + | 491 IPAddressToSensitiveString(network.address) + ", Type: " + |
| 484 net::NetworkChangeNotifier::ConnectionTypeToString(network.type)); | 492 net::NetworkChangeNotifier::ConnectionTypeToString(network.type)); |
| 485 } | 493 } |
| 486 | 494 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 497 } | 505 } |
| 498 } | 506 } |
| 499 | 507 |
| 500 void WebRtcTextLogHandler::DisableBrowserProcessLoggingOnUIThread() { | 508 void WebRtcTextLogHandler::DisableBrowserProcessLoggingOnUIThread() { |
| 501 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 509 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 502 content::RenderProcessHost* host = | 510 content::RenderProcessHost* host = |
| 503 content::RenderProcessHost::FromID(render_process_id_); | 511 content::RenderProcessHost::FromID(render_process_id_); |
| 504 if (host) | 512 if (host) |
| 505 host->ClearWebRtcLogMessageCallback(); | 513 host->ClearWebRtcLogMessageCallback(); |
| 506 } | 514 } |
| OLD | NEW |