Flutter Engine
flutter::internal::ReplyManager Class Reference

#include <engine_method_result.h>

Public Member Functions

 ReplyManager (BinaryReply reply_handler_)
 
 ~ReplyManager ()
 
 ReplyManager (ReplyManager const &)=delete
 
ReplyManageroperator= (ReplyManager const &)=delete
 
void SendResponseData (const std::vector< uint8_t > *data)
 

Detailed Description

Definition at line 22 of file engine_method_result.h.

Constructor & Destructor Documentation

◆ ReplyManager() [1/2]

flutter::internal::ReplyManager::ReplyManager ( BinaryReply  reply_handler_)

Definition at line 116 of file core_implementations.cc.

117  : reply_handler_(std::move(reply_handler)) {
118  assert(reply_handler_);
119 }

◆ ~ReplyManager()

flutter::internal::ReplyManager::~ReplyManager ( )

Definition at line 121 of file core_implementations.cc.

121  {
122  if (reply_handler_) {
123  // Warn, rather than send a not-implemented response, since the engine may
124  // no longer be valid at this point.
125  std::cerr
126  << "Warning: Failed to respond to a message. This is a memory leak."
127  << std::endl;
128  }
129 }

◆ ReplyManager() [2/2]

flutter::internal::ReplyManager::ReplyManager ( ReplyManager const &  )
delete

Member Function Documentation

◆ operator=()

ReplyManager& flutter::internal::ReplyManager::operator= ( ReplyManager const &  )
delete

◆ SendResponseData()

void flutter::internal::ReplyManager::SendResponseData ( const std::vector< uint8_t > *  data)

Definition at line 131 of file core_implementations.cc.

131  {
132  if (!reply_handler_) {
133  std::cerr
134  << "Error: Only one of Success, Error, or NotImplemented can be "
135  "called,"
136  << " and it can be called exactly once. Ignoring duplicate result."
137  << std::endl;
138  return;
139  }
140 
141  const uint8_t* message = data && !data->empty() ? data->data() : nullptr;
142  size_t message_size = data ? data->size() : 0;
143  reply_handler_(message, message_size);
144  reply_handler_ = nullptr;
145 }

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