Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
embedder_platform_message_response.h
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#ifndef FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_PLATFORM_MESSAGE_RESPONSE_H_
6#define FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_PLATFORM_MESSAGE_RESPONSE_H_
7
8#include "flutter/fml/macros.h"
9#include "flutter/fml/task_runner.h"
10#include "flutter/lib/ui/window/platform_message_response.h"
11
12namespace flutter {
13
14//------------------------------------------------------------------------------
15/// @brief The platform message response subclass for responses to messages
16/// from the embedder to the framework. Message responses are
17/// fulfilled by the framework.
19 public:
20 using Callback = std::function<void(const uint8_t* data, size_t size)>;
21
22 //----------------------------------------------------------------------------
23 /// @param[in] runner The task runner on which to execute the callback.
24 /// The response will be initiated by the framework on
25 /// the UI thread.
26 /// @param[in] callback The callback that communicates to the embedder the
27 /// contents of the response sent by the framework back
28 /// to the emebder.
30 const Callback& callback);
31
32 //----------------------------------------------------------------------------
33 /// @brief Destroys the message response. Can be called on any thread.
34 /// Does not execute unfulfilled callbacks.
35 ///
37
38 private:
40 Callback callback_;
41
42 // |PlatformMessageResponse|
43 void Complete(std::unique_ptr<fml::Mapping> data) override;
44
45 // |PlatformMessageResponse|
46 void CompleteEmpty() override;
47
49};
50
51} // namespace flutter
52
53#endif // FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_PLATFORM_MESSAGE_RESPONSE_H_
The platform message response subclass for responses to messages from the embedder to the framework....
~EmbedderPlatformMessageResponse() override
Destroys the message response. Can be called on any thread. Does not execute unfulfilled callbacks.
std::function< void(const uint8_t *data, size_t size)> Callback
void Complete(std::unique_ptr< fml::Mapping > data) override
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition macros.h:27
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition switches.h:41
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition switches.h:259