mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add CefQuitMessageLoop function (issue #443).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@412 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -421,6 +421,23 @@ void CefRunMessageLoop()
|
||||
_Context->process()->RunMessageLoop();
|
||||
}
|
||||
|
||||
void CefQuitMessageLoop()
|
||||
{
|
||||
// Verify that the context is in a valid state.
|
||||
if (!CONTEXT_STATE_VALID()) {
|
||||
NOTREACHED() << "context not valid";
|
||||
return;
|
||||
}
|
||||
|
||||
// Must always be called on the same thread as Initialize.
|
||||
if(!_Context->process()->CalledOnValidThread()) {
|
||||
NOTREACHED() << "called on invalid thread";
|
||||
return;
|
||||
}
|
||||
|
||||
_Context->process()->QuitMessageLoop();
|
||||
}
|
||||
|
||||
bool CefRegisterPlugin(const CefPluginInfo& plugin_info)
|
||||
{
|
||||
// Verify that the context is in a valid state.
|
||||
|
@@ -97,6 +97,11 @@ void CefProcess::RunMessageLoop() {
|
||||
ui_message_loop_->RunMessageLoop();
|
||||
}
|
||||
|
||||
void CefProcess::QuitMessageLoop() {
|
||||
DCHECK(CalledOnValidThread() && ui_message_loop_.get() != NULL);
|
||||
ui_message_loop_->Quit();
|
||||
}
|
||||
|
||||
void CefProcess::CreateUIThread() {
|
||||
DCHECK(!created_ui_thread_ && ui_thread_.get() == NULL);
|
||||
created_ui_thread_ = true;
|
||||
|
@@ -60,9 +60,12 @@ class CefProcess : public base::NonThreadSafe {
|
||||
// RunMessageLoop() was called you do not need to call this method.
|
||||
void DoMessageLoopIteration();
|
||||
|
||||
// Run the UI message loop for the on the current thread.
|
||||
// Run the UI message loop on the current thread.
|
||||
void RunMessageLoop();
|
||||
|
||||
// Quit the UI message loop on the current thread.
|
||||
void QuitMessageLoop();
|
||||
|
||||
// Returns the thread that we perform I/O coordination on (network requests,
|
||||
// communication with renderers, etc.
|
||||
// NOTE: You should ONLY use this to pass to IPC or other objects which must
|
||||
|
Reference in New Issue
Block a user