Chromium Embedded Framework (CEF)  126.2.0+g5c56e98+chromium-126.0.6478.62
CefScopedLibraryLoader Class Reference

Scoped helper for loading and unloading the CEF framework library at runtime from the expected location in the app bundle. More...

#include "include/wrapper/cef_library_loader.h"

Public Member Functions

 CefScopedLibraryLoader ()
 
 CefScopedLibraryLoader (const CefScopedLibraryLoader &)=delete
 
CefScopedLibraryLoaderoperator= (const CefScopedLibraryLoader &)=delete
 
 ~CefScopedLibraryLoader ()
 
bool LoadInMain ()
 Load the CEF framework in the main process from the expected app bundle location relative to the executable. More...
 
bool LoadInHelper ()
 Load the CEF framework in the helper process from the expected app bundle location relative to the executable. More...
 

Detailed Description

Scoped helper for loading and unloading the CEF framework library at runtime from the expected location in the app bundle.

Loading at runtime instead of linking directly is a requirement of the macOS sandbox implementation.

Example usage in the main process:

  #include "include/wrapper/cef_library_loader.h"

  int main(int argc, char* argv[]) {
    // Dynamically load the CEF framework library.
    CefScopedLibraryLoader library_loader;
    if (!library_loader.LoadInMain())
      return 1;

    // Continue with CEF initialization...
  }

Example usage in the helper process:

  #include "include/cef_sandbox_mac.h"
  #include "include/wrapper/cef_library_loader.h"

  int main(int argc, char* argv[]) {
    // Initialize the macOS sandbox for this helper process.
    CefScopedSandboxContext sandbox_context;
    if (!sandbox_context.Initialize(argc, argv))
      return 1;

    // Dynamically load the CEF framework library.
    CefScopedLibraryLoader library_loader;
    if (!library_loader.LoadInHelper())
      return 1;

    // Continue with CEF initialization...
  }

Constructor & Destructor Documentation

◆ CefScopedLibraryLoader() [1/2]

CefScopedLibraryLoader::CefScopedLibraryLoader ( )

◆ CefScopedLibraryLoader() [2/2]

CefScopedLibraryLoader::CefScopedLibraryLoader ( const CefScopedLibraryLoader )
delete

◆ ~CefScopedLibraryLoader()

CefScopedLibraryLoader::~CefScopedLibraryLoader ( )

Member Function Documentation

◆ LoadInHelper()

bool CefScopedLibraryLoader::LoadInHelper ( )
inline

Load the CEF framework in the helper process from the expected app bundle location relative to the executable.

Returns true if the load succeeds.

◆ LoadInMain()

bool CefScopedLibraryLoader::LoadInMain ( )
inline

Load the CEF framework in the main process from the expected app bundle location relative to the executable.

Returns true if the load succeeds.

◆ operator=()

CefScopedLibraryLoader& CefScopedLibraryLoader::operator= ( const CefScopedLibraryLoader )
delete

The documentation for this class was generated from the following file: