Flutter Engine
The Flutter Engine
shell
platform
darwin
ios
framework
Source
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
,
fml
::scoped_policy::
OwnershipPolicy
::
kRetain
),
17
platform_task_runner_(
std
::move(platform_task_runner)) {}
18
19
PlatformMessageResponseDarwin::~PlatformMessageResponseDarwin() =
default
;
20
21
void
PlatformMessageResponseDarwin::Complete(std::unique_ptr<fml::Mapping>
data
) {
22
fml::RefPtr<PlatformMessageResponseDarwin>
self
(
this
);
23
platform_task_runner_->PostTask(
fml::MakeCopyable
([
self
,
data
= std::move(
data
)]()
mutable
{
24
self
->callback_.get()(
CopyMappingPtrToNSData
(std::move(
data
)));
25
}));
26
}
27
28
void
PlatformMessageResponseDarwin::CompleteEmpty() {
29
fml::RefPtr<PlatformMessageResponseDarwin>
self
(
this
);
30
platform_task_runner_->PostTask(
31
fml::MakeCopyable
([
self
]()
mutable
{
self
->callback_.get()(nil); }));
32
}
33
34
}
// namespace flutter
self
return self
Definition:
FlutterTextureRegistryRelay.mm:19
fml::RefPtr< fml::TaskRunner >
callback
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
Definition:
fl_key_channel_responder.cc:120
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:44
fml::scoped_policy::OwnershipPolicy
OwnershipPolicy
Definition:
scoped_policy.h:12
fml::scoped_policy::kRetain
@ kRetain
Definition:
scoped_policy.h:19
fml
Definition:
ascii_trie.cc:9
fml::MakeCopyable
internal::CopyableLambda< T > MakeCopyable(T lambda)
Definition:
make_copyable.h:57
std
Definition:
ref_ptr.h:256
PlatformMessageResponseCallback
void(^ PlatformMessageResponseCallback)(NSData *)
Definition:
platform_message_response_darwin.h:17
data
std::shared_ptr< const fml::Mapping > data
Definition:
texture_gles.cc:63
Generated on Sun Jun 23 2024 21:55:12 for Flutter Engine by
1.9.4