mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
bootstrap: Support use with older API versions (see #3935)
This commit is contained in:
@@ -30,6 +30,8 @@
|
||||
#ifndef CEF_INCLUDE_CEF_VERSION_INFO_H_
|
||||
#define CEF_INCLUDE_CEF_VERSION_INFO_H_
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "include/cef_api_hash.h"
|
||||
#include "include/internal/cef_export.h"
|
||||
|
||||
@@ -82,6 +84,26 @@ typedef struct _cef_version_info_t {
|
||||
///
|
||||
CEF_EXPORT void cef_version_info_all(cef_version_info_t* info);
|
||||
|
||||
#elif !defined(GENERATING_CEF_API_HASH)
|
||||
|
||||
// Unversioned definition to support use of the bootstrap and
|
||||
// CefScopedLibraryLoader with older API versions.
|
||||
typedef struct _cef_version_info_t {
|
||||
// Size of this structure.
|
||||
size_t size;
|
||||
|
||||
int cef_version_major;
|
||||
int cef_version_minor;
|
||||
int cef_version_patch;
|
||||
int cef_commit_number;
|
||||
int chrome_version_major;
|
||||
int chrome_version_minor;
|
||||
int chrome_version_build;
|
||||
int chrome_version_patch;
|
||||
} cef_version_info_t;
|
||||
|
||||
#endif // !defined(GENERATING_CEF_API_HASH)
|
||||
|
||||
///
|
||||
/// Populate CEF version information for the client library.
|
||||
///
|
||||
@@ -96,8 +118,6 @@ CEF_EXPORT void cef_version_info_all(cef_version_info_t* info);
|
||||
(info)->chrome_version_build = CHROME_VERSION_BUILD; \
|
||||
(info)->chrome_version_patch = CHROME_VERSION_PATCH
|
||||
|
||||
#endif // CEF_API_ADDED(CEF_NEXT)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -59,7 +59,13 @@ HMODULE Load(const std::wstring& dll_path,
|
||||
// which non-matching versions are compatible.
|
||||
cef_version_info_t dll_info = {};
|
||||
dll_info.size = sizeof(cef_version_info_t);
|
||||
#if CEF_API_ADDED(CEF_NEXT)
|
||||
cef_version_info_all(&dll_info);
|
||||
#else
|
||||
// Only populating the members that are used below.
|
||||
dll_info.chrome_version_major = cef_version_info(4);
|
||||
dll_info.chrome_version_patch = cef_version_info(7);
|
||||
#endif
|
||||
if (dll_info.chrome_version_major != version_info->chrome_version_major ||
|
||||
dll_info.chrome_version_patch != version_info->chrome_version_patch) {
|
||||
LOG(FATAL) << "Failed libcef.dll version check; expected "
|
||||
|
Reference in New Issue
Block a user