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
|
@ -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_;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue