Site Home
Docs
Go to C API
Ultralight C++ API
1.4.0
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
9
#include <
JavaScriptCore/JavaScript.h
>
10
#include <
Ultralight/Defines.h
>
11
#include <
Ultralight/RefPtr.h
>
12
#include <
Ultralight/String.h
>
13
14
namespace
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
///
20
class
UExport
JSContext
:
public
RefCounted
{
21
public
:
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
28
protected
:
29
virtual
~JSContext
();
30
};
31
32
}
// namespace ultralight
UExport
#define UExport
Definition
Exports.h:25
JSContextRef
const struct OpaqueJSContext * JSContextRef
Definition
JSBase.h:43
JavaScript.h
RefPtr.h
String.h
Defines.h
ultralight::JSContext
This class wraps a JSContextRef (a JavaScript execution context for use with JavaScriptCore) and lock...
Definition
JavaScript.h:20
ultralight::JSContext::ctx
virtual JSContextRef ctx()=0
Get the underlying JSContextRef for use with JavaScriptCore C API.
ultralight::JSContext::~JSContext
virtual ~JSContext()
ultralight::RefCounted
Interface for all ref-counted objects that will be managed using the RefPtr<> smart pointer.
Definition
RefPtr.h:47
ultralight
Definition
App.h:14
Ultralight
JavaScript.h