#include "chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api.h"
#include <memory>
#include <utility>
#include "base/check_op.h"
#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/hash/hash.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/supports_user_data.h"
#include "build/build_config.h"
#include "chrome/browser/extensions/api/tabs/tabs_constants.h"
#include "chrome/browser/extensions/extension_tab_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_switches.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/site_instance.h"
#include "content/public/browser/web_contents.h"
#include "extensions/browser/guest_view/web_view/web_view_guest.h"
#include "extensions/browser/process_manager.h"
#include "extensions/common/error_utils.h"
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
#include "extensions/common/permissions/permissions_data.h"
#endif
namespace {
bool CanEnableAudioDebugRecordingsFromExtension(
const extensions::Extension* extension) { … }
}
namespace extensions {
MetaDataEntry;
BrowserThread;
Discard;
SetMetaData;
SetUploadOnRenderClose;
Start;
StartRtpDump;
Stop;
StopRtpDump;
Store;
Upload;
UploadStored;
StartAudioDebugRecordings;
StopAudioDebugRecordings;
StartEventLogging;
GetLogsDirectory;
namespace {
std::string HashIdWithOrigin(const std::string& security_origin,
const std::string& log_id) { … }
}
content::RenderProcessHost* WebrtcLoggingPrivateFunction::RphFromRequest(
const api::webrtc_logging_private::RequestInfo& request,
const std::string& security_origin,
std::string* error) { … }
WebRtcLoggingController*
WebrtcLoggingPrivateFunction::LoggingControllerFromRequest(
const api::webrtc_logging_private::RequestInfo& request,
const std::string& security_origin,
std::string* error) { … }
WebRtcLoggingController*
WebrtcLoggingPrivateFunctionWithGenericCallback::PrepareTask(
const api::webrtc_logging_private::RequestInfo& request,
const std::string& security_origin,
WebRtcLoggingController::GenericDoneCallback* callback,
std::string* error) { … }
void WebrtcLoggingPrivateFunctionWithGenericCallback::FireCallback(
bool success, const std::string& error_message) { … }
void WebrtcLoggingPrivateFunctionWithUploadCallback::FireCallback(
bool success, const std::string& report_id,
const std::string& error_message) { … }
void WebrtcLoggingPrivateFunctionWithRecordingDoneCallback::FireErrorCallback(
const std::string& error_message) { … }
void WebrtcLoggingPrivateFunctionWithRecordingDoneCallback::FireCallback(
const std::string& prefix_path,
bool did_stop,
bool did_manual_stop) { … }
ExtensionFunction::ResponseAction
WebrtcLoggingPrivateSetMetaDataFunction::Run() { … }
ExtensionFunction::ResponseAction WebrtcLoggingPrivateStartFunction::Run() { … }
ExtensionFunction::ResponseAction
WebrtcLoggingPrivateSetUploadOnRenderCloseFunction::Run() { … }
ExtensionFunction::ResponseAction WebrtcLoggingPrivateStopFunction::Run() { … }
ExtensionFunction::ResponseAction WebrtcLoggingPrivateStoreFunction::Run() { … }
ExtensionFunction::ResponseAction
WebrtcLoggingPrivateUploadStoredFunction::Run() { … }
ExtensionFunction::ResponseAction WebrtcLoggingPrivateUploadFunction::Run() { … }
ExtensionFunction::ResponseAction WebrtcLoggingPrivateDiscardFunction::Run() { … }
ExtensionFunction::ResponseAction
WebrtcLoggingPrivateStartRtpDumpFunction::Run() { … }
ExtensionFunction::ResponseAction
WebrtcLoggingPrivateStopRtpDumpFunction::Run() { … }
ExtensionFunction::ResponseAction
WebrtcLoggingPrivateStartAudioDebugRecordingsFunction::Run() { … }
ExtensionFunction::ResponseAction
WebrtcLoggingPrivateStopAudioDebugRecordingsFunction::Run() { … }
ExtensionFunction::ResponseAction
WebrtcLoggingPrivateStartEventLoggingFunction::Run() { … }
void WebrtcLoggingPrivateStartEventLoggingFunction::FireCallback(
bool success,
const std::string& log_id,
const std::string& error_message) { … }
ExtensionFunction::ResponseAction
WebrtcLoggingPrivateGetLogsDirectoryFunction::Run() { … }
void WebrtcLoggingPrivateGetLogsDirectoryFunction::FireCallback(
const std::string& filesystem_id,
const std::string& base_name) { … }
void WebrtcLoggingPrivateGetLogsDirectoryFunction::FireErrorCallback(
const std::string& error_message) { … }
}