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

Side by Side Diff: extensions/browser/api/networking_private/networking_private_linux.cc

Issue 2294653002: Some linked_ptr -> unique_ptr conversion in extensions/browser. (Closed)
Patch Set: nullptr Created 4 years, 3 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 unified diff | Download patch
OLDNEW
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 919 matching lines...) Expand 10 before | Expand all | Expand 10 after
930 access_point->GetString(kAccessPointInfoConnectionState, &connection_state); 930 access_point->GetString(kAccessPointInfoConnectionState, &connection_state);
931 access_point->GetInteger(kAccessPointInfoWifiSignalStrengthDotted, 931 access_point->GetInteger(kAccessPointInfoWifiSignalStrengthDotted,
932 &signal_strength); 932 &signal_strength);
933 access_point->GetString(kAccessPointInfoName, &ssid); 933 access_point->GetString(kAccessPointInfoName, &ssid);
934 access_point->SetString(kAccessPointInfoGuid, network_guid); 934 access_point->SetString(kAccessPointInfoGuid, network_guid);
935 935
936 NetworkMap::iterator existing_access_point_iter = network_map->find(ssid); 936 NetworkMap::iterator existing_access_point_iter = network_map->find(ssid);
937 937
938 if (existing_access_point_iter == network_map->end()) { 938 if (existing_access_point_iter == network_map->end()) {
939 // Unseen access point. Add it to the map. 939 // Unseen access point. Add it to the map.
940 network_map->insert(NetworkMap::value_type( 940 network_map->insert(NetworkMap::value_type(ssid, std::move(access_point)));
941 ssid, linked_ptr<base::DictionaryValue>(access_point.release())));
942 } else { 941 } else {
943 // Already seen access point. Update the record if this is the connected 942 // Already seen access point. Update the record if this is the connected
944 // record or if the signal strength is higher. But don't override a weaker 943 // record or if the signal strength is higher. But don't override a weaker
945 // access point if that is the one that is connected. 944 // access point if that is the one that is connected.
946 int existing_signal_strength; 945 int existing_signal_strength;
947 linked_ptr<base::DictionaryValue>& existing_access_point = 946 std::unique_ptr<base::DictionaryValue>& existing_access_point =
Devlin 2016/08/30 19:21:53 std::unique_ptr&s are kind of weird. Sometimes we
lazyboy 2016/08/30 20:30:56 Done.
948 existing_access_point_iter->second; 947 existing_access_point_iter->second;
949 existing_access_point->GetInteger(kAccessPointInfoWifiSignalStrengthDotted, 948 existing_access_point->GetInteger(kAccessPointInfoWifiSignalStrengthDotted,
950 &existing_signal_strength); 949 &existing_signal_strength);
951 950
952 std::string existing_connection_state; 951 std::string existing_connection_state;
953 existing_access_point->GetString(kAccessPointInfoConnectionState, 952 existing_access_point->GetString(kAccessPointInfoConnectionState,
954 &existing_connection_state); 953 &existing_connection_state);
955 954
956 if ((connection_state == ::onc::connection_state::kConnected) || 955 if ((connection_state == ::onc::connection_state::kConnected) ||
957 (!(existing_connection_state == ::onc::connection_state::kConnected) && 956 (!(existing_connection_state == ::onc::connection_state::kConnected) &&
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
1200 base::Unretained(this), base::Passed(&guid_list))); 1199 base::Unretained(this), base::Passed(&guid_list)));
1201 } 1200 }
1202 1201
1203 void NetworkingPrivateLinux::OnNetworksChangedEventTask( 1202 void NetworkingPrivateLinux::OnNetworksChangedEventTask(
1204 std::unique_ptr<GuidList> guid_list) { 1203 std::unique_ptr<GuidList> guid_list) {
1205 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 1204 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
1206 OnNetworksChangedEventOnUIThread(*guid_list); 1205 OnNetworksChangedEventOnUIThread(*guid_list);
1207 } 1206 }
1208 1207
1209 } // namespace extensions 1208 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698