Skip to content

Commit 98f1ded

Browse files
committed
Expose CefRunMessageLoop and CefQuitMessageLoop - It may be possible to run the CEF message loop and then load the WinForms Form on the same thread.
1 parent cb238ba commit 98f1ded

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

CefSharp.Core/Cef.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,29 @@ namespace CefSharp
194194
return success;
195195
}
196196

197+
/// <summary>
198+
/// Run the CEF message loop. Use this function instead of an application-
199+
/// provided message loop to get the best balance between performance and CPU
200+
/// usage. This function should only be called on the main application thread and
201+
/// only if Cef.Initialize() is called with a
202+
/// CefSettings.MultiThreadedMessageLoop value of false. This function will
203+
/// block until a quit message is received by the system.
204+
/// </summary>
205+
static void RunMessageLoop()
206+
{
207+
CefRunMessageLoop();
208+
}
209+
210+
/// <summary>
211+
/// Quit the CEF message loop that was started by calling Cef.RunMessageLoop().
212+
/// This function should only be called on the main application thread and only
213+
/// if Cef.RunMessageLoop() was used.
214+
/// </summary>
215+
static void QuitMessageLoop()
216+
{
217+
CefQuitMessageLoop();
218+
}
219+
197220
/// <summary>
198221
/// Perform a single iteration of CEF message loop processing.This function is
199222
/// provided for cases where the CEF message loop must be integrated into an

0 commit comments

Comments
 (0)