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

Unified Diff: chromeos/network/network_state_handler.cc

Issue 811623002: Add logging for slow device events, limit network UI update rate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@patch_441650
Patch Set: Feedback Created 6 years 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
« no previous file with comments | « chromeos/device_event_log.cc ('k') | ui/chromeos/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/network_state_handler.cc
diff --git a/chromeos/network/network_state_handler.cc b/chromeos/network/network_state_handler.cc
index a4562b054d16c48b9646d125983a648ca0a2e70a..9e2e83c1466d55c1e1e9e02ce2d24f0356f3f72f 100644
--- a/chromeos/network/network_state_handler.cc
+++ b/chromeos/network/network_state_handler.cc
@@ -542,6 +542,7 @@ void NetworkStateHandler::UpdateNetworkServiceProperty(
const std::string& service_path,
const std::string& key,
const base::Value& value) {
+ SCOPED_NET_LOG_IF_SLOW();
bool changed = false;
NetworkState* network = GetModifiableNetworkState(service_path);
if (!network)
@@ -601,6 +602,7 @@ void NetworkStateHandler::UpdateNetworkServiceProperty(
void NetworkStateHandler::UpdateDeviceProperty(const std::string& device_path,
const std::string& key,
const base::Value& value) {
+ SCOPED_NET_LOG_IF_SLOW();
DeviceState* device = GetModifiableDeviceState(device_path);
if (!device)
return;
@@ -678,6 +680,7 @@ void NetworkStateHandler::TechnologyListChanged() {
void NetworkStateHandler::ManagedStateListChanged(
ManagedState::ManagedType type) {
+ SCOPED_NET_LOG_IF_SLOW();
if (type == ManagedState::MANAGED_TYPE_NETWORK) {
SortNetworkList();
UpdateNetworkStats();
@@ -817,6 +820,7 @@ void NetworkStateHandler::UpdateGuid(NetworkState* network) {
}
void NetworkStateHandler::NotifyDeviceListChanged() {
+ SCOPED_NET_LOG_IF_SLOW();
NET_LOG_DEBUG("NOTIFY:DeviceListChanged",
base::StringPrintf("Size:%" PRIuS, device_list_.size()));
FOR_EACH_OBSERVER(NetworkStateHandlerObserver, observers_,
@@ -866,6 +870,7 @@ NetworkStateHandler::ManagedStateList* NetworkStateHandler::GetManagedList(
void NetworkStateHandler::OnNetworkConnectionStateChanged(
NetworkState* network) {
+ SCOPED_NET_LOG_IF_SLOW();
DCHECK(network);
std::string event = "NetworkConnectionStateChanged";
if (network->path() == default_network_path_) {
@@ -889,6 +894,7 @@ void NetworkStateHandler::OnNetworkConnectionStateChanged(
void NetworkStateHandler::NotifyDefaultNetworkChanged(
const NetworkState* default_network) {
+ SCOPED_NET_LOG_IF_SLOW();
NET_LOG_EVENT("NOTIFY:DefaultNetworkChanged", GetLogName(default_network));
FOR_EACH_OBSERVER(NetworkStateHandlerObserver, observers_,
DefaultNetworkChanged(default_network));
@@ -896,6 +902,7 @@ void NetworkStateHandler::NotifyDefaultNetworkChanged(
void NetworkStateHandler::NotifyNetworkPropertiesUpdated(
const NetworkState* network) {
+ SCOPED_NET_LOG_IF_SLOW();
NET_LOG_DEBUG("NOTIFY:NetworkPropertiesUpdated", GetLogName(network));
FOR_EACH_OBSERVER(NetworkStateHandlerObserver, observers_,
NetworkPropertiesUpdated(network));
@@ -903,12 +910,14 @@ void NetworkStateHandler::NotifyNetworkPropertiesUpdated(
void NetworkStateHandler::NotifyDevicePropertiesUpdated(
const DeviceState* device) {
+ SCOPED_NET_LOG_IF_SLOW();
NET_LOG_DEBUG("NOTIFY:DevicePropertiesUpdated", GetLogName(device));
FOR_EACH_OBSERVER(NetworkStateHandlerObserver, observers_,
DevicePropertiesUpdated(device));
}
void NetworkStateHandler::NotifyScanCompleted(const DeviceState* device) {
+ SCOPED_NET_LOG_IF_SLOW();
NET_LOG_DEBUG("NOTIFY:ScanCompleted", GetLogName(device));
FOR_EACH_OBSERVER(NetworkStateHandlerObserver, observers_,
ScanCompleted(device));
« no previous file with comments | « chromeos/device_event_log.cc ('k') | ui/chromeos/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698