#include "third_party/blink/renderer/bindings/core/v8/script_controller.h"
#include <memory>
#include <utility>
#include "base/functional/callback_helpers.h"
#include "third_party/blink/renderer/bindings/core/v8/script_evaluation_result.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_gc_controller.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_script_runner.h"
#include "third_party/blink/renderer/bindings/core/v8/window_proxy.h"
#include "third_party/blink/renderer/bindings/core/v8/window_proxy_manager.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/scriptable_document_parser.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/frame/csp/content_security_policy.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/core/frame/local_frame_client.h"
#include "third_party/blink/renderer/core/html/html_plugin_element.h"
#include "third_party/blink/renderer/core/inspector/console_message.h"
#include "third_party/blink/renderer/core/inspector/inspector_trace_events.h"
#include "third_party/blink/renderer/core/inspector/main_thread_debugger.h"
#include "third_party/blink/renderer/core/loader/document_loader.h"
#include "third_party/blink/renderer/core/loader/frame_loader.h"
#include "third_party/blink/renderer/core/loader/progress_tracker.h"
#include "third_party/blink/renderer/core/probe/core_probes.h"
#include "third_party/blink/renderer/core/script/classic_script.h"
#include "third_party/blink/renderer/platform/bindings/dom_wrapper_world.h"
#include "third_party/blink/renderer/platform/instrumentation/histogram.h"
#include "third_party/blink/renderer/platform/instrumentation/tracing/trace_event.h"
#include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
#include "third_party/blink/renderer/platform/weborigin/security_origin.h"
#include "third_party/blink/renderer/platform/wtf/std_lib_extras.h"
#include "third_party/blink/renderer/platform/wtf/text/string_builder.h"
#include "third_party/blink/renderer/platform/wtf/text/string_utf8_adaptor.h"
namespace blink {
namespace {
bool IsTrivialScript(const String& script) { … }
}
void ScriptController::Trace(Visitor* visitor) const { … }
LocalWindowProxy* ScriptController::WindowProxy(DOMWrapperWorld& world) { … }
void ScriptController::UpdateSecurityOrigin(
const SecurityOrigin* security_origin) { … }
TextPosition ScriptController::EventHandlerPosition() const { … }
void ScriptController::DisableEval(const String& error_message) { … }
void ScriptController::SetWasmEvalErrorMessage(const String& error_message) { … }
void ScriptController::DisableEvalForIsolatedWorld(
int32_t world_id,
const String& error_message) { … }
void ScriptController::SetWasmEvalErrorMessageForIsolatedWorld(
int32_t world_id,
const String& error_message) { … }
void ScriptController::SetEvalForWorld(DOMWrapperWorld& world,
bool allow_eval,
const String& error_message) { … }
void ScriptController::SetWasmEvalErrorMessageForWorld(
DOMWrapperWorld& world,
bool allow_eval,
const String& error_message) { … }
namespace {
Vector<const char*>& RegisteredExtensionNames() { … }
}
void ScriptController::RegisterExtensionIfNeeded(
std::unique_ptr<v8::Extension> extension) { … }
v8::ExtensionConfiguration ScriptController::ExtensionsFor(
const ExecutionContext* context) { … }
void ScriptController::UpdateDocument() { … }
void ScriptController::DiscardFrame() { … }
void ScriptController::ExecuteJavaScriptURL(
const KURL& url,
network::mojom::CSPDisposition csp_disposition,
const DOMWrapperWorld* world_for_csp) { … }
v8::Local<v8::Value> ScriptController::EvaluateMethodInMainWorld(
v8::Local<v8::Function> function,
v8::Local<v8::Value> receiver,
int argc,
v8::Local<v8::Value> argv[]) { … }
bool ScriptController::CanExecuteScript(ExecuteScriptPolicy policy) { … }
v8::Isolate* ScriptController::GetIsolate() const { … }
DOMWrapperWorld* ScriptController::CreateNewInspectorIsolatedWorld(
const String& world_name) { … }
}