mirror of
				https://bitbucket.org/chromiumembedded/cef
				synced 2025-06-05 21:39:12 +02:00 
			
		
		
		
	Running `cefsimple --enable-chrome-runtime` will create and run a Chrome browser window using the CEF app methods, and call CefApp::OnContextInitialized as expected. CEF task methods also work as expected in the main process. No browser-related methods or callbacks are currently supported for the Chrome window, and the application will exit when the last Chrome window closes. The Chrome runtime requires resources.pak, chrome_100_percent.pak and chrome_200_percent.pak files which were not previously built with CEF. It shares the existing locales pak files which have been updated to include additional Chrome-specific strings. On Linux, the Chrome runtime requires GTK so use_gtk=true must be specified via GN_DEFINES when building. This change also refactors the CEF runtime, which can be tested in the various supported modes by running: $ cefclient $ cefclient --multi-threaded-message-loop $ cefclient --external-message-pump
		
			
				
	
	
		
			29 lines
		
	
	
		
			626 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			626 B
		
	
	
	
		
			C++
		
	
	
	
	
	
// Copyright 2020 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/common/task_runner_manager.h"
 | 
						|
 | 
						|
#include "base/logging.h"
 | 
						|
 | 
						|
namespace {
 | 
						|
 | 
						|
CefTaskRunnerManager* g_manager = nullptr;
 | 
						|
 | 
						|
}  // namespace
 | 
						|
 | 
						|
// static
 | 
						|
CefTaskRunnerManager* CefTaskRunnerManager::Get() {
 | 
						|
  return g_manager;
 | 
						|
}
 | 
						|
 | 
						|
CefTaskRunnerManager::CefTaskRunnerManager() {
 | 
						|
  // Only a single instance should exist.
 | 
						|
  DCHECK(!g_manager);
 | 
						|
  g_manager = this;
 | 
						|
}
 | 
						|
 | 
						|
CefTaskRunnerManager::~CefTaskRunnerManager() {
 | 
						|
  g_manager = nullptr;
 | 
						|
}
 |