refactor: use C++11 class member variable initialization (#27477)
This commit is contained in:
parent
f083380c38
commit
ddf3ef0a5f
93 changed files with 130 additions and 163 deletions
|
@ -127,10 +127,11 @@ class ProcessSingleton {
|
|||
NotificationCallback notification_callback_; // Handler for notifications.
|
||||
|
||||
#if defined(OS_WIN)
|
||||
HWND remote_window_; // The HWND_MESSAGE of another browser.
|
||||
HWND remote_window_ = nullptr; // The HWND_MESSAGE of another browser.
|
||||
base::win::MessageWindow window_; // The message-only window.
|
||||
bool is_virtualized_; // Stuck inside Microsoft Softricity VM environment.
|
||||
HANDLE lock_file_;
|
||||
bool is_virtualized_ =
|
||||
false; // Stuck inside Microsoft Softricity VM environment.
|
||||
HANDLE lock_file_ = INVALID_HANDLE_VALUE;
|
||||
base::FilePath user_data_dir_;
|
||||
ShouldKillRemoteProcessCallback should_kill_remote_process_callback_;
|
||||
#elif defined(OS_POSIX) && !defined(OS_ANDROID)
|
||||
|
@ -175,7 +176,7 @@ class ProcessSingleton {
|
|||
// because it posts messages between threads.
|
||||
class LinuxWatcher;
|
||||
scoped_refptr<LinuxWatcher> watcher_;
|
||||
int sock_;
|
||||
int sock_ = -1;
|
||||
bool listen_on_ready_ = false;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -333,7 +333,7 @@ bool IsChromeProcess(pid_t pid) {
|
|||
// A helper class to hold onto a socket.
|
||||
class ScopedSocket {
|
||||
public:
|
||||
ScopedSocket() : fd_(-1) { Reset(); }
|
||||
ScopedSocket() { Reset(); }
|
||||
~ScopedSocket() { Close(); }
|
||||
int fd() { return fd_; }
|
||||
void Reset() {
|
||||
|
@ -347,7 +347,7 @@ class ScopedSocket {
|
|||
}
|
||||
|
||||
private:
|
||||
int fd_;
|
||||
int fd_ = -1;
|
||||
};
|
||||
|
||||
// Returns a random string for uniquifying profile connections.
|
||||
|
@ -473,10 +473,7 @@ class ProcessSingleton::LinuxWatcher
|
|||
SocketReader(ProcessSingleton::LinuxWatcher* parent,
|
||||
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
|
||||
int fd)
|
||||
: parent_(parent),
|
||||
ui_task_runner_(ui_task_runner),
|
||||
fd_(fd),
|
||||
bytes_read_(0) {
|
||||
: parent_(parent), ui_task_runner_(ui_task_runner), fd_(fd) {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
||||
// Wait for reads.
|
||||
fd_watch_controller_ = base::FileDescriptorWatcher::WatchReadable(
|
||||
|
@ -508,20 +505,20 @@ class ProcessSingleton::LinuxWatcher
|
|||
fd_watch_controller_;
|
||||
|
||||
// The ProcessSingleton::LinuxWatcher that owns us.
|
||||
ProcessSingleton::LinuxWatcher* const parent_;
|
||||
ProcessSingleton::LinuxWatcher* const parent_ = nullptr;
|
||||
|
||||
// A reference to the UI task runner.
|
||||
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_;
|
||||
|
||||
// The file descriptor we're reading.
|
||||
const int fd_;
|
||||
const int fd_ = -1;
|
||||
|
||||
// Store the message in this buffer.
|
||||
char buf_[kMaxMessageLength];
|
||||
|
||||
// Tracks the number of bytes we've read in case we're getting partial
|
||||
// reads.
|
||||
size_t bytes_read_;
|
||||
size_t bytes_read_ = 0;
|
||||
|
||||
base::OneShotTimer timer_;
|
||||
|
||||
|
|
|
@ -172,8 +172,6 @@ ProcessSingleton::ProcessSingleton(
|
|||
const base::FilePath& user_data_dir,
|
||||
const NotificationCallback& notification_callback)
|
||||
: notification_callback_(notification_callback),
|
||||
is_virtualized_(false),
|
||||
lock_file_(INVALID_HANDLE_VALUE),
|
||||
user_data_dir_(user_data_dir),
|
||||
should_kill_remote_process_callback_(
|
||||
base::BindRepeating(&TerminateAppWithError)) {
|
||||
|
|
|
@ -38,8 +38,7 @@ void GlobalMenuBarRegistrarX11::OnWindowUnmapped(x11::Window window) {
|
|||
live_windows_.erase(window);
|
||||
}
|
||||
|
||||
GlobalMenuBarRegistrarX11::GlobalMenuBarRegistrarX11()
|
||||
: registrar_proxy_(nullptr) {
|
||||
GlobalMenuBarRegistrarX11::GlobalMenuBarRegistrarX11() {
|
||||
// libdbusmenu uses the gio version of dbus; I tried using the code in dbus/,
|
||||
// but it looks like that's isn't sharing the bus name with the gio version,
|
||||
// even when |connection_type| is set to SHARED.
|
||||
|
|
|
@ -48,7 +48,7 @@ class GlobalMenuBarRegistrarX11 {
|
|||
GObject*,
|
||||
GParamSpec*);
|
||||
|
||||
GDBusProxy* registrar_proxy_;
|
||||
GDBusProxy* registrar_proxy_ = nullptr;
|
||||
|
||||
// x11::Window which want to be registered, but haven't yet been because
|
||||
// we're waiting for the proxy to become available.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue