| OLD | NEW |
| 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 #include "mojo/edk/system/node_controller.h" | 5 #include "mojo/edk/system/node_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 748 node_->AcceptMessage(std::move(messages.front())); | 748 node_->AcceptMessage(std::move(messages.front())); |
| 749 messages.pop(); | 749 messages.pop(); |
| 750 } | 750 } |
| 751 | 751 |
| 752 // This is effectively a safeguard against potential bugs which might lead | 752 // This is effectively a safeguard against potential bugs which might lead |
| 753 // to runaway message cycles. If any such cycles arise, we'll start seeing | 753 // to runaway message cycles. If any such cycles arise, we'll start seeing |
| 754 // crash reports from this location. | 754 // crash reports from this location. |
| 755 CHECK_LE(num_messages_accepted, kMaxAcceptedMessages); | 755 CHECK_LE(num_messages_accepted, kMaxAcceptedMessages); |
| 756 } | 756 } |
| 757 | 757 |
| 758 UMA_HISTOGRAM_CUSTOM_COUNTS("Mojo.System.MessagesAcceptedPerEvent", | 758 if (num_messages_accepted >= 4) { |
| 759 static_cast<int32_t>(num_messages_accepted), | 759 // Note: We avoid logging this histogram for the vast majority of cases. |
| 760 1 /* min */, | 760 // See https://crbug.com/685763 for more context. |
| 761 500 /* max */, | 761 UMA_HISTOGRAM_CUSTOM_COUNTS("Mojo.System.MessagesAcceptedPerEvent", |
| 762 50 /* bucket count */); | 762 static_cast<int32_t>(num_messages_accepted), |
| 763 1 /* min */, |
| 764 500 /* max */, |
| 765 50 /* bucket count */); |
| 766 } |
| 763 | 767 |
| 764 AttemptShutdownIfRequested(); | 768 AttemptShutdownIfRequested(); |
| 765 } | 769 } |
| 766 | 770 |
| 767 void NodeController::ProcessIncomingMessages() { | 771 void NodeController::ProcessIncomingMessages() { |
| 768 RequestContext request_context(RequestContext::Source::SYSTEM); | 772 RequestContext request_context(RequestContext::Source::SYSTEM); |
| 769 | 773 |
| 770 { | 774 { |
| 771 base::AutoLock lock(messages_lock_); | 775 base::AutoLock lock(messages_lock_); |
| 772 // Allow a new incoming messages processing task to be posted. This can't be | 776 // Allow a new incoming messages processing task to be posted. This can't be |
| (...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1444 NodeController::PeerConnection::~PeerConnection() = default; | 1448 NodeController::PeerConnection::~PeerConnection() = default; |
| 1445 | 1449 |
| 1446 NodeController::PeerConnection& NodeController::PeerConnection:: | 1450 NodeController::PeerConnection& NodeController::PeerConnection:: |
| 1447 operator=(const PeerConnection& other) = default; | 1451 operator=(const PeerConnection& other) = default; |
| 1448 | 1452 |
| 1449 NodeController::PeerConnection& NodeController::PeerConnection:: | 1453 NodeController::PeerConnection& NodeController::PeerConnection:: |
| 1450 operator=(PeerConnection&& other) = default; | 1454 operator=(PeerConnection&& other) = default; |
| 1451 | 1455 |
| 1452 } // namespace edk | 1456 } // namespace edk |
| 1453 } // namespace mojo | 1457 } // namespace mojo |
| OLD | NEW |