/************************************************************************************************** * This file is a part of Ultralight, an ultra-portable web-browser engine. * * * * See for licensing and more. * * * * (C) 2024 Ultralight, Inc. * **************************************************************************************************/ #pragma once #include #include #include #include namespace ultralight { /// /// This class wraps a JSContextRef (a JavaScript execution context for use with JavaScriptCore) /// and locks the context on the current thread for the duration of its lifetime. /// class UExport JSContext : public RefCounted { public: /// Get the underlying JSContextRef for use with JavaScriptCore C API virtual JSContextRef ctx() = 0; /// Typecast to a JSContextRef for use with JavaScriptCore C API operator JSContextRef(); protected: virtual ~JSContext(); }; } // namespace ultralight