mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Stop using CefStructBase for POD types (fixes issue #3357)
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=4d101afc4f559c6f0375ad4016e5575ab88bf61f$
|
||||
// $hash=8b6386137895a8c202890fd6a5d239eddd9e400e$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/views/panel_cpptoc.h"
|
||||
@@ -25,7 +25,6 @@
|
||||
#include "libcef_dll/ctocpp/views/panel_delegate_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/views/view_delegate_ctocpp.h"
|
||||
#include "libcef_dll/shutdown_checker.h"
|
||||
#include "libcef_dll/template_util.h"
|
||||
|
||||
// GLOBAL FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
@@ -84,7 +83,7 @@ panel_set_to_fill_layout(struct _cef_panel_t* self) {
|
||||
|
||||
cef_box_layout_t* CEF_CALLBACK
|
||||
panel_set_to_box_layout(struct _cef_panel_t* self,
|
||||
const struct _cef_box_layout_settings_t* settings) {
|
||||
const cef_box_layout_settings_t* settings) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
@@ -92,23 +91,18 @@ panel_set_to_box_layout(struct _cef_panel_t* self,
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return NULL;
|
||||
// Verify param: settings; type: struct_byref_const
|
||||
// Verify param: settings; type: simple_byref_const
|
||||
DCHECK(settings);
|
||||
if (!settings)
|
||||
return NULL;
|
||||
if (!template_util::has_valid_size(settings)) {
|
||||
NOTREACHED() << "invalid settings->[base.]size";
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Translate param: settings; type: struct_byref_const
|
||||
CefBoxLayoutSettings settingsObj;
|
||||
if (settings)
|
||||
settingsObj.Set(*settings, false);
|
||||
// Translate param: settings; type: simple_byref_const
|
||||
CefBoxLayoutSettings settingsVal =
|
||||
settings ? *settings : CefBoxLayoutSettings();
|
||||
|
||||
// Execute
|
||||
CefRefPtr<CefBoxLayout> _retval =
|
||||
CefPanelCppToC::Get(self)->SetToBoxLayout(settingsObj);
|
||||
CefPanelCppToC::Get(self)->SetToBoxLayout(settingsVal);
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefBoxLayoutCppToC::Wrap(_retval);
|
||||
|
@@ -9,14 +9,13 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=1a7a3f0cd61dab86aae86ca54e5554671d1850b7$
|
||||
// $hash=be4a8b1aeaa7b2c6701c9cc5445285a20027c44b$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/views/textfield_delegate_cpptoc.h"
|
||||
#include "libcef_dll/ctocpp/views/textfield_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/views/view_ctocpp.h"
|
||||
#include "libcef_dll/shutdown_checker.h"
|
||||
#include "libcef_dll/template_util.h"
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -25,7 +24,7 @@ namespace {
|
||||
int CEF_CALLBACK
|
||||
textfield_delegate_on_key_event(struct _cef_textfield_delegate_t* self,
|
||||
cef_textfield_t* textfield,
|
||||
const struct _cef_key_event_t* event) {
|
||||
const cef_key_event_t* event) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
@@ -37,23 +36,17 @@ textfield_delegate_on_key_event(struct _cef_textfield_delegate_t* self,
|
||||
DCHECK(textfield);
|
||||
if (!textfield)
|
||||
return 0;
|
||||
// Verify param: event; type: struct_byref_const
|
||||
// Verify param: event; type: simple_byref_const
|
||||
DCHECK(event);
|
||||
if (!event)
|
||||
return 0;
|
||||
if (!template_util::has_valid_size(event)) {
|
||||
NOTREACHED() << "invalid event->[base.]size";
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Translate param: event; type: struct_byref_const
|
||||
CefKeyEvent eventObj;
|
||||
if (event)
|
||||
eventObj.Set(*event, false);
|
||||
// Translate param: event; type: simple_byref_const
|
||||
CefKeyEvent eventVal = event ? *event : CefKeyEvent();
|
||||
|
||||
// Execute
|
||||
bool _retval = CefTextfieldDelegateCppToC::Get(self)->OnKeyEvent(
|
||||
CefTextfieldCToCpp::Wrap(textfield), eventObj);
|
||||
CefTextfieldCToCpp::Wrap(textfield), eventVal);
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=cf3e61b4caedb8689bcc3a0a5b21b1897eef5220$
|
||||
// $hash=32506537b2118f2d16285dc09174ae721447adc2$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/views/window_cpptoc.h"
|
||||
@@ -29,7 +29,6 @@
|
||||
#include "libcef_dll/ctocpp/views/view_delegate_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/views/window_delegate_ctocpp.h"
|
||||
#include "libcef_dll/shutdown_checker.h"
|
||||
#include "libcef_dll/template_util.h"
|
||||
|
||||
// GLOBAL FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
@@ -691,7 +690,7 @@ window_set_to_fill_layout(struct _cef_panel_t* self) {
|
||||
|
||||
cef_box_layout_t* CEF_CALLBACK
|
||||
window_set_to_box_layout(struct _cef_panel_t* self,
|
||||
const struct _cef_box_layout_settings_t* settings) {
|
||||
const cef_box_layout_settings_t* settings) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
@@ -699,24 +698,19 @@ window_set_to_box_layout(struct _cef_panel_t* self,
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return NULL;
|
||||
// Verify param: settings; type: struct_byref_const
|
||||
// Verify param: settings; type: simple_byref_const
|
||||
DCHECK(settings);
|
||||
if (!settings)
|
||||
return NULL;
|
||||
if (!template_util::has_valid_size(settings)) {
|
||||
NOTREACHED() << "invalid settings->[base.]size";
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Translate param: settings; type: struct_byref_const
|
||||
CefBoxLayoutSettings settingsObj;
|
||||
if (settings)
|
||||
settingsObj.Set(*settings, false);
|
||||
// Translate param: settings; type: simple_byref_const
|
||||
CefBoxLayoutSettings settingsVal =
|
||||
settings ? *settings : CefBoxLayoutSettings();
|
||||
|
||||
// Execute
|
||||
CefRefPtr<CefBoxLayout> _retval =
|
||||
CefWindowCppToC::Get(reinterpret_cast<cef_window_t*>(self))
|
||||
->SetToBoxLayout(settingsObj);
|
||||
->SetToBoxLayout(settingsVal);
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefBoxLayoutCppToC::Wrap(_retval);
|
||||
|
@@ -9,14 +9,13 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=60fce570867addbf622a0f74422d225f23942e4d$
|
||||
// $hash=2ecdf3e890e54e962286430f350c5b49249a9a9e$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/views/window_delegate_cpptoc.h"
|
||||
#include "libcef_dll/ctocpp/views/view_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/views/window_ctocpp.h"
|
||||
#include "libcef_dll/shutdown_checker.h"
|
||||
#include "libcef_dll/template_util.h"
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -317,7 +316,7 @@ window_delegate_on_accelerator(struct _cef_window_delegate_t* self,
|
||||
int CEF_CALLBACK
|
||||
window_delegate_on_key_event(struct _cef_window_delegate_t* self,
|
||||
cef_window_t* window,
|
||||
const struct _cef_key_event_t* event) {
|
||||
const cef_key_event_t* event) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
@@ -329,23 +328,17 @@ window_delegate_on_key_event(struct _cef_window_delegate_t* self,
|
||||
DCHECK(window);
|
||||
if (!window)
|
||||
return 0;
|
||||
// Verify param: event; type: struct_byref_const
|
||||
// Verify param: event; type: simple_byref_const
|
||||
DCHECK(event);
|
||||
if (!event)
|
||||
return 0;
|
||||
if (!template_util::has_valid_size(event)) {
|
||||
NOTREACHED() << "invalid event->[base.]size";
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Translate param: event; type: struct_byref_const
|
||||
CefKeyEvent eventObj;
|
||||
if (event)
|
||||
eventObj.Set(*event, false);
|
||||
// Translate param: event; type: simple_byref_const
|
||||
CefKeyEvent eventVal = event ? *event : CefKeyEvent();
|
||||
|
||||
// Execute
|
||||
bool _retval = CefWindowDelegateCppToC::Get(self)->OnKeyEvent(
|
||||
CefWindowCToCpp::Wrap(window), eventObj);
|
||||
CefWindowCToCpp::Wrap(window), eventVal);
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
|
Reference in New Issue
Block a user