Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Unified Diff: mojo/public/cpp/bindings/connector.h

Issue 2185723002: Eliminate deferred destruction of AssociatedGroupController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mojo/public/cpp/bindings/connector.h
diff --git a/mojo/public/cpp/bindings/connector.h b/mojo/public/cpp/bindings/connector.h
index d14ad179baa9e0382a2cfa00134ade52079c6829..1548a5a7e662e4d167d94343dc76b453239ec77c 100644
--- a/mojo/public/cpp/bindings/connector.h
+++ b/mojo/public/cpp/bindings/connector.h
@@ -175,29 +175,32 @@ class Connector : public MessageReceiver {
base::Closure connection_error_handler_;
ScopedMessagePipeHandle message_pipe_;
- MessageReceiver* incoming_receiver_;
+ MessageReceiver* incoming_receiver_ = nullptr;
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
Watcher handle_watcher_;
- bool error_;
- bool drop_writes_;
- bool enforce_errors_from_incoming_receiver_;
+ bool error_ = false;
+ bool drop_writes_ = false;
+ bool enforce_errors_from_incoming_receiver_ = true;
- bool paused_;
+ bool paused_ = false;
// If sending messages is allowed from multiple threads, |lock_| is used to
// protect modifications to |message_pipe_| and |drop_writes_|.
std::unique_ptr<base::Lock> lock_;
std::unique_ptr<SyncHandleWatcher> sync_watcher_;
- bool allow_woken_up_by_others_;
+ bool allow_woken_up_by_others_ = false;
// If non-zero, currently the control flow is inside the sync handle watcher
// callback.
- size_t sync_handle_watcher_callback_count_;
+ size_t sync_handle_watcher_callback_count_ = 0;
base::ThreadChecker thread_checker_;
+ base::Lock connected_lock_;
+ bool connected_ = true;
+
// Create a single weak ptr and use it everywhere, to avoid the malloc/free
// cost of creating a new weak ptr whenever it is needed.
base::WeakPtr<Connector> weak_self_;
« no previous file with comments | « mojo/public/cpp/bindings/associated_group_controller.h ('k') | mojo/public/cpp/bindings/lib/associated_group_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698