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:
Marshall Greenblatt
2011-11-18 17:30:55 +00:00
parent c18ea9200d
commit 3f2735909a
11 changed files with 105 additions and 23 deletions

View File

@@ -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);

View File

@@ -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;

View File

@@ -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

View File

@@ -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;
}