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

Public Member Functions

 TestMessageHandler ()
 
 ~TestMessageHandler ()
 
void MessageNotify (Message::Priority priority)
 
MessageStatus HandleMessage (std::unique_ptr< Message > message)
 
MessageStatus Start ()
 
void End ()
 
Dart_Portport_buffer () const
 
int notify_count () const
 
int message_count () const
 
bool start_called () const
 
bool end_called () const
 
void set_results (MessageStatus *results)
 
Monitormonitor ()
 
- 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 33 of file message_handler_test.cc.

Constructor & Destructor Documentation

◆ TestMessageHandler()

dart::TestMessageHandler::TestMessageHandler ( )
inline

Definition at line 35 of file message_handler_test.cc.

36 : port_buffer_(nullptr),
37 port_buffer_size_(0),
38 notify_count_(0),
39 message_count_(0),
40 start_called_(false),
41 end_called_(false),
42 results_(nullptr),
43 monitor_() {}

◆ ~TestMessageHandler()

dart::TestMessageHandler::~TestMessageHandler ( )
inline

Definition at line 45 of file message_handler_test.cc.

45 {
47 delete[] port_buffer_;
48 }
static void ClosePorts(MessageHandler *handler)
Definition: port.cc:128

Member Function Documentation

◆ End()

void dart::TestMessageHandler::End ( )
inline

Definition at line 76 of file message_handler_test.cc.

76 {
77 MonitorLocker ml(&monitor_);
78 end_called_ = true;
79 AddPortToBuffer(-2);
80 ml.Notify();
81 }

◆ end_called()

bool dart::TestMessageHandler::end_called ( ) const
inline

Definition at line 87 of file message_handler_test.cc.

87{ return end_called_; }

◆ HandleMessage()

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

Implements dart::MessageHandler.

Definition at line 56 of file message_handler_test.cc.

56 {
57 // For testing purposes, keep a list of the ports
58 // for all messages we receive.
59 MonitorLocker ml(&monitor_);
60 AddPortToBuffer(message->dest_port());
61 message_count_++;
62 MessageStatus status = kOK;
63 if (results_ != nullptr) {
64 status = results_[0];
65 results_++;
66 }
67 ml.Notify();
68 return status;
69 }
Win32Message message

◆ message_count()

int dart::TestMessageHandler::message_count ( ) const
inline

Definition at line 85 of file message_handler_test.cc.

85{ return message_count_; }

◆ MessageNotify()

void dart::TestMessageHandler::MessageNotify ( Message::Priority  priority)
inlinevirtual

Reimplemented from dart::MessageHandler.

Definition at line 50 of file message_handler_test.cc.

50 {
51 MonitorLocker ml(&monitor_);
52 notify_count_++;
53 ml.Notify();
54 }

◆ monitor()

Monitor * dart::TestMessageHandler::monitor ( )
inline

Definition at line 91 of file message_handler_test.cc.

91{ return &monitor_; }

◆ notify_count()

int dart::TestMessageHandler::notify_count ( ) const
inline

Definition at line 84 of file message_handler_test.cc.

84{ return notify_count_; }

◆ port_buffer()

Dart_Port * dart::TestMessageHandler::port_buffer ( ) const
inline

Definition at line 83 of file message_handler_test.cc.

83{ return port_buffer_; }

◆ set_results()

void dart::TestMessageHandler::set_results ( MessageStatus results)
inline

Definition at line 89 of file message_handler_test.cc.

89{ results_ = results; }

◆ Start()

MessageStatus dart::TestMessageHandler::Start ( )
inline

Definition at line 71 of file message_handler_test.cc.

71 {
72 start_called_ = true;
73 return kOK;
74 }

◆ start_called()

bool dart::TestMessageHandler::start_called ( ) const
inline

Definition at line 86 of file message_handler_test.cc.

86{ return start_called_; }

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