Various fixes related to the C++11/14 update (see issue #3140)

- Convert scoped_ptr to std::unique_ptr from <memory>
- Convert arraysize to base::size from include/base/cef_cxx17_backports.h
- Convert NULL to nullptr
- Include include/base/cef_callback.h instead of include/base/cef_bind.h
- Implicit conversion of CefRefPtr<T> or scoped_refptr<T> to T* is gone;
  use .get() instead

See the issue for additional details.
This commit is contained in:
Marshall Greenblatt
2021-06-17 16:08:01 -04:00
parent 5d438ced79
commit 17fc2b3e3b
141 changed files with 580 additions and 627 deletions

View File

@ -10,7 +10,6 @@
#include "include/base/cef_macros.h"
#include "include/capi/cef_base_capi.h"
#include "include/cef_base.h"
#include "libcef_dll/ptr_util.h"
#include "libcef_dll/wrapper_types.h"
// Wrap a C++ class with a C structure. This is used when the class

View File

@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=a102f383e3ecac5237310b2e5aa5b2fd37474188$
// $hash=982f16fd8ec5c6a195f24f6aaeac41b2e1373f68$
//
#include "libcef_dll/cpptoc/test/translator_test_cpptoc.h"
@ -1152,7 +1152,7 @@ translator_test_get_own_ptr_library(struct _cef_translator_test_t* self,
CefTranslatorTestCppToC::Get(self)->GetOwnPtrLibrary(val);
// Return type: ownptr_same
return CefTranslatorTestScopedLibraryCppToC::WrapOwn(OWN_PASS(_retval));
return CefTranslatorTestScopedLibraryCppToC::WrapOwn(std::move(_retval));
}
int CEF_CALLBACK translator_test_set_own_ptr_library(
@ -1200,7 +1200,7 @@ translator_test_set_own_ptr_library_and_return(
CefTranslatorTestScopedLibraryCppToC::UnwrapOwn(val));
// Return type: ownptr_same
return CefTranslatorTestScopedLibraryCppToC::WrapOwn(OWN_PASS(_retval));
return CefTranslatorTestScopedLibraryCppToC::WrapOwn(std::move(_retval));
}
int CEF_CALLBACK translator_test_set_child_own_ptr_library(
@ -1248,7 +1248,7 @@ translator_test_set_child_own_ptr_library_and_return_parent(
CefTranslatorTestScopedLibraryChildCppToC::UnwrapOwn(val));
// Return type: ownptr_same
return CefTranslatorTestScopedLibraryCppToC::WrapOwn(OWN_PASS(_retval));
return CefTranslatorTestScopedLibraryCppToC::WrapOwn(std::move(_retval));
}
int CEF_CALLBACK translator_test_set_own_ptr_client(
@ -1272,7 +1272,7 @@ int CEF_CALLBACK translator_test_set_own_ptr_client(
// Execute
int _retval =
CefTranslatorTestCppToC::Get(self)->SetOwnPtrClient(OWN_PASS(valPtr));
CefTranslatorTestCppToC::Get(self)->SetOwnPtrClient(std::move(valPtr));
// Return type: simple
return _retval;
@ -1301,10 +1301,10 @@ translator_test_set_own_ptr_client_and_return(
// Execute
CefOwnPtr<CefTranslatorTestScopedClient> _retval =
CefTranslatorTestCppToC::Get(self)->SetOwnPtrClientAndReturn(
OWN_PASS(valPtr));
std::move(valPtr));
// Return type: ownptr_diff
return CefTranslatorTestScopedClientCToCpp::UnwrapOwn(OWN_PASS(_retval));
return CefTranslatorTestScopedClientCToCpp::UnwrapOwn(std::move(_retval));
}
int CEF_CALLBACK translator_test_set_child_own_ptr_client(
@ -1328,7 +1328,7 @@ int CEF_CALLBACK translator_test_set_child_own_ptr_client(
// Execute
int _retval = CefTranslatorTestCppToC::Get(self)->SetChildOwnPtrClient(
OWN_PASS(valPtr));
std::move(valPtr));
// Return type: simple
return _retval;
@ -1357,10 +1357,10 @@ translator_test_set_child_own_ptr_client_and_return_parent(
// Execute
CefOwnPtr<CefTranslatorTestScopedClient> _retval =
CefTranslatorTestCppToC::Get(self)->SetChildOwnPtrClientAndReturnParent(
OWN_PASS(valPtr));
std::move(valPtr));
// Return type: ownptr_diff
return CefTranslatorTestScopedClientCToCpp::UnwrapOwn(OWN_PASS(_retval));
return CefTranslatorTestScopedClientCToCpp::UnwrapOwn(std::move(_retval));
}
int CEF_CALLBACK translator_test_set_raw_ptr_library(

View File

@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=7fbfdb7d8fd3b7e41ba55f2138e9752f301a2438$
// $hash=fe3ba17a673de7d4051eb0ed4c83eb7d40f6d4b6$
//
#include "libcef_dll/cpptoc/test/translator_test_scoped_client_cpptoc.h"
@ -54,10 +54,8 @@ CefCppToCScoped<CefTranslatorTestScopedClientCppToC,
UnwrapDerivedOwn(CefWrapperType type,
cef_translator_test_scoped_client_t* s) {
if (type == WT_TRANSLATOR_TEST_SCOPED_CLIENT_CHILD) {
return OWN_RETURN_AS(
CefTranslatorTestScopedClientChildCppToC::UnwrapOwn(
reinterpret_cast<cef_translator_test_scoped_client_child_t*>(s)),
CefTranslatorTestScopedClient);
return CefTranslatorTestScopedClientChildCppToC::UnwrapOwn(
reinterpret_cast<cef_translator_test_scoped_client_child_t*>(s));
}
NOTREACHED() << "Unexpected class type: " << type;
return CefOwnPtr<CefTranslatorTestScopedClient>();

View File

@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=2f64a37b4735c7d91035aec2fffa263d7d27942b$
// $hash=1fa64c4f005a9ce3af83148fa5eeccaf45706200$
//
#include "libcef_dll/cpptoc/test/translator_test_scoped_library_child_child_cpptoc.h"
@ -29,7 +29,7 @@ cef_translator_test_scoped_library_child_child_create(int value,
// Return type: ownptr_same
return CefTranslatorTestScopedLibraryChildChildCppToC::WrapOwn(
OWN_PASS(_retval));
std::move(_retval));
}
namespace {

View File

@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=cd7a42714195bed68aef8a200c7e1a38681558f2$
// $hash=a5c43bc178aa01efbf560be47b1429fd4540d27f$
//
#include "libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.h"
@ -26,7 +26,7 @@ cef_translator_test_scoped_library_child_create(int value, int other_value) {
CefTranslatorTestScopedLibraryChild::Create(value, other_value);
// Return type: ownptr_same
return CefTranslatorTestScopedLibraryChildCppToC::WrapOwn(OWN_PASS(_retval));
return CefTranslatorTestScopedLibraryChildCppToC::WrapOwn(std::move(_retval));
}
namespace {
@ -122,11 +122,8 @@ CefCppToCScoped<CefTranslatorTestScopedLibraryChildCppToC,
UnwrapDerivedOwn(CefWrapperType type,
cef_translator_test_scoped_library_child_t* s) {
if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD) {
return OWN_RETURN_AS(
CefTranslatorTestScopedLibraryChildChildCppToC::UnwrapOwn(
reinterpret_cast<cef_translator_test_scoped_library_child_child_t*>(
s)),
CefTranslatorTestScopedLibraryChild);
return CefTranslatorTestScopedLibraryChildChildCppToC::UnwrapOwn(
reinterpret_cast<cef_translator_test_scoped_library_child_child_t*>(s));
}
NOTREACHED() << "Unexpected class type: " << type;
return CefOwnPtr<CefTranslatorTestScopedLibraryChild>();

View File

@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=9e0c499cc30e7e762de3d5969ab6795ec50ffc08$
// $hash=4f28d789be1549022af70417a8d2f711d688f3b7$
//
#include "libcef_dll/cpptoc/test/translator_test_scoped_library_cpptoc.h"
@ -27,7 +27,7 @@ cef_translator_test_scoped_library_create(int value) {
CefTranslatorTestScopedLibrary::Create(value);
// Return type: ownptr_same
return CefTranslatorTestScopedLibraryCppToC::WrapOwn(OWN_PASS(_retval));
return CefTranslatorTestScopedLibraryCppToC::WrapOwn(std::move(_retval));
}
namespace {
@ -83,17 +83,12 @@ CefCppToCScoped<CefTranslatorTestScopedLibraryCppToC,
UnwrapDerivedOwn(CefWrapperType type,
cef_translator_test_scoped_library_t* s) {
if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD) {
return OWN_RETURN_AS(
CefTranslatorTestScopedLibraryChildCppToC::UnwrapOwn(
reinterpret_cast<cef_translator_test_scoped_library_child_t*>(s)),
CefTranslatorTestScopedLibrary);
return CefTranslatorTestScopedLibraryChildCppToC::UnwrapOwn(
reinterpret_cast<cef_translator_test_scoped_library_child_t*>(s));
}
if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD) {
return OWN_RETURN_AS(
CefTranslatorTestScopedLibraryChildChildCppToC::UnwrapOwn(
reinterpret_cast<cef_translator_test_scoped_library_child_child_t*>(
s)),
CefTranslatorTestScopedLibrary);
return CefTranslatorTestScopedLibraryChildChildCppToC::UnwrapOwn(
reinterpret_cast<cef_translator_test_scoped_library_child_child_t*>(s));
}
NOTREACHED() << "Unexpected class type: " << type;
return CefOwnPtr<CefTranslatorTestScopedLibrary>();