Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
flutter::PlatformViewEmbedder::EmbedderPlatformMessageHandler Class Reference
Inheritance diagram for flutter::PlatformViewEmbedder::EmbedderPlatformMessageHandler:
flutter::PlatformMessageHandler

Public Member Functions

 EmbedderPlatformMessageHandler (fml::WeakPtr< PlatformView > parent, fml::RefPtr< fml::TaskRunner > platform_task_runner)
 
virtual void HandlePlatformMessage (std::unique_ptr< PlatformMessage > message)
 
virtual bool DoesHandlePlatformMessageOnPlatformThread () const
 
virtual void InvokePlatformMessageResponseCallback (int response_id, std::unique_ptr< fml::Mapping > mapping)
 
virtual void InvokePlatformMessageEmptyResponseCallback (int response_id)
 
- Public Member Functions inherited from flutter::PlatformMessageHandler
virtual ~PlatformMessageHandler ()=default
 
virtual void HandlePlatformMessage (std::unique_ptr< PlatformMessage > message)=0
 
virtual bool DoesHandlePlatformMessageOnPlatformThread () const =0
 
virtual void InvokePlatformMessageResponseCallback (int response_id, std::unique_ptr< fml::Mapping > mapping)=0
 
virtual void InvokePlatformMessageEmptyResponseCallback (int response_id)=0
 

Detailed Description

Definition at line 13 of file platform_view_embedder.cc.

Constructor & Destructor Documentation

◆ EmbedderPlatformMessageHandler()

flutter::PlatformViewEmbedder::EmbedderPlatformMessageHandler::EmbedderPlatformMessageHandler ( fml::WeakPtr< PlatformView parent,
fml::RefPtr< fml::TaskRunner platform_task_runner 
)
inline

Definition at line 16 of file platform_view_embedder.cc.

19 : parent_(std::move(parent)),
20 platform_task_runner_(std::move(platform_task_runner)) {}

Member Function Documentation

◆ DoesHandlePlatformMessageOnPlatformThread()

virtual bool flutter::PlatformViewEmbedder::EmbedderPlatformMessageHandler::DoesHandlePlatformMessageOnPlatformThread ( ) const
inlinevirtual

Returns true if the platform message will ALWAYS be dispatched to the platform thread.

Platforms that support Background Platform Channels will return false.

Implements flutter::PlatformMessageHandler.

Definition at line 34 of file platform_view_embedder.cc.

34 {
35 return true;
36 }

◆ HandlePlatformMessage()

virtual void flutter::PlatformViewEmbedder::EmbedderPlatformMessageHandler::HandlePlatformMessage ( std::unique_ptr< PlatformMessage message)
inlinevirtual

Ultimately sends the PlatformMessage to the host platform. This method is invoked on the ui thread.

Implements flutter::PlatformMessageHandler.

Definition at line 22 of file platform_view_embedder.cc.

22 {
23 platform_task_runner_->PostTask(fml::MakeCopyable(
24 [parent = parent_, message = std::move(message)]() mutable {
25 if (parent) {
26 parent->HandlePlatformMessage(std::move(message));
27 } else {
28 FML_DLOG(WARNING) << "Deleted engine dropping message on channel "
29 << message->channel();
30 }
31 }));
32 }
virtual void PostTask(const fml::closure &task) override
Definition: task_runner.cc:24
#define FML_DLOG(severity)
Definition: logging.h:102
Win32Message message
internal::CopyableLambda< T > MakeCopyable(T lambda)
Definition: make_copyable.h:57

◆ InvokePlatformMessageEmptyResponseCallback()

virtual void flutter::PlatformViewEmbedder::EmbedderPlatformMessageHandler::InvokePlatformMessageEmptyResponseCallback ( int  response_id)
inlinevirtual

Performs the return procedure for an associated call to HandlePlatformMessage where there is no return value. This method should be thread-safe and able to be invoked on any thread.

Implements flutter::PlatformMessageHandler.

Definition at line 41 of file platform_view_embedder.cc.

41{}

◆ InvokePlatformMessageResponseCallback()

virtual void flutter::PlatformViewEmbedder::EmbedderPlatformMessageHandler::InvokePlatformMessageResponseCallback ( int  response_id,
std::unique_ptr< fml::Mapping mapping 
)
inlinevirtual

Performs the return procedure for an associated call to HandlePlatformMessage. This method should be thread-safe and able to be invoked on any thread.

Implements flutter::PlatformMessageHandler.

Definition at line 38 of file platform_view_embedder.cc.

40 {}

The documentation for this class was generated from the following file: