Loading...
Searching...
No Matches
JavaScript.h
Go to the documentation of this file.
1/**************************************************************************************************
2 * This file is a part of Ultralight. *
3 * *
4 * See <https://ultralig.ht> for licensing and more. *
5 * *
6 * (C) 2024 Ultralight, Inc. *
7 **************************************************************************************************/
8#pragma once
10#include <Ultralight/Defines.h>
11#include <Ultralight/RefPtr.h>
12#include <Ultralight/String.h>
13
14namespace ultralight {
15
16///
17/// This class wraps a JSContextRef (a JavaScript execution context for use with JavaScriptCore)
18/// and locks the context on the current thread for the duration of its lifetime.
19///
21public:
22 /// Get the underlying JSContextRef for use with JavaScriptCore C API
23 virtual JSContextRef ctx() = 0;
24
25 /// Typecast to a JSContextRef for use with JavaScriptCore C API
26 operator JSContextRef();
27
28protected:
29 virtual ~JSContext();
30};
31
32} // namespace ultralight
#define UExport
Definition Exports.h:25
const struct OpaqueJSContext * JSContextRef
Definition JSBase.h:43
This class wraps a JSContextRef (a JavaScript execution context for use with JavaScriptCore) and lock...
Definition JavaScript.h:20
virtual JSContextRef ctx()=0
Get the underlying JSContextRef for use with JavaScriptCore C API.
Interface for all ref-counted objects that will be managed using the RefPtr<> smart pointer.
Definition RefPtr.h:47
Definition App.h:14