Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/api/networking_private/networking_private_linux.h" | 5 #include "extensions/browser/api/networking_private/networking_private_linux.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 635 network_map_.swap(network_map); | 635 network_map_.swap(network_map); |
| 636 SendNetworkListChangedEvent(*network_list); | 636 SendNetworkListChangedEvent(*network_list); |
| 637 } | 637 } |
| 638 | 638 |
| 639 void NetworkingPrivateLinux::SendNetworkListChangedEvent( | 639 void NetworkingPrivateLinux::SendNetworkListChangedEvent( |
| 640 const base::ListValue& network_list) { | 640 const base::ListValue& network_list) { |
| 641 GuidList guidsForEventCallback; | 641 GuidList guidsForEventCallback; |
| 642 | 642 |
| 643 for (const auto& network : network_list) { | 643 for (const auto& network : network_list) { |
| 644 std::string guid; | 644 std::string guid; |
| 645 base::DictionaryValue* dict; | 645 const base::DictionaryValue* dict; |
|
Devlin
2017/03/30 22:44:59
nit: init to nullptr
jdoerrie
2017/04/07 13:56:17
Done.
| |
| 646 if (network->GetAsDictionary(&dict)) { | 646 if (network.GetAsDictionary(&dict)) { |
| 647 if (dict->GetString(kAccessPointInfoGuid, &guid)) { | 647 if (dict->GetString(kAccessPointInfoGuid, &guid)) { |
| 648 guidsForEventCallback.push_back(guid); | 648 guidsForEventCallback.push_back(guid); |
| 649 } | 649 } |
| 650 } | 650 } |
| 651 } | 651 } |
| 652 | 652 |
| 653 OnNetworkListChangedEventOnUIThread(guidsForEventCallback); | 653 OnNetworkListChangedEventOnUIThread(guidsForEventCallback); |
| 654 } | 654 } |
| 655 | 655 |
| 656 bool NetworkingPrivateLinux::GetNetworkDevices( | 656 bool NetworkingPrivateLinux::GetNetworkDevices( |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1201 base::Unretained(this), base::Passed(&guid_list))); | 1201 base::Unretained(this), base::Passed(&guid_list))); |
| 1202 } | 1202 } |
| 1203 | 1203 |
| 1204 void NetworkingPrivateLinux::OnNetworksChangedEventTask( | 1204 void NetworkingPrivateLinux::OnNetworksChangedEventTask( |
| 1205 std::unique_ptr<GuidList> guid_list) { | 1205 std::unique_ptr<GuidList> guid_list) { |
| 1206 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 1206 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 1207 OnNetworksChangedEventOnUIThread(*guid_list); | 1207 OnNetworksChangedEventOnUIThread(*guid_list); |
| 1208 } | 1208 } |
| 1209 | 1209 |
| 1210 } // namespace extensions | 1210 } // namespace extensions |
| OLD | NEW |