Flutter Engine
Loading...
Searching...
No Matches
platform_message_response_darwin.mm
Go to the documentation of this file.
1
// Copyright 2013 The Flutter Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#import "
flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h
"
6
7
#import "
flutter/shell/platform/darwin/common/framework/Headers/FlutterMacros.h
"
8
9
FLUTTER_ASSERT_ARC
10
11
namespace
flutter
{
12
13
PlatformMessageResponseDarwin::PlatformMessageResponseDarwin(
14
PlatformMessageResponseCallback
callback
,
15
fml::RefPtr<fml::TaskRunner>
platform_task_runner)
16
: callback_(
callback
), platform_task_runner_(
std
::move(platform_task_runner)) {}
17
18
PlatformMessageResponseDarwin::~PlatformMessageResponseDarwin() =
default
;
19
20
void
PlatformMessageResponseDarwin::Complete(std::unique_ptr<fml::Mapping>
data
) {
21
fml::RefPtr<PlatformMessageResponseDarwin>
self
(
this
);
22
platform_task_runner_->PostTask(
fml::MakeCopyable
([
self
,
data
= std::move(
data
)]()
mutable
{
23
self
->callback_(
CopyMappingPtrToNSData
(std::move(
data
)));
24
}));
25
}
26
27
void
PlatformMessageResponseDarwin::CompleteEmpty() {
28
fml::RefPtr<PlatformMessageResponseDarwin>
self
(
this
);
29
platform_task_runner_->PostTask(
fml::MakeCopyable
([
self
]()
mutable
{
self
->callback_(nil); }));
30
}
31
32
}
// namespace flutter
FlutterMacros.h
self
return self
Definition
FlutterTextureRegistryRelay.mm:19
fml::RefPtr
Definition
ref_ptr.h:65
callback
FlutterDesktopBinaryReply callback
Definition
flutter_windows_view_unittests.cc:52
FLUTTER_ASSERT_ARC
Definition
FlutterChannelKeyResponder.mm:13
flutter
Definition
asset_manager.cc:10
flutter::CopyMappingPtrToNSData
NSData * CopyMappingPtrToNSData(std::unique_ptr< fml::Mapping > mapping)
Definition
buffer_conversions.mm:43
fml::MakeCopyable
internal::CopyableLambda< T > MakeCopyable(T lambda)
Definition
make_copyable.h:57
std
Definition
ref_ptr.h:261
platform_message_response_darwin.h
PlatformMessageResponseCallback
void(^ PlatformMessageResponseCallback)(NSData *)
Definition
platform_message_response_darwin.h:16
data
std::shared_ptr< const fml::Mapping > data
Definition
texture_gles.cc:68
shell
platform
darwin
ios
framework
Source
platform_message_response_darwin.mm
Generated on Wed Nov 5 2025 21:33:16 for Flutter Engine by
1.9.8