| Flutter iOS Embedder |

Classes | Macros | Functions | Variables
FlutterEngine.mm File Reference
`#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine_Internal.h"`
`#include <memory>`
`#include "flutter/common/constants.h"`
`#include "flutter/fml/message_loop.h"`
`#include "flutter/fml/platform/darwin/platform_version.h"`
`#include "flutter/fml/trace_event.h"`
`#include "flutter/runtime/ptrace_check.h"`
`#include "flutter/shell/common/engine.h"`
`#include "flutter/shell/common/platform_view.h"`
`#include "flutter/shell/common/shell.h"`
`#include "flutter/shell/common/switches.h"`
`#include "flutter/shell/common/thread_host.h"`
`#include "flutter/shell/common/variable_refresh_rate_display.h"`
`#import "flutter/shell/platform/darwin/common/command_line.h"`
`#import "flutter/shell/platform/darwin/common/framework/Source/FlutterBinaryMessengerRelay.h"`
`#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h"`
`#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterDartVMServicePublisher.h"`
`#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterIndirectScribbleDelegate.h"`
`#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.h"`
`#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterSpellCheckPlugin.h"`
`#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputDelegate.h"`
`#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterTextureRegistryRelay.h"`
`#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterUndoManagerDelegate.h"`
`#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterUndoManagerPlugin.h"`
`#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h"`
`#import "flutter/shell/platform/darwin/ios/framework/Source/UIViewController+FlutterScreenAndSceneIfLoaded.h"`
`#import "flutter/shell/platform/darwin/ios/framework/Source/connection_collection.h"`
`#import "flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h"`
`#import "flutter/shell/platform/darwin/ios/framework/Source/profiler_metrics_ios.h"`
`#import "flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h"`
`#import "flutter/shell/platform/darwin/ios/platform_view_ios.h"`
`#import "flutter/shell/platform/darwin/ios/rendering_api_selection.h"`
`#include "flutter/shell/profiling/sampling_profiler.h"`

Go to the source code of this file.

## Classes
class | FlutterEngineRegistrar

## Macros
#define | FML_USED_ON_EMBEDDER

## Functions
static void | IOSPlatformThreadConfigSetter (const fml::Thread::ThreadConfig &config)

## Variables
NSString *const | FlutterDefaultDartEntrypoint = nil
NSString *const | FlutterDefaultInitialRoute = nil
NSString *const | kFlutterEngineWillDealloc = @"@"FlutterEngineWillDealloc"
NSString *const | kFlutterKeyDataChannel = @"@"flutter/keydata"
static constexpr int | kNumProfilerSamplesPerSec = 5
std::shared_ptr< flutter::ThreadHost > | _threadHost
std::unique_ptr< flutter::Shell > | _shell
NSString * | _labelPrefix
std::unique_ptr< fml::WeakPtrFactory< FlutterEngine > > | _weakFactory
fml::WeakPtr< FlutterViewController > | _viewController
fml::scoped_nsobject< FlutterDartVMServicePublisher > | _publisher
std::shared_ptr< flutter::FlutterPlatformViewsController > | _platformViewsController
flutter::IOSRenderingAPI | _renderingApi
std::shared_ptr< flutter::ProfilerMetricsIOS > | _profiler_metrics
std::shared_ptr< flutter::SamplingProfiler > | _profiler
fml::scoped_nsobject< FlutterPlatformPlugin > | _platformPlugin
fml::scoped_nsobject< FlutterTextInputPlugin > | _textInputPlugin
fml::scoped_nsobject< FlutterUndoManagerPlugin > | _undoManagerPlugin
fml::scoped_nsobject< FlutterSpellCheckPlugin > | _spellCheckPlugin
fml::scoped_nsobject< FlutterRestorationPlugin > | _restorationPlugin
fml::scoped_nsobject< FlutterMethodChannel > | _localizationChannel
fml::scoped_nsobject< FlutterMethodChannel > | _navigationChannel
fml::scoped_nsobject< FlutterMethodChannel > | _restorationChannel
fml::scoped_nsobject< FlutterMethodChannel > | _platformChannel
fml::scoped_nsobject< FlutterMethodChannel > | _platformViewsChannel
fml::scoped_nsobject< FlutterMethodChannel > | _textInputChannel
fml::scoped_nsobject< FlutterMethodChannel > | _undoManagerChannel
fml::scoped_nsobject< FlutterMethodChannel > | _scribbleChannel
fml::scoped_nsobject< FlutterMethodChannel > | _spellCheckChannel
fml::scoped_nsobject< FlutterBasicMessageChannel > | _lifecycleChannel
fml::scoped_nsobject< FlutterBasicMessageChannel > | _systemChannel
fml::scoped_nsobject< FlutterBasicMessageChannel > | _settingsChannel
fml::scoped_nsobject< FlutterBasicMessageChannel > | _keyEventChannel
fml::scoped_nsobject< FlutterMethodChannel > | _screenshotChannel
int64_t | _nextTextureId
BOOL | _allowHeadlessExecution
BOOL | _restorationEnabled
FlutterBinaryMessengerRelay * | _binaryMessenger
FlutterTextureRegistryRelay * | _textureRegistry
std::unique_ptr< flutter::ConnectionCollection > | _connections

## Macro Definition Documentation

## ◆ FML_USED_ON_EMBEDDER

#define FML_USED_ON_EMBEDDER

Definition at line 5 of file FlutterEngine.mm.

## Function Documentation

## ◆ IOSPlatformThreadConfigSetter()

static void IOSPlatformThreadConfigSetter | ( | const fml::Thread::ThreadConfig & | config | ) |
| static

Inheriting ThreadConfigurer and use iOS platform thread API to configure the thread priorities Using iOS platform thread API to configure thread priority

Definition at line 45 of file FlutterEngine.mm.

45 {
46 // set thread name
47 fml::Thread::SetCurrentThreadName(config);
48
49 // set thread priority
50 switch (config.priority) {
51 case fml::Thread::ThreadPriority::BACKGROUND: {
52 pthread_set_qos_class_self_np(QOS_CLASS_BACKGROUND, 0);
53 [[NSThread currentThread] setThreadPriority:0];
54 break;
55 }
56 case fml::Thread::ThreadPriority::NORMAL: {
57 pthread_set_qos_class_self_np(QOS_CLASS_DEFAULT, 0);
58 [[NSThread currentThread] setThreadPriority:0.5];
59 break;
60 }
61 case fml::Thread::ThreadPriority::RASTER:
62 case fml::Thread::ThreadPriority::DISPLAY: {
63 pthread_set_qos_class_self_np(QOS_CLASS_USER_INTERACTIVE, 0);
64 [[NSThread currentThread] setThreadPriority:1.0];
65 sched_param param;
66 int policy;
67 pthread_t thread = pthread_self();
68 if (!pthread_getschedparam(thread, &policy, &param)) {
69 param.sched_priority = 50;
70 pthread_setschedparam(thread, policy, &param);
71 }
72 break;
73 }
74 }
75 }

## Variable Documentation

## ◆ _allowHeadlessExecution

BOOL _allowHeadlessExecution

Definition at line 152 of file FlutterEngine.mm.

## ◆ _binaryMessenger

FlutterBinaryMessengerRelay* _binaryMessenger

Definition at line 154 of file FlutterEngine.mm.

## ◆ _connections

std::unique_ptr<flutter::ConnectionCollection> _connections

Definition at line 156 of file FlutterEngine.mm.

## ◆ _keyEventChannel

fml::scoped_nsobject<FlutterBasicMessageChannel> _keyEventChannel

Definition at line 147 of file FlutterEngine.mm.

## ◆ _labelPrefix

NSString* _labelPrefix

Definition at line 118 of file FlutterEngine.mm.

## ◆ _lifecycleChannel

fml::scoped_nsobject<FlutterBasicMessageChannel> _lifecycleChannel

Definition at line 144 of file FlutterEngine.mm.

## ◆ _localizationChannel

fml::scoped_nsobject<FlutterMethodChannel> _localizationChannel

Definition at line 135 of file FlutterEngine.mm.

## ◆ _navigationChannel

fml::scoped_nsobject<FlutterMethodChannel> _navigationChannel

Definition at line 136 of file FlutterEngine.mm.

## ◆ _nextTextureId

int64_t _nextTextureId

Definition at line 150 of file FlutterEngine.mm.

## ◆ _platformChannel

fml::scoped_nsobject<FlutterMethodChannel> _platformChannel

Definition at line 138 of file FlutterEngine.mm.

## ◆ _platformPlugin

fml::scoped_nsobject<FlutterPlatformPlugin> _platformPlugin

Definition at line 130 of file FlutterEngine.mm.

## ◆ _platformViewsChannel

fml::scoped_nsobject<FlutterMethodChannel> _platformViewsChannel

Definition at line 139 of file FlutterEngine.mm.

## ◆ _platformViewsController

std::shared_ptr<flutter::FlutterPlatformViewsController> _platformViewsController

Definition at line 124 of file FlutterEngine.mm.

Referenced by FlutterEngine::destroyContext, and ForwardingGestureRecognizer::initWithTarget:platformViewsController:.

## ◆ _profiler

std::shared_ptr<flutter::SamplingProfiler> _profiler

Definition at line 127 of file FlutterEngine.mm.

Referenced by FlutterEngine::destroyContext.

## ◆ _profiler_metrics

std::shared_ptr<flutter::ProfilerMetricsIOS> _profiler_metrics

Definition at line 126 of file FlutterEngine.mm.

## ◆ _publisher

fml::scoped_nsobject<FlutterDartVMServicePublisher> _publisher

Definition at line 122 of file FlutterEngine.mm.

## ◆ _renderingApi

flutter::IOSRenderingAPI _renderingApi

Definition at line 125 of file FlutterEngine.mm.

## ◆ _restorationChannel

fml::scoped_nsobject<FlutterMethodChannel> _restorationChannel

Definition at line 137 of file FlutterEngine.mm.

## ◆ _restorationEnabled

BOOL _restorationEnabled

Definition at line 153 of file FlutterEngine.mm.

## ◆ _restorationPlugin

fml::scoped_nsobject<FlutterRestorationPlugin> _restorationPlugin

Definition at line 134 of file FlutterEngine.mm.

## ◆ _screenshotChannel

fml::scoped_nsobject<FlutterMethodChannel> _screenshotChannel

Definition at line 148 of file FlutterEngine.mm.

## ◆ _scribbleChannel

fml::scoped_nsobject<FlutterMethodChannel> _scribbleChannel

Definition at line 142 of file FlutterEngine.mm.

## ◆ _settingsChannel

fml::scoped_nsobject<FlutterBasicMessageChannel> _settingsChannel

Definition at line 146 of file FlutterEngine.mm.

## ◆ _shell

std::unique_ptr<flutter::Shell> _shell

Definition at line 117 of file FlutterEngine.mm.

Referenced by FlutterEngine::destroyContext.

## ◆ _spellCheckChannel

fml::scoped_nsobject<FlutterMethodChannel> _spellCheckChannel

Definition at line 143 of file FlutterEngine.mm.

## ◆ _spellCheckPlugin

fml::scoped_nsobject<FlutterSpellCheckPlugin> _spellCheckPlugin

Definition at line 133 of file FlutterEngine.mm.

## ◆ _systemChannel

fml::scoped_nsobject<FlutterBasicMessageChannel> _systemChannel

Definition at line 145 of file FlutterEngine.mm.

## ◆ _textInputChannel

fml::scoped_nsobject<FlutterMethodChannel> _textInputChannel

Definition at line 140 of file FlutterEngine.mm.

## ◆ _textInputPlugin

fml::scoped_nsobject<FlutterTextInputPlugin> _textInputPlugin

Definition at line 131 of file FlutterEngine.mm.

## ◆ _textureRegistry

FlutterTextureRegistryRelay* _textureRegistry

Definition at line 155 of file FlutterEngine.mm.

## ◆ _threadHost

std::shared_ptr<flutter::ThreadHost> _threadHost

Initial value:
{
fml::scoped_nsobject<FlutterDartProject> _dartProject

Definition at line 114 of file FlutterEngine.mm.

Referenced by FlutterEngine::destroyContext.

## ◆ _undoManagerChannel

fml::scoped_nsobject<FlutterMethodChannel> _undoManagerChannel

Definition at line 141 of file FlutterEngine.mm.

## ◆ _undoManagerPlugin

fml::scoped_nsobject<FlutterUndoManagerPlugin> _undoManagerPlugin

Definition at line 132 of file FlutterEngine.mm.

## ◆ _viewController

fml::WeakPtr<FlutterViewController> _viewController

Definition at line 121 of file FlutterEngine.mm.

## ◆ _weakFactory

std::unique_ptr<fml::WeakPtrFactory<FlutterEngine> > _weakFactory

Definition at line 119 of file FlutterEngine.mm.

## ◆ FlutterDefaultDartEntrypoint

NSString* const FlutterDefaultDartEntrypoint = nil

The dart entrypoint that is associated with `main()`. This is to be used as an argument to the `runWithEntrypoint*` methods.

Definition at line 79 of file FlutterEngine.mm.

## ◆ FlutterDefaultInitialRoute

NSString* const FlutterDefaultInitialRoute = nil

The default Flutter initial route ("/").

Definition at line 80 of file FlutterEngine.mm.

## ◆ kFlutterEngineWillDealloc

NSString* const kFlutterEngineWillDealloc = @"@"FlutterEngineWillDealloc"

Definition at line 84 of file FlutterEngine.mm.

## ◆ kFlutterKeyDataChannel

NSString* const kFlutterKeyDataChannel = @"@"flutter/keydata"

Definition at line 85 of file FlutterEngine.mm.

## ◆ kNumProfilerSamplesPerSec

constexpr int kNumProfilerSamplesPerSec = 5
| static constexpr

Definition at line 86 of file FlutterEngine.mm.