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

Unified Diff: chrome/browser/chromeos/cros/network_library.cc

Issue 7011023: Really fix chromium-os:14180 this time. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove extra blank line Created 9 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/cros/network_library.cc
diff --git a/chrome/browser/chromeos/cros/network_library.cc b/chrome/browser/chromeos/cros/network_library.cc
index 4cef679b9b0a7499dbbc7bace86383b48d18b3c8..f20cdbdd42f655514a1ae99a706320c2f8548f62 100644
--- a/chrome/browser/chromeos/cros/network_library.cc
+++ b/chrome/browser/chromeos/cros/network_library.cc
@@ -3665,16 +3665,17 @@ class NetworkLibraryImpl : public NetworkLibrary {
(*iter)->GetAsString(&device_path);
if (!device_path.empty()) {
NetworkDeviceMap::iterator found = old_device_map.find(device_path);
- if (found != old_device_map.end()) {
- VLOG(2) << " Adding device: " << device_path;
- device_map_[device_path] = found->second;
- old_device_map.erase(found);
+ if (found == old_device_map.end()) {
+ VLOG(2) << " New device: " << device_path;
// Add device property monitor before we request the
// full property list, to ensure that we won't miss any
// property changes.
network_device_observers_[device_path] =
new NetworkDeviceObserverList(this, device_path);
stevenjb 2011/05/12 22:33:06 I think that only adding the observer when creatin
Eric Shienbrood 2011/05/12 22:41:18 Since we're requesting device info immediately bel
stevenjb 2011/05/12 23:00:24 Well, since the device doesn't exist yet (i.e. it
Eric Shienbrood 2011/05/13 21:48:48 If they're not monitoring the manager, then they w
Eric Shienbrood 2011/05/13 21:48:48 I still think there's a theoretical window of vuln
-
+ } else {
+ VLOG(2) << " Adding existing device: " << device_path;
+ device_map_[device_path] = found->second;
+ old_device_map.erase(found);
}
RequestNetworkDeviceInfo(
device_path.c_str(), &NetworkDeviceUpdate, this);
@@ -3723,6 +3724,11 @@ class NetworkLibraryImpl : public NetworkLibrary {
device = new NetworkDevice(device_path);
VLOG(2) << " Adding device: " << device_path;
device_map_[device_path] = device;
+ if (network_device_observers_.find(device_path) ==
+ network_device_observers_.end()) {
+ network_device_observers_[device_path] =
+ new NetworkDeviceObserverList(this, device_path);
+ }
}
device->ParseInfo(info);
VLOG(1) << "ParseNetworkDevice:" << device->name();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698