Refactoring: use C++11 class member variable initialization

This commit is contained in:
Milan Burda 2018-05-22 00:18:38 +02:00
parent ee57c95aa6
commit 2337237d58
94 changed files with 218 additions and 377 deletions

View file

@ -51,8 +51,7 @@ namespace api {
BrowserView::BrowserView(v8::Isolate* isolate,
v8::Local<v8::Object> wrapper,
const mate::Dictionary& options)
: api_web_contents_(nullptr) {
const mate::Dictionary& options) {
Init(isolate, wrapper, options);
}

View file

@ -59,7 +59,7 @@ class BrowserView : public mate::TrackableObject<BrowserView> {
v8::Local<v8::Value> GetWebContents();
v8::Global<v8::Value> web_contents_;
class WebContents* api_web_contents_;
class WebContents* api_web_contents_ = nullptr;
std::unique_ptr<NativeBrowserView> view_;

View file

@ -26,7 +26,7 @@ namespace atom {
namespace api {
Debugger::Debugger(v8::Isolate* isolate, content::WebContents* web_contents)
: web_contents_(web_contents), previous_request_id_(0) {
: web_contents_(web_contents) {
Init(isolate);
}

View file

@ -63,7 +63,7 @@ class Debugger : public mate::TrackableObject<Debugger>,
scoped_refptr<content::DevToolsAgentHost> agent_host_;
PendingRequestMap pending_requests_;
int previous_request_id_;
int previous_request_id_ = 0;
DISALLOW_COPY_AND_ASSIGN(Debugger);
};

View file

@ -20,7 +20,7 @@ namespace atom {
namespace api {
Menu::Menu(v8::Isolate* isolate, v8::Local<v8::Object> wrapper)
: model_(new AtomMenuModel(this)), parent_(nullptr) {
: model_(new AtomMenuModel(this)) {
InitWith(isolate, wrapper);
model_->AddObserver(this);
}

View file

@ -62,7 +62,7 @@ class Menu : public mate::TrackableObject<Menu>,
virtual void ClosePopupAt(int32_t window_id) = 0;
std::unique_ptr<AtomMenuModel> model_;
Menu* parent_;
Menu* parent_ = nullptr;
// Observable:
void OnMenuWillClose() override;

View file

@ -336,13 +336,7 @@ struct WebContents::FrameDispatchHelper {
WebContents::WebContents(v8::Isolate* isolate,
content::WebContents* web_contents,
Type type)
: content::WebContentsObserver(web_contents),
embedder_(nullptr),
zoom_controller_(nullptr),
type_(type),
request_id_(0),
background_throttling_(true),
enable_devtools_(true) {
: content::WebContentsObserver(web_contents), type_(type) {
const mate::Dictionary options = mate::Dictionary::CreateEmpty(isolate);
if (type == REMOTE) {
web_contents->SetUserAgentOverride(GetBrowserContext()->GetUserAgent());
@ -356,13 +350,8 @@ WebContents::WebContents(v8::Isolate* isolate,
}
}
WebContents::WebContents(v8::Isolate* isolate, const mate::Dictionary& options)
: embedder_(nullptr),
zoom_controller_(nullptr),
type_(BROWSER_WINDOW),
request_id_(0),
background_throttling_(true),
enable_devtools_(true) {
WebContents::WebContents(v8::Isolate* isolate,
const mate::Dictionary& options) {
// Read options.
options.Get("backgroundThrottling", &background_throttling_);

View file

@ -437,22 +437,22 @@ class WebContents : public mate::TrackableObject<WebContents>,
std::unique_ptr<WebViewGuestDelegate> guest_delegate_;
// The host webcontents that may contain this webcontents.
WebContents* embedder_;
WebContents* embedder_ = nullptr;
// The zoom controller for this webContents.
WebContentsZoomController* zoom_controller_;
WebContentsZoomController* zoom_controller_ = nullptr;
// The type of current WebContents.
Type type_;
Type type_ = BROWSER_WINDOW;
// Request id used for findInPage request.
uint32_t request_id_;
uint32_t request_id_ = 0;
// Whether background throttling is disabled.
bool background_throttling_;
bool background_throttling_ = true;
// Whether to enable devtools.
bool enable_devtools_;
bool enable_devtools_ = true;
// Observers of this WebContents.
base::ObserverList<ExtendedWebContentsObserver> observers_;

View file

@ -12,7 +12,7 @@
namespace mate {
Event::Event(v8::Isolate* isolate) : sender_(nullptr), message_(nullptr) {
Event::Event(v8::Isolate* isolate) {
Init(isolate);
}

View file

@ -44,8 +44,8 @@ class Event : public Wrappable<Event>, public content::WebContentsObserver {
private:
// Replyer for the synchronous messages.
content::RenderFrameHost* sender_;
IPC::Message* message_;
content::RenderFrameHost* sender_ = nullptr;
IPC::Message* message_ = nullptr;
DISALLOW_COPY_AND_ASSIGN(Event);
};

View file

@ -28,8 +28,7 @@ class IDUserData : public base::SupportsUserData::Data {
} // namespace
TrackableObjectBase::TrackableObjectBase()
: weak_map_id_(0), weak_factory_(this) {
TrackableObjectBase::TrackableObjectBase() : weak_factory_(this) {
atom::AtomBrowserMainParts::Get()->RegisterDestructionCallback(
GetDestroyClosure());
}
@ -54,8 +53,8 @@ void TrackableObjectBase::AttachAsUserData(base::SupportsUserData* wrapped) {
int32_t TrackableObjectBase::GetIDFromWrappedClass(
base::SupportsUserData* wrapped) {
if (wrapped) {
auto* id = static_cast<IDUserData*>(
wrapped->GetUserData(kTrackedObjectKey));
auto* id =
static_cast<IDUserData*>(wrapped->GetUserData(kTrackedObjectKey));
if (id)
return *id;
}

View file

@ -39,7 +39,7 @@ class TrackableObjectBase {
// Returns a closure that can destroy the native class.
base::OnceClosure GetDestroyClosure();
int32_t weak_map_id_;
int32_t weak_map_id_ = 0;
private:
void Destroy();

View file

@ -88,7 +88,7 @@ void AtomBrowserClient::SetCustomServiceWorkerSchemes(
g_custom_service_worker_schemes = base::JoinString(schemes, ",");
}
AtomBrowserClient::AtomBrowserClient() : delegate_(nullptr) {}
AtomBrowserClient::AtomBrowserClient() {}
AtomBrowserClient::~AtomBrowserClient() {}

View file

@ -147,7 +147,7 @@ class AtomBrowserClient : public brightray::BrowserClient,
std::unique_ptr<AtomResourceDispatcherHostDelegate>
resource_dispatcher_host_delegate_;
Delegate* delegate_;
Delegate* delegate_ = nullptr;
DISALLOW_COPY_AND_ASSIGN(AtomBrowserClient);
};

View file

@ -76,7 +76,6 @@ AtomBrowserMainParts* AtomBrowserMainParts::self_ = nullptr;
AtomBrowserMainParts::AtomBrowserMainParts()
: fake_browser_process_(new BrowserProcess),
exit_code_(nullptr),
browser_(new Browser),
node_bindings_(NodeBindings::Create(NodeBindings::BROWSER)),
atom_bindings_(new AtomBindings(uv_default_loop())),

View file

@ -94,7 +94,7 @@ class AtomBrowserMainParts : public brightray::BrowserMainParts {
scoped_refptr<BridgeTaskRunner> bridge_task_runner_;
// Pointer to exit code.
int* exit_code_;
int* exit_code_ = nullptr;
std::unique_ptr<Browser> browser_;
std::unique_ptr<JavascriptEnvironment> js_env_;

View file

@ -23,14 +23,10 @@ namespace atom {
Browser::LoginItemSettings::LoginItemSettings() = default;
Browser::LoginItemSettings::~LoginItemSettings() = default;
Browser::LoginItemSettings::LoginItemSettings(
const LoginItemSettings& other) = default;
Browser::LoginItemSettings::LoginItemSettings(const LoginItemSettings& other) =
default;
Browser::Browser()
: is_quiting_(false),
is_exiting_(false),
is_ready_(false),
is_shutdown_(false) {
Browser::Browser() {
WindowList::AddObserver(this);
}

View file

@ -254,7 +254,7 @@ class Browser : public WindowListObserver {
// Send the before-quit message and start closing windows.
bool HandleBeforeQuit();
bool is_quiting_;
bool is_quiting_ = false;
private:
// WindowListObserver implementations:
@ -265,13 +265,13 @@ class Browser : public WindowListObserver {
base::ObserverList<BrowserObserver> observers_;
// Whether `app.exit()` has been called
bool is_exiting_;
bool is_exiting_ = false;
// Whether "ready" event has been emitted.
bool is_ready_;
bool is_ready_ = false;
// The browser is being shutdown.
bool is_shutdown_;
bool is_shutdown_ = false;
int badge_count_ = 0;

View file

@ -141,11 +141,7 @@ bool IsDevToolsFileSystemAdded(content::WebContents* web_contents,
} // namespace
CommonWebContentsDelegate::CommonWebContentsDelegate()
: offscreen_(false),
ignore_menu_shortcuts_(false),
html_fullscreen_(false),
native_fullscreen_(false),
devtools_file_system_indexer_(new DevToolsFileSystemIndexer) {}
: devtools_file_system_indexer_(new DevToolsFileSystemIndexer) {}
CommonWebContentsDelegate::~CommonWebContentsDelegate() {}

View file

@ -155,14 +155,14 @@ class CommonWebContentsDelegate
// The window that this WebContents belongs to.
base::WeakPtr<NativeWindow> owner_window_;
bool offscreen_;
bool ignore_menu_shortcuts_;
bool offscreen_ = false;
bool ignore_menu_shortcuts_ = false;
// Whether window is fullscreened by HTML5 api.
bool html_fullscreen_;
bool html_fullscreen_ = false;
// Whether window is fullscreened by window api.
bool native_fullscreen_;
bool native_fullscreen_ = false;
// UI related helper classes.
#if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX)

View file

@ -42,9 +42,7 @@ void OnDeviceChosen(const content::BluetoothChooser::EventHandler& handler,
BluetoothChooser::BluetoothChooser(api::WebContents* contents,
const EventHandler& event_handler)
: api_web_contents_(contents),
event_handler_(event_handler),
num_retries_(0) {}
: api_web_contents_(contents), event_handler_(event_handler) {}
BluetoothChooser::~BluetoothChooser() {}

View file

@ -39,7 +39,7 @@ class BluetoothChooser : public content::BluetoothChooser {
std::vector<DeviceInfo> device_list_;
api::WebContents* api_web_contents_;
EventHandler event_handler_;
int num_retries_;
int num_retries_ = 0;
DISALLOW_COPY_AND_ASSIGN(BluetoothChooser);
};

View file

@ -32,11 +32,7 @@ void ResetLoginHandlerForRequest(net::URLRequest* request) {
LoginHandler::LoginHandler(net::AuthChallengeInfo* auth_info,
net::URLRequest* request)
: handled_auth_(false),
auth_info_(auth_info),
request_(request),
render_process_host_id_(0),
render_frame_id_(0) {
: auth_info_(auth_info), request_(request) {
content::ResourceRequestInfo::ForRequest(request_)->GetAssociatedRenderFrame(
&render_process_host_id_, &render_frame_id_);

View file

@ -53,7 +53,7 @@ class LoginHandler : public content::ResourceDispatcherHostLoginDelegate {
bool TestAndSetAuthHandled();
// True if we've handled auth (Login or CancelAuth has been called).
bool handled_auth_;
bool handled_auth_ = false;
mutable base::Lock handled_auth_lock_;
// Who/where/what asked for the authentication.
@ -61,11 +61,11 @@ class LoginHandler : public content::ResourceDispatcherHostLoginDelegate {
// The request that wants login data.
// This should only be accessed on the IO loop.
net::URLRequest* request_;
net::URLRequest* request_ = nullptr;
// Cached from the net::URLRequest, in case it goes NULL on us.
int render_process_host_id_;
int render_frame_id_;
int render_process_host_id_ = 0;
int render_frame_id_ = 0;
DISALLOW_COPY_AND_ASSIGN(LoginHandler);
};

View file

@ -47,19 +47,7 @@ gfx::Size GetExpandedWindowSize(const NativeWindow* window, gfx::Size size) {
NativeWindow::NativeWindow(const mate::Dictionary& options,
NativeWindow* parent)
: widget_(new views::Widget),
content_view_(nullptr),
has_frame_(true),
transparent_(false),
enable_larger_than_screen_(false),
is_closed_(false),
sheet_offset_x_(0.0),
sheet_offset_y_(0.0),
aspect_ratio_(0.0),
parent_(parent),
is_modal_(false),
browser_view_(nullptr),
weak_factory_(this) {
: widget_(new views::Widget), parent_(parent), weak_factory_(this) {
options.Get(options::kFrame, &has_frame_);
options.Get(options::kTransparent, &transparent_);
options.Get(options::kEnableLargerThanScreen, &enable_larger_than_screen_);

View file

@ -287,41 +287,41 @@ class NativeWindow : public base::SupportsUserData,
std::unique_ptr<views::Widget> widget_;
// The content view, weak ref.
views::View* content_view_;
views::View* content_view_ = nullptr;
// Whether window has standard frame.
bool has_frame_;
bool has_frame_ = true;
// Whether window is transparent.
bool transparent_;
bool transparent_ = false;
// Minimum and maximum size, stored as content size.
extensions::SizeConstraints size_constraints_;
// Whether window can be resized larger than screen.
bool enable_larger_than_screen_;
bool enable_larger_than_screen_ = false;
// The windows has been closed.
bool is_closed_;
bool is_closed_ = false;
// Used to display sheets at the appropriate horizontal and vertical offsets
// on macOS.
double sheet_offset_x_;
double sheet_offset_y_;
double sheet_offset_x_ = 0.0;
double sheet_offset_y_ = 0.0;
// Used to maintain the aspect ratio of a view which is inside of the
// content view.
double aspect_ratio_;
double aspect_ratio_ = 0.0;
gfx::Size aspect_ratio_extraSize_;
// The parent window, it is guaranteed to be valid during this window's life.
NativeWindow* parent_;
NativeWindow* parent_ = nullptr;
// Is this a modal window.
bool is_modal_;
bool is_modal_ = false;
// The browser view layer.
NativeBrowserView* browser_view_;
NativeBrowserView* browser_view_ = nullptr;
// Observers of this window.
base::ObserverList<NativeWindowObserver> observers_;

View file

@ -173,30 +173,30 @@ class NativeWindowMac : public NativeWindow {
// The view that fills the client area.
std::unique_ptr<RootViewMac> root_view_;
bool is_kiosk_;
bool was_fullscreen_;
bool zoom_to_page_width_;
bool fullscreen_window_title_;
bool resizable_;
bool is_kiosk_ = false;
bool was_fullscreen_ = false;
bool zoom_to_page_width_ = false;
bool fullscreen_window_title_ = false;
bool resizable_ = true;
NSInteger attention_request_id_; // identifier from requestUserAttention
NSInteger attention_request_id_ = 0; // identifier from requestUserAttention
// The presentation options before entering kiosk mode.
NSApplicationPresentationOptions kiosk_options_;
// The "titleBarStyle" option.
TitleBarStyle title_bar_style_;
TitleBarStyle title_bar_style_ = NORMAL;
// Simple (pre-Lion) Fullscreen Settings
bool always_simple_fullscreen_;
bool is_simple_fullscreen_;
bool was_maximizable_;
bool was_movable_;
bool always_simple_fullscreen_ = false;
bool is_simple_fullscreen_ = false;
bool was_maximizable_ = false;
bool was_movable_ = false;
NSRect original_frame_;
NSUInteger simple_fullscreen_mask_;
base::scoped_nsobject<NSColor> background_color_before_vibrancy_;
bool transparency_before_vibrancy_;
bool transparency_before_vibrancy_ = false;
// The presentation options before entering simple fullscreen mode.
NSApplicationPresentationOptions simple_fullscreen_options_;

View file

@ -255,17 +255,7 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) {
NativeWindowMac::NativeWindowMac(const mate::Dictionary& options,
NativeWindow* parent)
: NativeWindow(options, parent),
root_view_(new RootViewMac(this)),
is_kiosk_(false),
was_fullscreen_(false),
zoom_to_page_width_(false),
fullscreen_window_title_(false),
resizable_(true),
attention_request_id_(0),
title_bar_style_(NORMAL),
always_simple_fullscreen_(false),
is_simple_fullscreen_(false) {
: NativeWindow(options, parent), root_view_(new RootViewMac(this)) {
int width = 800, height = 600;
options.Get(options::kWidth, &width);
options.Get(options::kHeight, &height);

View file

@ -102,19 +102,7 @@ NativeWindowViews::NativeWindowViews(const mate::Dictionary& options,
NativeWindow* parent)
: NativeWindow(options, parent),
root_view_(new RootView(this)),
focused_view_(nullptr),
#if defined(OS_WIN)
checked_for_a11y_support_(false),
thick_frame_(true),
#endif
keyboard_event_handler_(new views::UnhandledKeyboardEventHandler),
disable_count_(0),
use_content_size_(false),
movable_(true),
resizable_(true),
maximizable_(true),
minimizable_(true),
fullscreenable_(true) {
keyboard_event_handler_(new views::UnhandledKeyboardEventHandler) {
options.Get(options::kTitle, &title_);
bool menu_bar_autohide;

View file

@ -196,7 +196,8 @@ class NativeWindowViews : public NativeWindow,
std::unique_ptr<RootView> root_view_;
views::View* focused_view_; // The view should be focused by default.
// The view should be focused by default.
views::View* focused_view_ = nullptr;
// The "resizable" flag on Linux is implemented by setting size constraints,
// we need to make sure size constraints are restored when window becomes
@ -241,10 +242,10 @@ class NativeWindowViews : public NativeWindow,
TaskbarHost taskbar_host_;
// Memoized version of a11y check
bool checked_for_a11y_support_;
bool checked_for_a11y_support_ = false;
// Whether to show the WS_THICKFRAME style.
bool thick_frame_;
bool thick_frame_ = true;
// The bounds of window before maximize/fullscreen.
gfx::Rect restore_bounds_;
@ -269,14 +270,14 @@ class NativeWindowViews : public NativeWindow,
std::unique_ptr<SkRegion> draggable_region_; // used in custom drag.
// How many times the Disable has been called.
int disable_count_;
int disable_count_ = 0;
bool use_content_size_;
bool movable_;
bool resizable_;
bool maximizable_;
bool minimizable_;
bool fullscreenable_;
bool use_content_size_ = false;
bool movable_ = true;
bool resizable_ = true;
bool maximizable_ = true;
bool minimizable_ = true;
bool fullscreenable_ = true;
std::string title_;
gfx::Size widget_size_;
double opacity_ = 1.0;

View file

@ -32,20 +32,9 @@
namespace asar {
URLRequestAsarJob::FileMetaInfo::FileMetaInfo()
: file_size(0),
mime_type_result(false),
file_exists(false),
is_directory(false) {}
URLRequestAsarJob::URLRequestAsarJob(net::URLRequest* request,
net::NetworkDelegate* network_delegate)
: net::URLRequestJob(request, network_delegate),
type_(TYPE_ERROR),
remaining_bytes_(0),
seek_offset_(0),
range_parse_result_(net::OK),
weak_ptr_factory_(this) {}
: net::URLRequestJob(request, network_delegate), weak_ptr_factory_(this) {}
URLRequestAsarJob::~URLRequestAsarJob() {}

View file

@ -74,19 +74,17 @@ class URLRequestAsarJob : public net::URLRequestJob {
// URLRequestFileJob and also passed between threads because disk access is
// necessary to obtain it.
struct FileMetaInfo {
FileMetaInfo();
// Size of the file.
int64_t file_size;
int64_t file_size = 0;
// Mime type associated with the file.
std::string mime_type;
// Result returned from GetMimeTypeFromFile(), i.e. flag showing whether
// obtaining of the mime type was successful.
bool mime_type_result;
bool mime_type_result = false;
// Flag showing whether the file exists.
bool file_exists;
bool file_exists = false;
// Flag showing whether the file name actually refers to a directory.
bool is_directory;
bool is_directory = false;
// Path to the file.
base::FilePath file_path;
};
@ -109,7 +107,7 @@ class URLRequestAsarJob : public net::URLRequestJob {
// Callback after data is asynchronously read from the file into |buf|.
void DidRead(scoped_refptr<net::IOBuffer> buf, int result);
JobType type_;
JobType type_ = TYPE_ERROR;
std::shared_ptr<Archive> archive_;
base::FilePath file_path_;
@ -120,10 +118,10 @@ class URLRequestAsarJob : public net::URLRequestJob {
scoped_refptr<base::TaskRunner> file_task_runner_;
net::HttpByteRange byte_range_;
int64_t remaining_bytes_;
int64_t seek_offset_;
int64_t remaining_bytes_ = 0;
int64_t seek_offset_ = 0;
net::Error range_parse_result_;
net::Error range_parse_result_ = net::OK;
base::WeakPtrFactory<URLRequestAsarJob> weak_ptr_factory_;

View file

@ -48,9 +48,6 @@ class CertVerifierRequest : public AtomCertVerifier::Request {
AtomCertVerifier* cert_verifier)
: params_(params),
cert_verifier_(cert_verifier),
error_(net::ERR_IO_PENDING),
custom_response_(net::ERR_IO_PENDING),
first_response_(true),
weak_ptr_factory_(this) {}
~CertVerifierRequest() override {
@ -142,9 +139,9 @@ class CertVerifierRequest : public AtomCertVerifier::Request {
const AtomCertVerifier::RequestParams params_;
AtomCertVerifier* cert_verifier_;
int error_;
int custom_response_;
bool first_response_;
int error_ = net::ERR_IO_PENDING;
int custom_response_ = net::ERR_IO_PENDING;
bool first_response_ = true;
ResponseList response_list_;
net::CertVerifyResult result_;
std::unique_ptr<AtomCertVerifier::Request> default_verifier_request_;

View file

@ -48,7 +48,6 @@ class UploadOwnedIOBufferElementReader : public net::UploadBytesElementReader {
AtomURLRequest::AtomURLRequest(api::URLRequest* delegate)
: delegate_(delegate),
is_chunked_upload_(false),
response_read_buffer_(new net::IOBuffer(kBufferSize)) {}
AtomURLRequest::~AtomURLRequest() {

View file

@ -103,7 +103,7 @@ class AtomURLRequest : public base::RefCountedThreadSafe<AtomURLRequest>,
std::unique_ptr<net::URLRequest> request_;
scoped_refptr<net::URLRequestContextGetter> request_context_getter_;
bool is_chunked_upload_;
bool is_chunked_upload_ = false;
std::string redirect_policy_;
std::unique_ptr<net::ChunkedUploadDataStream> chunked_stream_;
std::unique_ptr<net::ChunkedUploadDataStream::Writer> chunked_stream_writer_;

View file

@ -46,8 +46,7 @@ net::URLFetcher::RequestType GetRequestType(const std::string& raw) {
// Pipe the response writer back to URLRequestFetchJob.
class ResponsePiper : public net::URLFetcherResponseWriter {
public:
explicit ResponsePiper(URLRequestFetchJob* job)
: first_write_(true), job_(job) {}
explicit ResponsePiper(URLRequestFetchJob* job) : job_(job) {}
// net::URLFetcherResponseWriter:
int Initialize(const net::CompletionCallback& callback) override {
@ -69,7 +68,7 @@ class ResponsePiper : public net::URLFetcherResponseWriter {
}
private:
bool first_write_;
bool first_write_ = true;
URLRequestFetchJob* job_;
DISALLOW_COPY_AND_ASSIGN(ResponsePiper);
@ -79,9 +78,7 @@ class ResponsePiper : public net::URLFetcherResponseWriter {
URLRequestFetchJob::URLRequestFetchJob(net::URLRequest* request,
net::NetworkDelegate* network_delegate)
: JsAsker<net::URLRequestJob>(request, network_delegate),
pending_buffer_size_(0),
write_num_bytes_(0) {}
: JsAsker<net::URLRequestJob>(request, network_delegate) {}
URLRequestFetchJob::~URLRequestFetchJob() = default;

View file

@ -57,11 +57,11 @@ class URLRequestFetchJob : public JsAsker<net::URLRequestJob>,
// Saved arguments passed to ReadRawData.
scoped_refptr<net::IOBuffer> pending_buffer_;
int pending_buffer_size_;
int pending_buffer_size_ = 0;
// Saved arguments passed to DataAvailable.
scoped_refptr<net::IOBuffer> write_buffer_;
int write_num_bytes_;
int write_num_bytes_ = 0;
net::CompletionCallback write_callback_;
DISALLOW_COPY_AND_ASSIGN(URLRequestFetchJob);

View file

@ -21,11 +21,6 @@ namespace atom {
URLRequestStreamJob::URLRequestStreamJob(net::URLRequest* request,
net::NetworkDelegate* network_delegate)
: JsAsker<net::URLRequestJob>(request, network_delegate),
ended_(false),
errored_(false),
pending_io_buf_(nullptr),
pending_io_buf_size_(0),
response_headers_(nullptr),
weak_factory_(this) {}
URLRequestStreamJob::~URLRequestStreamJob() = default;

View file

@ -52,10 +52,10 @@ class URLRequestStreamJob : public JsAsker<net::URLRequestJob> {
void CopyMoreDataDone(scoped_refptr<net::IOBuffer> io_buf, int read_count);
std::deque<char> buffer_;
bool ended_;
bool errored_;
bool ended_ = false;
bool errored_ = false;
scoped_refptr<net::IOBuffer> pending_io_buf_;
int pending_io_buf_size_;
int pending_io_buf_size_ = 0;
scoped_refptr<net::HttpResponseHeaders> response_headers_;
mate::EventSubscriber<URLRequestStreamJob>::SafePtr subscriber_;
base::WeakPtrFactory<URLRequestStreamJob> weak_factory_;

View file

@ -13,7 +13,7 @@ namespace atom {
OffScreenOutputDevice::OffScreenOutputDevice(bool transparent,
const OnPaintCallback& callback)
: transparent_(transparent), callback_(callback), active_(false) {
: transparent_(transparent), callback_(callback) {
DCHECK(!callback_.is_null());
}

View file

@ -31,7 +31,7 @@ class OffScreenOutputDevice : public viz::SoftwareOutputDevice {
const bool transparent_;
OnPaintCallback callback_;
bool active_;
bool active_ = false;
std::unique_ptr<SkCanvas> canvas_;
std::unique_ptr<SkBitmap> bitmap_;

View file

@ -117,8 +117,6 @@ class AtomCopyFrameGenerator {
AtomCopyFrameGenerator(OffScreenRenderWidgetHostView* view,
int frame_rate_threshold_us)
: view_(view),
frame_retry_count_(0),
next_frame_time_(base::TimeTicks::Now()),
frame_duration_(
base::TimeDelta::FromMicroseconds(frame_rate_threshold_us)),
weak_ptr_factory_(this) {
@ -204,8 +202,8 @@ class AtomCopyFrameGenerator {
base::Time last_time_;
int frame_retry_count_;
base::TimeTicks next_frame_time_;
int frame_retry_count_ = 0;
base::TimeTicks next_frame_time_ = base::TimeTicks::Now();
base::TimeDelta frame_duration_;
base::WeakPtrFactory<AtomCopyFrameGenerator> weak_ptr_factory_;
@ -257,27 +255,14 @@ OffScreenRenderWidgetHostView::OffScreenRenderWidgetHostView(
NativeWindow* native_window)
: render_widget_host_(content::RenderWidgetHostImpl::From(host)),
parent_host_view_(parent_host_view),
popup_host_view_(nullptr),
child_host_view_(nullptr),
native_window_(native_window),
software_output_device_(nullptr),
transparent_(transparent),
callback_(callback),
parent_callback_(nullptr),
frame_rate_(frame_rate),
frame_rate_threshold_us_(0),
last_time_(base::Time::Now()),
scale_factor_(kDefaultScaleFactor),
size_(native_window->GetSize()),
painting_(painting),
is_showing_(!render_widget_host_->is_hidden()),
is_destroyed_(false),
popup_position_(gfx::Rect()),
hold_resize_(false),
pending_resize_(false),
paint_callback_running_(false),
renderer_compositor_frame_sink_(nullptr),
background_color_(SkColor()),
weak_ptr_factory_(this) {
DCHECK(render_widget_host_);
bool is_guest_view_hack = parent_host_view_ != nullptr;

View file

@ -285,38 +285,38 @@ class OffScreenRenderWidgetHostView
// Weak ptrs.
content::RenderWidgetHostImpl* render_widget_host_;
OffScreenRenderWidgetHostView* parent_host_view_;
OffScreenRenderWidgetHostView* popup_host_view_;
OffScreenRenderWidgetHostView* parent_host_view_ = nullptr;
OffScreenRenderWidgetHostView* popup_host_view_ = nullptr;
std::unique_ptr<SkBitmap> popup_bitmap_;
OffScreenRenderWidgetHostView* child_host_view_;
OffScreenRenderWidgetHostView* child_host_view_ = nullptr;
std::set<OffScreenRenderWidgetHostView*> guest_host_views_;
std::set<OffscreenViewProxy*> proxy_views_;
NativeWindow* native_window_;
OffScreenOutputDevice* software_output_device_;
OffScreenOutputDevice* software_output_device_ = nullptr;
const bool transparent_;
OnPaintCallback callback_;
OnPaintCallback parent_callback_;
int frame_rate_;
int frame_rate_threshold_us_;
int frame_rate_ = 0;
int frame_rate_threshold_us_ = 0;
base::Time last_time_;
base::Time last_time_ = base::Time::Now();
float scale_factor_;
gfx::Vector2dF last_scroll_offset_;
gfx::Size size_;
bool painting_;
bool is_showing_;
bool is_destroyed_;
bool is_showing_ = false;
bool is_destroyed_ = false;
gfx::Rect popup_position_;
bool hold_resize_;
bool pending_resize_;
bool hold_resize_ = false;
bool pending_resize_ = false;
bool paint_callback_running_;
bool paint_callback_running_ = false;
viz::LocalSurfaceId local_surface_id_;
viz::LocalSurfaceIdAllocator local_surface_id_allocator_;
@ -344,9 +344,10 @@ class OffScreenRenderWidgetHostView
std::string selected_text_;
#endif
viz::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink_;
viz::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink_ =
nullptr;
SkColor background_color_;
SkColor background_color_ = SkColor();
base::WeakPtrFactory<OffScreenRenderWidgetHostView> weak_ptr_factory_;

View file

@ -6,8 +6,7 @@
namespace atom {
OffscreenViewProxy::OffscreenViewProxy(views::View* view)
: view_(view), observer_(nullptr) {
OffscreenViewProxy::OffscreenViewProxy(views::View* view) : view_(view) {
view_bitmap_.reset(new SkBitmap);
}

View file

@ -46,7 +46,7 @@ class OffscreenViewProxy {
gfx::Rect view_bounds_;
std::unique_ptr<SkBitmap> view_bitmap_;
OffscreenViewProxyObserver* observer_;
OffscreenViewProxyObserver* observer_ = nullptr;
};
} // namespace atom

View file

@ -15,11 +15,7 @@ namespace atom {
OffScreenWebContentsView::OffScreenWebContentsView(
bool transparent,
const OnPaintCallback& callback)
: transparent_(transparent),
painting_(true),
frame_rate_(60),
callback_(callback),
web_contents_(nullptr) {
: transparent_(transparent), callback_(callback) {
#if defined(OS_MACOSX)
PlatformCreate();
#endif

View file

@ -83,12 +83,12 @@ class OffScreenWebContentsView : public content::WebContentsView,
OffScreenRenderWidgetHostView* GetView() const;
const bool transparent_;
bool painting_;
int frame_rate_;
bool painting_ = true;
int frame_rate_ = 60;
OnPaintCallback callback_;
// Weak refs.
content::WebContents* web_contents_;
content::WebContents* web_contents_ = nullptr;
#if defined(OS_MACOSX)
OffScreenView* offScreenView_;

View file

@ -12,7 +12,7 @@
namespace atom {
RenderProcessPreferences::RenderProcessPreferences(const Predicate& predicate)
: predicate_(predicate), next_id_(0), cache_needs_update_(true) {
: predicate_(predicate) {
registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CREATED,
content::NotificationService::AllBrowserContextsAndSources());
}

View file

@ -45,12 +45,12 @@ class RenderProcessPreferences : public content::NotificationObserver {
Predicate predicate_;
int next_id_;
int next_id_ = 0;
std::unordered_map<int, std::unique_ptr<base::DictionaryValue>> entries_;
// We need to convert the |entries_| to ListValue for multiple times, this
// caches is only updated when we are sending messages.
bool cache_needs_update_;
bool cache_needs_update_ = true;
base::ListValue cached_entries_;
DISALLOW_COPY_AND_ASSIGN(RenderProcessPreferences);

View file

@ -42,7 +42,6 @@ class GtkMessageBox : public NativeWindowObserver {
const std::string& checkbox_label,
bool checkbox_checked)
: cancel_id_(cancel_id),
checkbox_checked_(false),
parent_(static_cast<NativeWindow*>(parent_window)) {
// Create dialog.
dialog_ =
@ -160,9 +159,9 @@ class GtkMessageBox : public NativeWindowObserver {
atom::UnresponsiveSuppressor unresponsive_suppressor_;
// The id to return when the dialog is closed without pressing buttons.
int cancel_id_;
int cancel_id_ = 0;
bool checkbox_checked_;
bool checkbox_checked_ = false;
NativeWindow* parent_;
GtkWidget* dialog_;

View file

@ -46,7 +46,7 @@ class TrayIconCocoa : public TrayIcon, public AtomMenuModel::Observer {
base::scoped_nsobject<AtomMenuController> menu_;
// Used for unregistering observer.
AtomMenuModel* menu_model_; // weak ref.
AtomMenuModel* menu_model_ = nullptr; // weak ref.
DISALLOW_COPY_AND_ASSIGN(TrayIconCocoa);
};

View file

@ -291,7 +291,8 @@ const CGFloat kVerticalTitleMargin = 2;
// If we are ignoring double click events, we should ignore the `clickCount`
// value and immediately emit a click event.
BOOL shouldBeHandledAsASingleClick = (event.clickCount == 1) || ignoreDoubleClickEvents_;
BOOL shouldBeHandledAsASingleClick =
(event.clickCount == 1) || ignoreDoubleClickEvents_;
if (shouldBeHandledAsASingleClick)
trayIcon_->NotifyClicked(
gfx::ScreenRectFromNSRect(event.window.frame),
@ -299,7 +300,8 @@ const CGFloat kVerticalTitleMargin = 2;
ui::EventFlagsFromModifiers([event modifierFlags]));
// Double click event.
BOOL shouldBeHandledAsADoubleClick = (event.clickCount == 2) && !ignoreDoubleClickEvents_;
BOOL shouldBeHandledAsADoubleClick =
(event.clickCount == 2) && !ignoreDoubleClickEvents_;
if (shouldBeHandledAsADoubleClick)
trayIcon_->NotifyDoubleClicked(
gfx::ScreenRectFromNSRect(event.window.frame),
@ -417,7 +419,7 @@ const CGFloat kVerticalTitleMargin = 2;
namespace atom {
TrayIconCocoa::TrayIconCocoa() : menu_model_(nullptr) {}
TrayIconCocoa::TrayIconCocoa() {}
TrayIconCocoa::~TrayIconCocoa() {
[status_item_view_ removeItem];

View file

@ -25,12 +25,7 @@ void AutofillPopupChildView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
AutofillPopupView::AutofillPopupView(AutofillPopup* popup,
views::Widget* parent_widget)
: popup_(popup),
parent_widget_(parent_widget),
#if defined(ENABLE_OSR)
view_proxy_(nullptr),
#endif
weak_ptr_factory_(this) {
: popup_(popup), parent_widget_(parent_widget), weak_ptr_factory_(this) {
CreateChildViews();
SetFocusBehavior(FocusBehavior::ALWAYS);
set_drag_controller(this);

View file

@ -22,7 +22,7 @@ const int kResizeAreaCornerSize = 16;
// static
const char FramelessView::kViewClassName[] = "FramelessView";
FramelessView::FramelessView() : window_(NULL), frame_(NULL) {}
FramelessView::FramelessView() {}
FramelessView::~FramelessView() {}

View file

@ -45,8 +45,8 @@ class FramelessView : public views::NonClientFrameView {
const char* GetClassName() const override;
// Not owned.
NativeWindowViews* window_;
views::Widget* frame_;
NativeWindowViews* window_ = nullptr;
views::Widget* frame_ = nullptr;
private:
DISALLOW_COPY_AND_ASSIGN(FramelessView);

View file

@ -181,8 +181,7 @@ std::string GetMenuModelStatus(AtomMenuModel* model) {
GlobalMenuBarX11::GlobalMenuBarX11(NativeWindowViews* window)
: window_(window),
xid_(window_->GetNativeWindow()->GetHost()->GetAcceleratedWidget()),
server_(NULL) {
xid_(window_->GetNativeWindow()->GetHost()->GetAcceleratedWidget()) {
EnsureMethodsLoaded();
if (server_new)
InitServer(xid_);

View file

@ -71,7 +71,7 @@ class GlobalMenuBarX11 {
NativeWindowViews* window_;
gfx::AcceleratedWidget xid_;
DbusmenuServer* server_;
DbusmenuServer* server_ = nullptr;
DISALLOW_COPY_AND_ASSIGN(GlobalMenuBarX11);
};

View file

@ -26,7 +26,7 @@ const SkColor kDefaultColor = SkColorSetARGB(255, 233, 233, 233);
const char MenuBar::kViewClassName[] = "ElectronMenuBar";
MenuBar::MenuBar(views::View* window)
: background_color_(kDefaultColor), window_(window), menu_model_(NULL) {
: background_color_(kDefaultColor), window_(window) {
RefreshColorCache();
UpdateViewColors();
SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal));

View file

@ -72,8 +72,8 @@ class MenuBar : public views::View,
SkColor disabled_color_;
#endif
views::View* window_;
AtomMenuModel* menu_model_;
views::View* window_ = nullptr;
AtomMenuModel* menu_model_ = nullptr;
View* FindAccelChild(base::char16 key);

View file

@ -22,13 +22,6 @@ SubmenuButton::SubmenuButton(const base::string16& title,
: views::MenuButton(gfx::RemoveAcceleratorChar(title, '&', NULL, NULL),
menu_button_listener,
false),
accelerator_(0),
show_underline_(false),
underline_start_(0),
underline_end_(0),
text_width_(0),
text_height_(0),
underline_color_(SK_ColorBLACK),
background_color_(background_color) {
#if defined(OS_LINUX)
// Dont' use native style border.

View file

@ -39,15 +39,15 @@ class SubmenuButton : public views::MenuButton {
int index,
int* pos) const;
base::char16 accelerator_;
base::char16 accelerator_ = 0;
bool show_underline_;
bool show_underline_ = false;
int underline_start_;
int underline_end_;
int text_width_;
int text_height_;
SkColor underline_color_;
int underline_start_ = 0;
int underline_end_ = 0;
int text_width_ = 0;
int text_height_ = 0;
SkColor underline_color_ = SK_ColorBLACK;
SkColor background_color_;
DISALLOW_COPY_AND_ASSIGN(SubmenuButton);

View file

@ -56,7 +56,7 @@ void PopulateStreamInfo(base::DictionaryValue* stream_info,
} // namespace
PdfViewerHandler::PdfViewerHandler(const std::string& src)
: stream_(nullptr), original_url_(src) {}
: original_url_(src) {}
PdfViewerHandler::~PdfViewerHandler() {
RemoveObserver();

View file

@ -53,7 +53,7 @@ class PdfViewerHandler : public content::WebUIMessageHandler,
void AddObserver();
void RemoveObserver();
std::unique_ptr<base::Value> initialize_callback_id_;
content::StreamInfo* stream_;
content::StreamInfo* stream_ = nullptr;
std::string original_url_;
DISALLOW_COPY_AND_ASSIGN(PdfViewerHandler);

View file

@ -19,11 +19,7 @@
namespace atom {
NotifyIcon::NotifyIcon(NotifyIconHost* host, UINT id, HWND window, UINT message)
: host_(host),
icon_id_(id),
window_(window),
message_id_(message),
menu_model_(NULL) {
: host_(host), icon_id_(id), window_(window), message_id_(message) {
NOTIFYICONDATA icon_data;
InitIconData(&icon_data);
icon_data.uFlags |= NIF_MESSAGE;

View file

@ -79,7 +79,7 @@ class NotifyIcon : public TrayIcon {
base::win::ScopedHICON icon_;
// The context menu.
AtomMenuModel* menu_model_;
AtomMenuModel* menu_model_ = nullptr;
// Context menu associated with this icon (if any).
std::unique_ptr<views::MenuRunner> menu_runner_;

View file

@ -47,8 +47,7 @@ int GetKeyboardModifers() {
} // namespace
NotifyIconHost::NotifyIconHost()
: next_icon_id_(1), atom_(0), instance_(NULL), window_(NULL) {
NotifyIconHost::NotifyIconHost() {
// Register our window class
WNDCLASSEX window_class;
base::win::InitializeWindowClass(

View file

@ -40,23 +40,23 @@ class NotifyIconHost {
UINT NextIconId();
// The unique icon ID we will assign to the next icon.
UINT next_icon_id_;
UINT next_icon_id_ = 1;
// List containing all active NotifyIcons.
NotifyIcons notify_icons_;
// The window class of |window_|.
ATOM atom_;
ATOM atom_ = 0;
// The handle of the module that contains the window procedure of |window_|.
HMODULE instance_;
HMODULE instance_ = nullptr;
// The window used for processing events.
HWND window_;
HWND window_ = nullptr;
// The message ID of the "TaskbarCreated" message, sent to us when we need to
// reset our status icons.
UINT taskbar_created_message_;
UINT taskbar_created_message_ = 0;
DISALLOW_COPY_AND_ASSIGN(NotifyIconHost);
};

View file

@ -50,7 +50,7 @@ bool GetThumbarButtonFlags(const std::vector<std::string>& flags,
} // namespace
TaskbarHost::TaskbarHost() : thumbar_buttons_added_(false) {}
TaskbarHost::TaskbarHost() {}
TaskbarHost::~TaskbarHost() {}

View file

@ -69,7 +69,7 @@ class TaskbarHost {
base::win::ScopedComPtr<ITaskbarList3> taskbar_;
// Whether we have already added the buttons to thumbar.
bool thumbar_buttons_added_;
bool thumbar_buttons_added_ = false;
DISALLOW_COPY_AND_ASSIGN(TaskbarHost);
};

View file

@ -12,10 +12,7 @@
namespace atom {
WindowStateWatcher::WindowStateWatcher(NativeWindowViews* window)
: window_(window),
widget_(window->GetAcceleratedWidget()),
was_minimized_(false),
was_maximized_(false) {
: window_(window), widget_(window->GetAcceleratedWidget()) {
ui::PlatformEventSource::GetInstance()->AddPlatformEventObserver(this);
}

View file

@ -27,8 +27,8 @@ class WindowStateWatcher : public ui::PlatformEventObserver {
NativeWindowViews* window_;
gfx::AcceleratedWidget widget_;
bool was_minimized_;
bool was_maximized_;
bool was_minimized_ = false;
bool was_maximized_ = false;
DISALLOW_COPY_AND_ASSIGN(WindowStateWatcher);
};

View file

@ -21,12 +21,7 @@ namespace atom {
WebContentsZoomController::WebContentsZoomController(
content::WebContents* web_contents)
: content::WebContentsObserver(web_contents),
zoom_mode_(ZOOM_MODE_DEFAULT),
zoom_level_(1.0),
old_process_id_(-1),
old_view_id_(-1),
embedder_zoom_controller_(nullptr) {
: content::WebContentsObserver(web_contents) {
default_zoom_factor_ = content::kEpsilon;
host_zoom_map_ = content::HostZoomMap::GetForWebContents(web_contents);
}

View file

@ -93,19 +93,18 @@ class WebContentsZoomController
void SetZoomFactorOnNavigationIfNeeded(const GURL& url);
// The current zoom mode.
ZoomMode zoom_mode_;
ZoomMode zoom_mode_ = ZOOM_MODE_DEFAULT;
// Current zoom level.
double zoom_level_;
double zoom_level_ = 1.0;
// kZoomFactor.
double default_zoom_factor_;
double temporary_zoom_level_;
double default_zoom_factor_ = 0;
int old_process_id_;
int old_view_id_;
int old_process_id_ = -1;
int old_view_id_ = -1;
WebContentsZoomController* embedder_zoom_controller_;
WebContentsZoomController* embedder_zoom_controller_ = nullptr;
base::ObserverList<Observer> observers_;

View file

@ -26,13 +26,7 @@ const int kDefaultHeight = 300;
SetSizeParams::SetSizeParams() = default;
SetSizeParams::~SetSizeParams() = default;
WebViewGuestDelegate::WebViewGuestDelegate()
: embedder_zoom_controller_(nullptr),
guest_host_(nullptr),
auto_size_enabled_(false),
is_full_page_plugin_(false),
attached_(false),
api_web_contents_(nullptr) {}
WebViewGuestDelegate::WebViewGuestDelegate() {}
WebViewGuestDelegate::~WebViewGuestDelegate() {}

View file

@ -95,7 +95,7 @@ class WebViewGuestDelegate : public content::BrowserPluginGuestDelegate,
// The zoom controller of the embedder that is used
// to subscribe for zoom changes.
WebContentsZoomController* embedder_zoom_controller_;
WebContentsZoomController* embedder_zoom_controller_ = nullptr;
// The size of the container element.
gfx::Size element_size_;
@ -105,10 +105,10 @@ class WebViewGuestDelegate : public content::BrowserPluginGuestDelegate,
gfx::Size guest_size_;
// A pointer to the guest_host.
content::GuestHost* guest_host_;
content::GuestHost* guest_host_ = nullptr;
// Indicates whether autosize mode is enabled or not.
bool auto_size_enabled_;
bool auto_size_enabled_ = false;
// The maximum size constraints of the container element in autosize mode.
gfx::Size max_auto_size_;
@ -120,12 +120,12 @@ class WebViewGuestDelegate : public content::BrowserPluginGuestDelegate,
gfx::Size normal_size_;
// Whether the guest view is inside a plugin document.
bool is_full_page_plugin_;
bool is_full_page_plugin_ = false;
// Whether attached.
bool attached_;
bool attached_ = false;
api::WebContents* api_web_contents_;
api::WebContents* api_web_contents_ = nullptr;
DISALLOW_COPY_AND_ASSIGN(WebViewGuestDelegate);
};

View file

@ -117,15 +117,13 @@ bool FillFileInfoWithNode(Archive::FileInfo* info,
} // namespace
Archive::Archive(const base::FilePath& path)
: path_(path), file_(base::File::FILE_OK), header_size_(0) {
: path_(path), file_(base::File::FILE_OK) {
base::ThreadRestrictions::ScopedAllowIO allow_io;
file_.Initialize(path_, base::File::FLAG_OPEN | base::File::FLAG_READ);
#if defined(OS_WIN)
fd_ = _open_osfhandle(reinterpret_cast<intptr_t>(file_.GetPlatformFile()), 0);
#elif defined(OS_POSIX)
fd_ = file_.GetPlatformFile();
#else
fd_ = -1;
#endif
}

View file

@ -70,8 +70,8 @@ class Archive {
private:
base::FilePath path_;
base::File file_;
int fd_;
uint32_t header_size_;
int fd_ = -1;
uint32_t header_size_ = 0;
std::unique_ptr<base::DictionaryValue> header_;
// Cached external temporary files.

View file

@ -35,8 +35,7 @@ static const off_t kMaxMinidumpFileSize = 1258291;
} // namespace
CrashReporterLinux::CrashReporterLinux()
: process_start_time_(0), pid_(getpid()), upload_to_server_(true) {
CrashReporterLinux::CrashReporterLinux() : pid_(getpid()) {
// Set the base process start time value.
struct timeval tv;
if (!gettimeofday(&tv, NULL)) {

View file

@ -54,10 +54,10 @@ class CrashReporterLinux : public CrashReporter {
std::unique_ptr<google_breakpad::ExceptionHandler> breakpad_;
std::unique_ptr<CrashKeyStorage> crash_keys_;
uint64_t process_start_time_;
pid_t pid_;
uint64_t process_start_time_ = 0;
pid_t pid_ = 0;
std::string upload_url_;
bool upload_to_server_;
bool upload_to_server_ = true;
DISALLOW_COPY_AND_ASSIGN(CrashReporterLinux);
};

View file

@ -137,8 +137,7 @@ void UnregisterNonABICompliantCodeRange(void* start) {
} // namespace
CrashReporterWin::CrashReporterWin()
: skip_system_crash_handler_(false), code_range_registered_(false) {}
CrashReporterWin::CrashReporterWin() {}
CrashReporterWin::~CrashReporterWin() {}

View file

@ -64,8 +64,8 @@ class CrashReporterWin : public CrashReporter {
std::vector<google_breakpad::CustomInfoEntry> custom_info_entries_;
google_breakpad::CustomClientInfo custom_info_;
bool skip_system_crash_handler_;
bool code_range_registered_;
bool skip_system_crash_handler_ = false;
bool code_range_registered_ = false;
std::unique_ptr<google_breakpad::ExceptionHandler> breakpad_;
DISALLOW_COPY_AND_ASSIGN(CrashReporterWin);

View file

@ -152,10 +152,10 @@ class MimeWriter {
void AddItemWithoutTrailingSpaces(const void* base, size_t size);
struct kernel_iovec iov_[kIovCapacity];
int iov_index_;
int iov_index_ = 0;
// Output file descriptor.
int fd_;
int fd_ = -1;
const char* const mime_boundary_;
@ -164,7 +164,7 @@ class MimeWriter {
};
MimeWriter::MimeWriter(int fd, const char* const mime_boundary)
: iov_index_(0), fd_(fd), mime_boundary_(mime_boundary) {}
: fd_(fd), mime_boundary_(mime_boundary) {}
MimeWriter::~MimeWriter() {}

View file

@ -188,13 +188,7 @@ const char CrashService::kDumpsDir[] = "dumps-dir";
const char CrashService::kPipeName[] = "pipe-name";
const char CrashService::kReporterURL[] = "reporter-url";
CrashService::CrashService()
: sender_(NULL),
dumper_(NULL),
requests_handled_(0),
requests_sent_(0),
clients_connected_(0),
clients_terminated_(0) {}
CrashService::CrashService() {}
CrashService::~CrashService() {
base::AutoLock lock(sending_);

View file

@ -102,8 +102,8 @@ class CrashService {
// LocalFree.
PSECURITY_DESCRIPTOR GetSecurityDescriptorForLowIntegrity();
google_breakpad::CrashGenerationServer* dumper_;
google_breakpad::CrashReportSender* sender_;
google_breakpad::CrashGenerationServer* dumper_ = nullptr;
google_breakpad::CrashReportSender* sender_ = nullptr;
// the extra tag sent to the server with each dump.
std::wstring reporter_tag_;
@ -112,10 +112,10 @@ class CrashService {
std::wstring reporter_url_;
// clients serviced statistics:
int requests_handled_;
int requests_sent_;
volatile LONG clients_connected_;
volatile LONG clients_terminated_;
int requests_handled_ = 0;
int requests_sent_ = 0;
volatile LONG clients_connected_ = 0;
volatile LONG clients_terminated_ = 0;
base::Lock sending_;
DISALLOW_COPY_AND_ASSIGN(CrashService);

View file

@ -122,11 +122,7 @@ class V8ValueConverter::ScopedUniquenessGuard {
DISALLOW_COPY_AND_ASSIGN(ScopedUniquenessGuard);
};
V8ValueConverter::V8ValueConverter()
: reg_exp_allowed_(false),
function_allowed_(false),
disable_node_(false),
strip_null_from_objects_(false) {}
V8ValueConverter::V8ValueConverter() {}
void V8ValueConverter::SetRegExpAllowed(bool val) {
reg_exp_allowed_ = val;

View file

@ -58,21 +58,21 @@ class V8ValueConverter {
v8::Isolate* isolate) const;
// If true, we will convert RegExp JavaScript objects to string.
bool reg_exp_allowed_;
bool reg_exp_allowed_ = false;
// If true, we will convert Function JavaScript objects to dictionaries.
bool function_allowed_;
bool function_allowed_ = false;
// If true, will not use node::Buffer::Copy to deserialize byte arrays.
// node::Buffer::Copy depends on a working node.js environment, and this is
// not desirable in sandboxed renderers. That means Buffer instances sent from
// browser process will be deserialized as browserify-based Buffer(which are
// wrappers around Uint8Array).
bool disable_node_;
bool disable_node_ = false;
// If true, undefined and null values are ignored when converting v8 objects
// into Values.
bool strip_null_from_objects_;
bool strip_null_from_objects_ = false;
DISALLOW_COPY_AND_ASSIGN(V8ValueConverter);
};

View file

@ -135,10 +135,7 @@ base::FilePath GetResourcesPath(bool is_browser) {
} // namespace
NodeBindings::NodeBindings(BrowserEnvironment browser_env)
: browser_env_(browser_env),
embed_closed_(false),
uv_env_(nullptr),
weak_factory_(this) {
: browser_env_(browser_env), weak_factory_(this) {
if (browser_env == WORKER) {
uv_loop_init(&worker_loop_);
uv_loop_ = &worker_loop_;

View file

@ -87,7 +87,7 @@ class NodeBindings {
static void EmbedThreadRunner(void* arg);
// Whether the libuv loop has ended.
bool embed_closed_;
bool embed_closed_ = false;
// Loop used when constructed in WORKER mode
uv_loop_t worker_loop_;
@ -102,7 +102,7 @@ class NodeBindings {
uv_sem_t embed_sem_;
// Environment that to wrap the uv loop.
node::Environment* uv_env_;
node::Environment* uv_env_ = nullptr;
base::WeakPtrFactory<NodeBindings> weak_factory_;

View file

@ -50,10 +50,7 @@ void TrimStringVectorForIPC(std::vector<base::string16>* strings) {
} // namespace
AutofillAgent::AutofillAgent(content::RenderFrame* frame)
: content::RenderFrameObserver(frame),
focused_node_was_last_clicked_(false),
was_focused_before_now_(false),
weak_ptr_factory_(this) {
: content::RenderFrameObserver(frame), weak_ptr_factory_(this) {
render_frame()->GetWebFrame()->SetAutofillClient(this);
}

View file

@ -62,12 +62,12 @@ class AutofillAgent : public content::RenderFrameObserver,
void DoFocusChangeComplete();
// True when the last click was on the focused node.
bool focused_node_was_last_clicked_;
bool focused_node_was_last_clicked_ = false;
// This is set to false when the focus changes, then set back to true soon
// afterwards. This helps track whether an event happened after a node was
// already focused, or if it caused the focus to change.
bool was_focused_before_now_;
bool was_focused_before_now_ = false;
base::WeakPtrFactory<AutofillAgent> weak_ptr_factory_;

View file

@ -72,8 +72,7 @@ AtomRenderFrameObserver::AtomRenderFrameObserver(
RendererClientBase* renderer_client)
: content::RenderFrameObserver(frame),
render_frame_(frame),
renderer_client_(renderer_client),
document_created_(false) {
renderer_client_(renderer_client) {
// Initialise resource for directory listing.
net::NetModule::SetResourceProvider(NetResourceProvider);
}

View file

@ -56,7 +56,7 @@ class AtomRenderFrameObserver : public content::RenderFrameObserver {
content::RenderFrame* render_frame_;
RendererClientBase* renderer_client_;
bool document_created_;
bool document_created_ = false;
DISALLOW_COPY_AND_ASSIGN(AtomRenderFrameObserver);
};

View file

@ -37,8 +37,7 @@ bool IsDevToolsExtension(content::RenderFrame* render_frame) {
} // namespace
AtomRendererClient::AtomRendererClient()
: node_integration_initialized_(false),
node_bindings_(NodeBindings::Create(NodeBindings::RENDERER)),
: node_bindings_(NodeBindings::Create(NodeBindings::RENDERER)),
atom_bindings_(new AtomBindings(uv_default_loop())) {}
AtomRendererClient::~AtomRendererClient() {

View file

@ -60,7 +60,7 @@ class AtomRendererClient : public RendererClientBase {
node::Environment* GetEnvironment(content::RenderFrame* frame) const;
// Whether the node integration has been initialized.
bool node_integration_initialized_;
bool node_integration_initialized_ = false;
std::unique_ptr<NodeBindings> node_bindings_;
std::unique_ptr<AtomBindings> atom_bindings_;