/* * Copyright (c) 2023, Tim Flynn * * SPDX-License-Identifier: BSD-2-Clause */ #include #include namespace Web::HTML { TemporaryExecutionContext::TemporaryExecutionContext(EnvironmentSettingsObject& environment_settings, CallbacksEnabled callbacks_enabled) : m_environment_settings(environment_settings) , m_callbacks_enabled(callbacks_enabled) { m_environment_settings.prepare_to_run_script(); if (m_callbacks_enabled == CallbacksEnabled::Yes) m_environment_settings.prepare_to_run_callback(); } TemporaryExecutionContext::~TemporaryExecutionContext() { m_environment_settings.clean_up_after_running_script(); if (m_callbacks_enabled == CallbacksEnabled::Yes) m_environment_settings.clean_up_after_running_callback(); } }