Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
ijs_runtime.cpp
Go to the documentation of this file.
1
// Copyright 2018 The PDFium Authors
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#
include
"fxjs/ijs_runtime.h"
6
7
#
include
"fxjs/cjs_runtimestub.h"
8
9
#
ifdef
PDF_ENABLE_V8
10
#
include
"fpdfsdk/cpdfsdk_formfillenvironment.h"
11
#
include
"fxjs/cfxjs_engine.h"
12
#
include
"fxjs/cjs_runtime.h"
13
#
include
"fxjs/global_timer.h"
14
#
ifdef
PDF_ENABLE_XFA
15
#
include
"fxjs/gc/heap.h"
16
#
endif
// PDF_ENABLE_XFA
17
#
endif
// PDF_ENABLE_V8
18
19
IJS_Runtime
::
ScopedEventContext
::
ScopedEventContext
(
IJS_Runtime
* pRuntime)
20
:
m_pRuntime
(
pRuntime
),
m_pContext
(
pRuntime
->
NewEventContext
()) {}
21
22
IJS_Runtime
::
ScopedEventContext
::~
ScopedEventContext
() {
23
m_pRuntime->ReleaseEventContext(m_pContext.ExtractAsDangling());
24
}
25
26
// static
27
void
IJS_Runtime
::
Initialize
(
unsigned
int
slot,
void
* isolate,
void
* platform) {
28
#
ifdef
PDF_ENABLE_V8
29
GlobalTimer::InitializeGlobals();
30
FXJS_Initialize(slot,
static_cast
<v8::Isolate*>(isolate));
31
#
ifdef
PDF_ENABLE_XFA
32
FXGC_Initialize(
static_cast
<v8::Platform*>(platform),
33
static_cast
<v8::Isolate*>(isolate));
34
#
endif
// PDF_ENABLE_XFA
35
#
endif
// PDF_ENABLE_V8
36
}
37
38
// static
39
void
IJS_Runtime
::
Destroy
() {
40
#
ifdef
PDF_ENABLE_V8
41
#
ifdef
PDF_ENABLE_XFA
42
FXGC_Release();
43
#
endif
// PDF_ENABLE_XFA
44
FXJS_Release();
45
GlobalTimer::DestroyGlobals();
46
#
endif
// PDF_ENABLE_V8
47
}
48
49
// static
50
std::unique_ptr<IJS_Runtime>
IJS_Runtime
::Create(
51
CPDFSDK_FormFillEnvironment* pFormFillEnv) {
52
#
ifdef
PDF_ENABLE_V8
53
if
(pFormFillEnv->IsJSPlatformPresent())
54
return
std::make_unique<CJS_Runtime>(pFormFillEnv);
55
#
endif
56
return
std
::make_unique<CJS_RuntimeStub>(pFormFillEnv);
57
}
58
59
IJS_Runtime
::~
IJS_Runtime
() =
default
;
60
61
IJS_Runtime
::
JS_Error
::
JS_Error
(
int
line,
62
int
column,
63
const
WideString& exception)
64
:
line
(line),
column
(column),
exception
(
exception
) {}
IJS_Runtime::ScopedEventContext
Definition
ijs_runtime.h:34
IJS_Runtime::ScopedEventContext::~ScopedEventContext
~ScopedEventContext()
Definition
ijs_runtime.cpp:22
IJS_Runtime::ScopedEventContext::ScopedEventContext
ScopedEventContext(IJS_Runtime *pRuntime)
Definition
ijs_runtime.cpp:19
IJS_Runtime
Definition
ijs_runtime.h:24
IJS_Runtime::~IJS_Runtime
virtual ~IJS_Runtime()
IJS_Runtime::Initialize
static void Initialize(unsigned int slot, void *isolate, void *platform)
Definition
ijs_runtime.cpp:27
IJS_Runtime::Destroy
static void Destroy()
Definition
ijs_runtime.cpp:39
std
Definition
qfloat16.h:493
IJS_Runtime::JS_Error
Definition
ijs_runtime.h:26
IJS_Runtime::JS_Error::JS_Error
JS_Error(int line, int column, const WideString &exception)
Definition
ijs_runtime.cpp:61
IJS_Runtime::JS_Error::column
int column
Definition
ijs_runtime.h:28
IJS_Runtime::JS_Error::line
int line
Definition
ijs_runtime.h:27
qtwebengine
src
3rdparty
chromium
third_party
pdfium
fxjs
ijs_runtime.cpp
Generated on Thu Nov 14 2024 01:02:49 for Qt by
1.12.0