5#import "flutter/shell/platform/darwin/ios/platform_message_handler_ios.h"
7#include "flutter/fml/trace_event.h"
8#include "flutter/lib/ui/window/platform_message.h"
9#include "flutter/lib/ui/window/platform_message_response.h"
10#include "flutter/shell/platform/darwin/common/buffer_conversions.h"
17@property(nonatomic, readonly) dispatch_queue_t
queue;
24 _queue = dispatch_queue_create(
"FLTSerialTaskQueue", DISPATCH_QUEUE_SERIAL);
29- (void)dispatch:(dispatch_block_t)block {
30 dispatch_async(
self.queue, block);
36NSObject<FlutterTaskQueue>* PlatformMessageHandlerIos::MakeBackgroundTaskQueue() {
40PlatformMessageHandlerIos::PlatformMessageHandlerIos(
42 : platform_task_runner_(
std::move(platform_task_runner)) {}
53 std::lock_guard lock(message_handlers_mutex_);
54 auto it = message_handlers_.find(
message->channel());
55 if (it != message_handlers_.end()) {
56 handler_info = it->second;
68 "channel",
message->channel().c_str());
69 dispatch_block_t run_handler = ^{
70 handler(
data, ^(NSData* reply) {
84 [handler_info.task_queue.get() dispatch:run_handler];
86 dispatch_async(dispatch_get_main_queue(), run_handler);
102 std::unique_ptr<fml::Mapping> mapping) {
116 NSObject<FlutterTaskQueue>* task_queue) {
121 FML_CHECK(!task_queue || [task_queue respondsToSelector:
@selector(dispatch:)]);
123 std::lock_guard lock(message_handlers_mutex_);
124 message_handlers_.erase(channel);
126 message_handlers_[channel] = {
void(^ FlutterBinaryMessageHandler)(NSData *_Nullable message, FlutterBinaryReply reply)
virtual bool RunsTasksOnCurrentThread()
#define FML_CHECK(condition)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
std::unique_ptr< fml::Mapping > ConvertNSDataToMappingPtr(NSData *data)
NSData * ConvertMappingToNSData(fml::MallocMapping buffer)
#define TRACE_EVENT_ASYNC_BEGIN1(category_group, name, id, arg1_name, arg1_val)
#define TRACE_EVENT_ASYNC_END0(category_group, name, id)