mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Verify that libcef build revision and API/header revision match when initializing CEF (issue #431).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@386 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
// tools directory for more information.
|
||||
//
|
||||
|
||||
#include "include/cef_version.h"
|
||||
#include "libcef_dll/ctocpp/command_line_ctocpp.h"
|
||||
#include "libcef_dll/transfer_util.h"
|
||||
|
||||
@@ -18,6 +19,13 @@
|
||||
|
||||
CefRefPtr<CefCommandLine> CefCommandLine::CreateCommandLine()
|
||||
{
|
||||
int build_revision = cef_build_revision();
|
||||
if (build_revision != CEF_REVISION) {
|
||||
// The libcef build revision does not match the CEF API revision.
|
||||
DCHECK(FALSE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
cef_command_line_t* impl = cef_command_line_create();
|
||||
if(impl)
|
||||
return CefCommandLineCToCpp::Wrap(impl);
|
||||
|
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "include/cef.h"
|
||||
#include "include/cef_capi.h"
|
||||
#include "include/cef_version.h"
|
||||
#include "include/cef_nplugin.h"
|
||||
#include "include/cef_nplugin_capi.h"
|
||||
#include "cef_logging.h"
|
||||
@@ -38,6 +39,11 @@
|
||||
#include "base/string_split.h"
|
||||
|
||||
|
||||
CEF_EXPORT int cef_build_revision()
|
||||
{
|
||||
return CEF_REVISION;
|
||||
}
|
||||
|
||||
CEF_EXPORT int cef_initialize(const struct _cef_settings_t* settings)
|
||||
{
|
||||
CefSettings settingsObj;
|
||||
|
@@ -9,8 +9,8 @@
|
||||
//
|
||||
#define APSTUDIO_HIDDEN_SYMBOLS
|
||||
#include "windows.h"
|
||||
#include "include/cef_version.h"
|
||||
#undef APSTUDIO_HIDDEN_SYMBOLS
|
||||
#include "../version.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
@@ -39,8 +39,8 @@ END
|
||||
BEGIN
|
||||
"#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
|
||||
"#include ""windows.h""\r\n"
|
||||
"#include ""include/version.h""\r\n"
|
||||
"#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
|
||||
"#include ""version.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
|
@@ -6,6 +6,7 @@
|
||||
#include "include/cef_capi.h"
|
||||
#include "include/cef_nplugin.h"
|
||||
#include "include/cef_nplugin_capi.h"
|
||||
#include "include/cef_version.h"
|
||||
#include "libcef_dll/cpptoc/content_filter_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/cookie_visitor_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/domevent_listener_cpptoc.h"
|
||||
@@ -38,6 +39,13 @@
|
||||
|
||||
bool CefInitialize(const CefSettings& settings)
|
||||
{
|
||||
int build_revision = cef_build_revision();
|
||||
if (build_revision != CEF_REVISION) {
|
||||
// The libcef build revision does not match the CEF API revision.
|
||||
DCHECK(FALSE);
|
||||
return false;
|
||||
}
|
||||
|
||||
return cef_initialize(&settings)?true:false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user