#include "chrome/browser/ui/webui/media/webrtc_logs_ui.h"
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/i18n/time_formatting.h"
#include "base/memory/ref_counted_memory.h"
#include "base/memory/weak_ptr.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "base/values.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/media/webrtc/webrtc_event_log_manager.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/webui_util.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/generated_resources.h"
#include "chrome/grit/media_resources.h"
#include "components/prefs/pref_service.h"
#include "components/upload_list/upload_list.h"
#include "components/version_info/version_info.h"
#include "components/webrtc_logging/browser/text_log_list.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h"
#include "content/public/browser/web_ui_message_handler.h"
WebContents;
WebUIMessageHandler;
namespace {
void CreateAndAddWebRtcLogsUIHTMLSource(Profile* profile) { … }
class WebRtcLogsDOMHandler final : public WebUIMessageHandler { … };
WebRtcLogsDOMHandler::WebRtcLogsDOMHandler(Profile* profile)
: … { … }
WebRtcLogsDOMHandler::~WebRtcLogsDOMHandler() { … }
void WebRtcLogsDOMHandler::RegisterMessages() { … }
void WebRtcLogsDOMHandler::HandleRequestWebRtcLogs(
const base::Value::List& args) { … }
void WebRtcLogsDOMHandler::OnJavascriptDisallowed() { … }
void WebRtcLogsDOMHandler::LoadWebRtcTextLogs(const std::string& callback_id) { … }
void WebRtcLogsDOMHandler::OnWebRtcTextLogsLoaded(
const std::string& callback_id) { … }
void WebRtcLogsDOMHandler::LoadWebRtcEventLogs(const std::string& callback_id) { … }
void WebRtcLogsDOMHandler::OnWebRtcEventLogsLoaded(
const std::string& callback_id,
const std::vector<UploadList::UploadInfo>& event_logs) { … }
void WebRtcLogsDOMHandler::UpdateUI(const std::string& callback_id) { … }
base::Value::List WebRtcLogsDOMHandler::UpdateUIWithTextLogs() const { … }
base::Value::List WebRtcLogsDOMHandler::UpdateUIWithEventLogs() const { … }
base::Value WebRtcLogsDOMHandler::EventLogUploadInfoToValue(
const UploadList::UploadInfo& info) const { … }
base::Value WebRtcLogsDOMHandler::FromPendingLog(
const UploadList::UploadInfo& info) const { … }
base::Value WebRtcLogsDOMHandler::FromActivelyUploadedLog(
const UploadList::UploadInfo& info) const { … }
base::Value WebRtcLogsDOMHandler::FromNotUploadedLog(
const UploadList::UploadInfo& info) const { … }
base::Value WebRtcLogsDOMHandler::FromUploadUnsuccessfulLog(
const UploadList::UploadInfo& info) const { … }
base::Value WebRtcLogsDOMHandler::FromUploadSuccessfulLog(
const UploadList::UploadInfo& info) const { … }
bool WebRtcLogsDOMHandler::SanityCheckOnUploadInfo(
const UploadList::UploadInfo& info) const { … }
}
WebRtcLogsUI::WebRtcLogsUI(content::WebUI* web_ui) : … { … }