Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::SendAndExitMessagesHandler Class Reference
Inheritance diagram for dart::SendAndExitMessagesHandler:
dart::MessageHandler

Public Member Functions

 SendAndExitMessagesHandler (Isolate *owner)
 
const char * name () const
 
 ~SendAndExitMessagesHandler ()
 
MessageStatus HandleMessage (std::unique_ptr< Message > message)
 
const char * msg () const
 
virtual Isolateisolate () const
 
- Public Member Functions inherited from dart::MessageHandler
virtual ~MessageHandler ()
 
virtual const char * name () const
 
bool Run (ThreadPool *pool, StartCallback start_callback, EndCallback end_callback, CallbackData data)
 
MessageStatus HandleNextMessage ()
 
MessageStatus HandleOOBMessages ()
 
MessageStatus PauseAndHandleAllMessages (int64_t timeout_millis)
 
bool HasOOBMessages ()
 
bool HasMessages ()
 
virtual bool KeepAliveLocked ()
 
void RequestDeletion ()
 
bool paused () const
 
void increment_paused ()
 
void decrement_paused ()
 
void DebugDump ()
 
bool should_pause_on_start () const
 
void set_should_pause_on_start (bool should_pause_on_start)
 
bool is_paused_on_start () const
 
bool should_pause_on_exit () const
 
void set_should_pause_on_exit (bool should_pause_on_exit)
 
bool is_paused_on_exit () const
 
int64_t paused_timestamp () const
 
bool ShouldPauseOnStart (MessageStatus status) const
 
bool ShouldPauseOnExit (MessageStatus status) const
 
void PausedOnStart (bool paused)
 
void PausedOnExit (bool paused)
 

Additional Inherited Members

- Public Types inherited from dart::MessageHandler
enum  MessageStatus { kOK , kError , kShutdown }
 
typedef uword CallbackData
 
typedef MessageStatus(* StartCallback) (CallbackData data)
 
typedef void(* EndCallback) (CallbackData data)
 
- Static Public Member Functions inherited from dart::MessageHandler
static const char * MessageStatusString (MessageStatus status)
 
- Protected Member Functions inherited from dart::MessageHandler
 MessageHandler ()
 
virtual bool IsCurrentIsolate () const
 
virtual Isolateisolate () const
 
void PostMessage (std::unique_ptr< Message > message, bool before_events=false)
 
void ClosePort (Dart_Port port)
 
void CloseAllPorts ()
 
virtual void MessageNotify (Message::Priority priority)
 
virtual MessageStatus HandleMessage (std::unique_ptr< Message > message)=0
 
virtual void NotifyPauseOnStart ()
 
virtual void NotifyPauseOnExit ()
 
Threadthread () const
 

Detailed Description

Definition at line 486 of file heap_test.cc.

Constructor & Destructor Documentation

◆ SendAndExitMessagesHandler()

dart::SendAndExitMessagesHandler::SendAndExitMessagesHandler ( Isolate owner)
inlineexplicit

Definition at line 488 of file heap_test.cc.

489 : msg_(CStringUniquePtr(nullptr)), owner_(owner) {}
CAllocUniquePtr< char > CStringUniquePtr
Definition: utils.h:31

◆ ~SendAndExitMessagesHandler()

dart::SendAndExitMessagesHandler::~SendAndExitMessagesHandler ( )
inline

Definition at line 493 of file heap_test.cc.

493{ PortMap::ClosePorts(this); }
static void ClosePorts(MessageHandler *handler)
Definition: port.cc:128

Member Function Documentation

◆ HandleMessage()

MessageStatus dart::SendAndExitMessagesHandler::HandleMessage ( std::unique_ptr< Message message)
inlinevirtual

Implements dart::MessageHandler.

Definition at line 495 of file heap_test.cc.

495 {
496 // Parse the message.
497 Object& response_obj = Object::Handle();
498 if (message->IsRaw()) {
499 response_obj = message->raw_obj();
500 } else if (message->IsPersistentHandle()) {
501 PersistentHandle* handle = message->persistent_handle();
502 // Object is in the receiving isolate's heap.
503 EXPECT(isolate()->group()->heap()->Contains(
504 UntaggedObject::ToAddr(handle->ptr())));
505 response_obj = handle->ptr();
507 } else {
508 Thread* thread = Thread::Current();
509 response_obj = ReadMessage(thread, message.get());
510 }
511 if (response_obj.IsString()) {
512 String& response = String::Handle();
513 response ^= response_obj.ptr();
514 msg_.reset(Utils::StrDup(response.ToCString()));
515 } else {
516 ASSERT(response_obj.IsArray());
517 Array& response_array = Array::Handle();
518 response_array ^= response_obj.ptr();
519 ASSERT(response_array.Length() == 1);
520 ExternalTypedData& response = ExternalTypedData::Handle();
521 response ^= response_array.At(0);
522 msg_.reset(Utils::StrDup(reinterpret_cast<char*>(response.DataAddr(0))));
523 }
524
525 return kOK;
526 }
#define EXPECT(type, expectedAlignment, expectedSize)
void FreePersistentHandle(PersistentHandle *ref)
ApiState * api_state() const
Definition: isolate.h:700
IsolateGroup * group() const
Definition: isolate.h:1037
Thread * thread() const
static Object & Handle()
Definition: object.h:407
virtual Isolate * isolate() const
Definition: heap_test.cc:530
static Thread * Current()
Definition: thread.h:362
static uword ToAddr(const UntaggedObject *raw_obj)
Definition: raw_object.h:522
static char * StrDup(const char *s)
#define ASSERT(E)
Win32Message message
bool Contains(const Container &container, const Value &value)
ObjectPtr ReadMessage(Thread *thread, Message *message)

◆ isolate()

virtual Isolate * dart::SendAndExitMessagesHandler::isolate ( ) const
inlinevirtual

Reimplemented from dart::MessageHandler.

Definition at line 530 of file heap_test.cc.

530{ return owner_; }

◆ msg()

const char * dart::SendAndExitMessagesHandler::msg ( ) const
inline

Definition at line 528 of file heap_test.cc.

528{ return msg_.get(); }

◆ name()

const char * dart::SendAndExitMessagesHandler::name ( ) const
inlinevirtual

Reimplemented from dart::MessageHandler.

Definition at line 491 of file heap_test.cc.

491{ return "merge-isolates-heaps-handler"; }

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