#include "third_party/blink/renderer/controller/javascript_call_stack_collector.h"
#include "third_party/blink/public/common/permissions_policy/document_policy_features.h"
#include "third_party/blink/public/common/tokens/tokens.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/platform/bindings/dom_wrapper_world.h"
#include "third_party/blink/renderer/platform/bindings/script_state.h"
#include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#include "third_party/blink/renderer/platform/scheduler/public/main_thread.h"
#include "third_party/blink/renderer/platform/scheduler/public/main_thread_scheduler.h"
#include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_copier.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
#include "third_party/blink/renderer/platform/wtf/text/string_builder.h"
#include "third_party/blink/renderer/platform/wtf/wtf.h"
namespace WTF {
template <>
struct CrossThreadCopier<std::optional<blink::LocalFrameToken>>
: public CrossThreadCopierPassThrough<
std::optional<blink::LocalFrameToken>> { … };
}
namespace blink {
namespace {
void FormatStackTrace(v8::Isolate* isolate, StringBuilder& builder) { … }
void PostHandleCollectedCallStackTask(
JavaScriptCallStackCollector* collector,
WTF::StringBuilder& builder,
std::optional<LocalFrameToken> frame_token = std::nullopt) { … }
void GenerateJavaScriptCallStack(v8::Isolate* isolate, void* data) { … }
}
void JavaScriptCallStackCollector::InterruptIsolateAndCollectCallStack(
v8::Isolate* isolate) { … }
void JavaScriptCallStackCollector::HandleCallStackCollected(
const String& call_stack,
const std::optional<LocalFrameToken> frame_token) { … }
void JavaScriptCallStackCollector::CollectJavaScriptCallStack() { … }
}