1.4. Chromium source Code Analysis-chromiumframe-Message series

Source: Internet
Author: User

The message framework is the encapsulation and extension of the messaging loop,chromium the work of handling internal tasks in the message loop. With the internal work processing parasitic in the Windows message loop, there is a problem that there is no Windows self-message, and chromium internal work, when the internal actions can not be processed in time. Chromium this defines a custom message kmsghavework that is used to drive windows when there is work inside the chromium.

From the code level, the Chromium internal work queue is plugged into work when a kmsghavework message is post.
The news of the planned work is post in Schedulework.

The Message framework Pseudo-code is the following example:

1  for(;;)2 {    3     //1. Message Loops4     if(PeekMessage ())5     {6         //1.1 added the dispatcher for the response7         if(Dispatcher)8         {9Dispatcher->Dispatch ();Ten         } One         Else A         { - TranslateMessage (); - DispatchMessage (); the         } -     } -     //2. Internal work - DoWork (); +     //3. Internal delay work - dodelaywork (); +     //4. Internal idle work A doidlework (); at     //5. Waiting for a message - waitmessage (); -}

Chromium's message pump (messaging pump) is a more rigorous, granular loop, in order to secure the external access to this loop, Chromium uses delegation mode and is derived from Messageloop. The internal "work" processing can be achieved by using the Messageloop class only.

messagepump Message pump abstract base class nested class Delegate delegate class provides external use.
Messagepumpwin message Pump implementation class Nested classes have observer observer classes and dispatcher distribution classes.

Messageloop is a derived class of the delegate delegate class.
General understanding, and so later used to detailed analysis.

1.4. Chromium source Code Analysis-chromiumframe-Message series

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.