Add CefAppManager and remove global ContentClient accessors (see issue #2969)

This is the first pass in removing direct dependencies on the Alloy
runtime from code that can potentially be shared between runtimes.

CefBrowserHost and CefRequestContext APIs (including CefCookieManager,
CefURLRequest, etc.) are not yet implemented for the Chrome runtime.
Assert early if these API methods are called while the Chrome runtime
is enabled.
This commit is contained in:
Marshall Greenblatt
2020-06-28 17:05:36 -04:00
parent 84f3ff2afd
commit b3a8da9b25
45 changed files with 522 additions and 312 deletions

View File

@ -8,7 +8,7 @@
#include <string>
#include <vector>
#include "libcef/common/alloy/alloy_content_client.h"
#include "libcef/common/app_manager.h"
#include "libcef/common/cef_messages.h"
#include "libcef/renderer/alloy/alloy_content_renderer_client.h"
#include "libcef/renderer/blink_glue.h"
@ -345,7 +345,7 @@ void CefBrowserImpl::AddFrameObject(int64_t frame_id,
void CefBrowserImpl::OnDestruct() {
// Notify that the browser window has been destroyed.
CefRefPtr<CefApp> app = AlloyContentClient::Get()->application();
CefRefPtr<CefApp> app = CefAppManager::Get()->GetApplication();
if (app.get()) {
CefRefPtr<CefRenderProcessHandler> handler = app->GetRenderProcessHandler();
if (handler.get())
@ -373,7 +373,7 @@ void CefBrowserImpl::FrameDetached(int64_t frame_id) {
}
void CefBrowserImpl::OnLoadingStateChange(bool isLoading) {
CefRefPtr<CefApp> app = AlloyContentClient::Get()->application();
CefRefPtr<CefApp> app = CefAppManager::Get()->GetApplication();
if (app.get()) {
CefRefPtr<CefRenderProcessHandler> handler = app->GetRenderProcessHandler();
if (handler.get()) {