Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Namespaces | Macros | Enumerations | Functions
ptrace_check.h File Reference
#include "flutter/common/settings.h"
#include "flutter/fml/build_config.h"

Go to the source code of this file.

Namespaces

namespace  flutter
 

Macros

#define TRACING_CHECKS_NECESSARY
 

Enumerations

enum class  flutter::TracingResult { flutter::kNotAttempted , flutter::kEnabled , flutter::kNotNecessary = kEnabled , flutter::kDisabled }
 

Functions

bool flutter::EnableTracingIfNecessary (const Settings &vm_settings)
 Enables tracing in the process so that JIT mode VMs may be launched. Explicitly enabling tracing is not required on all platforms. On platforms where it is not required, calling this method will return true. If tracing is required but cannot be enabled, it is the responsibility of the caller to display the appropriate error message to the user as subsequent attempts to launch the VM in JIT mode will cause process termination.
 
TracingResult flutter::GetTracingResult ()
 Returns if a tracing check has been performed and its result. To enable tracing, the Settings object used to launch the VM is required. Components may want to display messages based on the result of a previous tracing check without actually having the settings object. This accessor can be used instead.
 

Macro Definition Documentation

◆ TRACING_CHECKS_NECESSARY

#define TRACING_CHECKS_NECESSARY
Value:
FML_OS_IOS && !TARGET_OS_SIMULATOR && \
(FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG)

Definition at line 13 of file ptrace_check.h.

16 {
21};
22
23#if TRACING_CHECKS_NECESSARY
24bool EnableTracingIfNecessaryImpl(const Settings& vm_settings);
25TracingResult GetTracingResultImpl();
26#endif // TRACING_CHECKS_NECESSARY
27
28//------------------------------------------------------------------------------
29/// @brief Enables tracing in the process so that JIT mode VMs may be
30/// launched. Explicitly enabling tracing is not required on all
31/// platforms. On platforms where it is not required, calling this
32/// method will return true. If tracing is required but cannot be
33/// enabled, it is the responsibility of the caller to display the
34/// appropriate error message to the user as subsequent attempts to
35/// launch the VM in JIT mode will cause process termination.
36///
37/// This method may be called multiple times and will return the
38/// same result. There are no threading restrictions.
39///
40/// @param[in] vm_settings The settings used to launch the VM.
41///
42/// @return If tracing was enabled.
43///
44inline bool EnableTracingIfNecessary(const Settings& vm_settings) {
45#if TRACING_CHECKS_NECESSARY
46 return EnableTracingIfNecessaryImpl(vm_settings);
47#else // TRACING_CHECKS_NECESSARY
48 return true;
49#endif // TRACING_CHECKS_NECESSARY
50}
51
52//------------------------------------------------------------------------------
53/// @brief Returns if a tracing check has been performed and its result. To
54/// enable tracing, the Settings object used to launch the VM is
55/// required. Components may want to display messages based on the
56/// result of a previous tracing check without actually having the
57/// settings object. This accessor can be used instead.
58///
59/// @return The tracing result.
60///
62#if TRACING_CHECKS_NECESSARY
63 return GetTracingResultImpl();
64#else // TRACING_CHECKS_NECESSARY
65 return TracingResult::kNotNecessary;
66#endif // TRACING_CHECKS_NECESSARY
67}
68
69} // namespace flutter
70
71#endif // FLUTTER_RUNTIME_PTRACE_CHECK_H_
TracingResult GetTracingResult()
Returns if a tracing check has been performed and its result. To enable tracing, the Settings object ...
bool EnableTracingIfNecessary(const Settings &vm_settings)
Enables tracing in the process so that JIT mode VMs may be launched. Explicitly enabling tracing is n...