Scoped helper for loading and unloading the CEF framework library at runtime from the expected location in the app bundle.
More...
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...
}