Commit ed15802b authored by Steven Bennetts's avatar Steven Bennetts Committed by Commit Bot

NetworkStateHandler: Ignore updates before initial properties received

This CL ignores Device PropertyChanged updates sent before the initial
GetProperties request is received. It fixes an edge case triggering a
DCHECK when the |type| property is not set yet (it is set when the
initial properties are received).

Bug: 1008193
Change-Id: I1a32578ba8a9f5ae7deda53c27c9c2fc8556e0b3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1836178Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Commit-Queue: Steven Bennetts <stevenjb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#702482}
parent 6eddb2b5
...@@ -1431,8 +1431,12 @@ void NetworkStateHandler::UpdateDeviceProperty(const std::string& device_path, ...@@ -1431,8 +1431,12 @@ void NetworkStateHandler::UpdateDeviceProperty(const std::string& device_path,
const base::Value& value) { const base::Value& value) {
SCOPED_NET_LOG_IF_SLOW(); SCOPED_NET_LOG_IF_SLOW();
DeviceState* device = GetModifiableDeviceState(device_path); DeviceState* device = GetModifiableDeviceState(device_path);
if (!device) if (!device || !device->update_received()) {
// Shill may send a device property update before processing Chrome's
// initial GetProperties request. If this occurs, the initial request will
// include the changed property value so we can ignore this update.
return; return;
}
if (!device->PropertyChanged(key, value)) if (!device->PropertyChanged(key, value))
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment