#include "extensions/renderer/api_activity_logger.h"
#include <stddef.h>
#include <string>
#include <utility>
#include "base/functional/bind.h"
#include "content/public/renderer/v8_value_converter.h"
#include "extensions/renderer/activity_log_converter_strategy.h"
#include "extensions/renderer/dispatcher.h"
#include "extensions/renderer/extensions_renderer_client.h"
#include "extensions/renderer/ipc_message_sender.h"
#include "extensions/renderer/script_context.h"
#include "extensions/renderer/worker_script_context_set.h"
#include "extensions/renderer/worker_thread_util.h"
#include "v8/include/v8-container.h"
#include "v8/include/v8-function-callback.h"
#include "v8/include/v8-isolate.h"
#include "v8/include/v8-primitive.h"
namespace extensions {
namespace {
bool g_log_for_testing = …;
ScriptContext* GetContextByV8Context(v8::Local<v8::Context> context) { … }
}
APIActivityLogger::APIActivityLogger(IPCMessageSender* ipc_sender,
ScriptContext* context)
: … { … }
APIActivityLogger::~APIActivityLogger() = default;
void APIActivityLogger::AddRoutes() { … }
bool APIActivityLogger::IsLoggingEnabled() { … }
void APIActivityLogger::LogAPICall(
IPCMessageSender* ipc_sender,
v8::Local<v8::Context> context,
const std::string& call_name,
const v8::LocalVector<v8::Value>& arguments) { … }
void APIActivityLogger::LogEvent(IPCMessageSender* ipc_sender,
ScriptContext* script_context,
const std::string& event_name,
base::Value::List arguments) { … }
void APIActivityLogger::set_log_for_testing(bool log) { … }
void APIActivityLogger::LogForJS(
const IPCMessageSender::ActivityLogCallType call_type,
const v8::FunctionCallbackInfo<v8::Value>& args) { … }
}