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

Side by Side Diff: mojo/edk/system/node_controller.h

Issue 2153733002: [mojo-edk] Prevent AcceptIncomingMessages flushing aggressively (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 unified diff | Download patch
« no previous file with comments | « no previous file | mojo/edk/system/node_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MOJO_EDK_SYSTEM_NODE_CONTROLLER_H_ 5 #ifndef MOJO_EDK_SYSTEM_NODE_CONTROLLER_H_
6 #define MOJO_EDK_SYSTEM_NODE_CONTROLLER_H_ 6 #define MOJO_EDK_SYSTEM_NODE_CONTROLLER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <queue> 9 #include <queue>
10 #include <unordered_map> 10 #include <unordered_map>
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 // Messages waiting to be relayed by the broker once it's known. 279 // Messages waiting to be relayed by the broker once it's known.
280 std::unordered_map<ports::NodeName, OutgoingMessageQueue> 280 std::unordered_map<ports::NodeName, OutgoingMessageQueue>
281 pending_relay_messages_; 281 pending_relay_messages_;
282 282
283 // Guards |incoming_messages_| and |incoming_messages_task_posted_|. 283 // Guards |incoming_messages_| and |incoming_messages_task_posted_|.
284 base::Lock messages_lock_; 284 base::Lock messages_lock_;
285 std::queue<ports::ScopedMessage> incoming_messages_; 285 std::queue<ports::ScopedMessage> incoming_messages_;
286 // Ensures that there is only one incoming messages task posted to the IO 286 // Ensures that there is only one incoming messages task posted to the IO
287 // thread. 287 // thread.
288 bool incoming_messages_task_posted_ = false; 288 bool incoming_messages_task_posted_ = false;
289 // Flag to fast-path checking |incoming_messages_|.
290 AtomicFlag incoming_messages_flag_;
291 289
292 // Guards |shutdown_callback_|. 290 // Guards |shutdown_callback_|.
293 base::Lock shutdown_lock_; 291 base::Lock shutdown_lock_;
294 292
295 // Set by RequestShutdown(). If this is non-null, the controller will 293 // Set by RequestShutdown(). If this is non-null, the controller will
296 // begin polling the Node to see if clean shutdown is possible any time the 294 // begin polling the Node to see if clean shutdown is possible any time the
297 // Node's state is modified by the controller. 295 // Node's state is modified by the controller.
298 base::Closure shutdown_callback_; 296 base::Closure shutdown_callback_;
299 // Flag to fast-path checking |shutdown_callback_|. 297 // Flag to fast-path checking |shutdown_callback_|.
300 AtomicFlag shutdown_callback_flag_; 298 AtomicFlag shutdown_callback_flag_;
(...skipping 19 matching lines...) Expand all
320 std::unique_ptr<MachPortRelay> mach_port_relay_; 318 std::unique_ptr<MachPortRelay> mach_port_relay_;
321 #endif 319 #endif
322 320
323 DISALLOW_COPY_AND_ASSIGN(NodeController); 321 DISALLOW_COPY_AND_ASSIGN(NodeController);
324 }; 322 };
325 323
326 } // namespace edk 324 } // namespace edk
327 } // namespace mojo 325 } // namespace mojo
328 326
329 #endif // MOJO_EDK_SYSTEM_NODE_CONTROLLER_H_ 327 #endif // MOJO_EDK_SYSTEM_NODE_CONTROLLER_H_
OLDNEW
« no previous file with comments | « no previous file | mojo/edk/system/node_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698