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

@@ -6,9 +6,10 @@
#include <errno.h>
#include <fcntl.h>
#include <glib.h>
#include <math.h>
#include <glib.h>
#include <memory>
#include "include/base/cef_logging.h"
#include "include/cef_app.h"
@@ -100,8 +101,9 @@ class MainMessageLoopExternalPumpLinux : public MainMessageLoopExternalPump {
int wakeup_pipe_read_;
int wakeup_pipe_write_;
// Use a scoped_ptr to avoid needing the definition of GPollFD in the header.
scoped_ptr<GPollFD> wakeup_gpollfd_;
// Use a std::unique_ptr to avoid needing the definition of GPollFD in the
// header.
std::unique_ptr<GPollFD> wakeup_gpollfd_;
};
// Return a timeout suitable for the glib loop, -1 to block forever,
@@ -150,7 +152,7 @@ gboolean WorkSourceDispatch(GSource* source,
// I wish these could be const, but g_source_new wants non-const.
GSourceFuncs WorkSourceFuncs = {WorkSourcePrepare, WorkSourceCheck,
WorkSourceDispatch, NULL};
WorkSourceDispatch, nullptr};
MainMessageLoopExternalPumpLinux::MainMessageLoopExternalPumpLinux()
: should_quit_(false),
@@ -292,9 +294,9 @@ bool MainMessageLoopExternalPumpLinux::IsTimerPending() {
} // namespace
// static
scoped_ptr<MainMessageLoopExternalPump> MainMessageLoopExternalPump::Create() {
return scoped_ptr<MainMessageLoopExternalPump>(
new MainMessageLoopExternalPumpLinux());
std::unique_ptr<MainMessageLoopExternalPump>
MainMessageLoopExternalPump::Create() {
return std::make_unique<MainMessageLoopExternalPumpLinux>();
}
} // namespace client