mirror of
				https://bitbucket.org/chromiumembedded/cef
				synced 2025-06-05 21:39:12 +02:00 
			
		
		
		
	git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@730 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
		
			
				
	
	
		
			43 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			43 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
| // Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights
 | |
| // reserved. Use of this source code is governed by a BSD-style license that can
 | |
| // be found in the LICENSE file.
 | |
| 
 | |
| #include "libcef/browser/browser_message_loop.h"
 | |
| 
 | |
| CefBrowserMessageLoop::CefBrowserMessageLoop()
 | |
|   : is_iterating_(true) {
 | |
| }
 | |
| 
 | |
| CefBrowserMessageLoop::~CefBrowserMessageLoop() {
 | |
| #if defined(OS_MACOSX)
 | |
|   // On Mac the MessageLoop::AutoRunState scope in Run() never exits so clear
 | |
|   // the run_loop_ variable to avoid an assertion in the MessageLoop destructor.
 | |
|   run_loop_ = NULL;
 | |
| #endif
 | |
| }
 | |
| 
 | |
| // static
 | |
| CefBrowserMessageLoop* CefBrowserMessageLoop::current() {
 | |
|   MessageLoop* loop = MessageLoop::current();
 | |
|   DCHECK_EQ(MessageLoop::TYPE_UI, loop->type());
 | |
|   return static_cast<CefBrowserMessageLoop*>(loop);
 | |
| }
 | |
| 
 | |
| bool CefBrowserMessageLoop::DoIdleWork() {
 | |
|   bool valueToRet = inherited::DoIdleWork();
 | |
|   if (is_iterating_)
 | |
|     pump_->Quit();
 | |
|   return valueToRet;
 | |
| }
 | |
| 
 | |
| // Do a single interation of the UI message loop.
 | |
| void CefBrowserMessageLoop::DoMessageLoopIteration() {
 | |
|   Run();
 | |
| }
 | |
| 
 | |
| // Run the UI message loop.
 | |
| void CefBrowserMessageLoop::RunMessageLoop() {
 | |
|   is_iterating_ = false;
 | |
|   DoMessageLoopIteration();
 | |
| }
 |