| Flutter iOS Embedder |

Classes | Macros | Functions | Variables
FlutterEngine.mm File Reference
`#include "common/settings.h"`
`#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine_Internal.h"`
`#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 FLUTTER_ASSERT_ARC void | IOSPlatformThreadConfigSetter (const fml::Thread::ThreadConfig &config)

## Variables
NSString *const | FlutterDefaultDartEntrypoint = nil
NSString *const | FlutterDefaultInitialRoute = nil
NSString *const | kFlutterKeyDataChannel = @"@"flutter/keydata"
static constexpr int | kNumProfilerSamplesPerSec = 5
std::unique_ptr< flutter::Shell > | _shell
flutter::IOSRenderingAPI | _renderingApi
std::shared_ptr< flutter::SamplingProfiler > | _profiler
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 6 of file FlutterEngine.mm.

## Function Documentation

## ◆ IOSPlatformThreadConfigSetter()

static FLUTTER_ASSERT_ARC 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 48 of file FlutterEngine.mm.

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

## Variable Documentation

## ◆ _binaryMessenger

FlutterBinaryMessengerRelay* _binaryMessenger

Definition at line 158 of file FlutterEngine.mm.

## ◆ _connections

std::unique_ptr<flutter::ConnectionCollection> _connections

Definition at line 160 of file FlutterEngine.mm.

## ◆ _profiler

std::shared_ptr<flutter::SamplingProfiler> _profiler

Definition at line 156 of file FlutterEngine.mm.

Referenced by FlutterEngine::destroyContext.

## ◆ _renderingApi

flutter::IOSRenderingAPI _renderingApi

Definition at line 155 of file FlutterEngine.mm.

## ◆ _shell

std::unique_ptr<flutter::Shell> _shell

Initial value:
{
std::shared_ptr<flutter::ThreadHost> _threadHost

Definition at line 151 of file FlutterEngine.mm.

Referenced by FlutterEngine::destroyContext.

## ◆ _textureRegistry

FlutterTextureRegistryRelay* _textureRegistry

Definition at line 159 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 82 of file FlutterEngine.mm.

## ◆ FlutterDefaultInitialRoute

NSString* const FlutterDefaultInitialRoute = nil

The default Flutter initial route ("/").

Definition at line 83 of file FlutterEngine.mm.

## ◆ kFlutterKeyDataChannel

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

Definition at line 87 of file FlutterEngine.mm.

## ◆ kNumProfilerSamplesPerSec

constexpr int kNumProfilerSamplesPerSec = 5
| static constexpr

Definition at line 88 of file FlutterEngine.mm.