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

Side by Side Diff: components/arc/net/arc_net_host_impl.cc

Issue 1921973002: Convert //components/[a-e]* from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/arc/net/arc_net_host_impl.h" 5 #include "components/arc/net/arc_net_host_impl.h"
6 6
7 #include <memory>
7 #include <string> 8 #include <string>
8 #include <vector> 9 #include <vector>
9 10
10 #include "base/location.h" 11 #include "base/location.h"
11 #include "base/logging.h" 12 #include "base/logging.h"
12 #include "base/posix/eintr_wrapper.h" 13 #include "base/posix/eintr_wrapper.h"
13 #include "base/thread_task_runner_handle.h" 14 #include "base/thread_task_runner_handle.h"
14 #include "base/time/time.h" 15 #include "base/time/time.h"
15 #include "chromeos/network/network_handler.h" 16 #include "chromeos/network/network_handler.h"
16 #include "chromeos/network/network_state_handler.h" 17 #include "chromeos/network/network_state_handler.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 bool configured_only = true; 82 bool configured_only = true;
82 bool visible_only = false; 83 bool visible_only = false;
83 if (type == mojom::GetNetworksRequestType::VISIBLE_ONLY) { 84 if (type == mojom::GetNetworksRequestType::VISIBLE_ONLY) {
84 configured_only = false; 85 configured_only = false;
85 visible_only = true; 86 visible_only = true;
86 } 87 }
87 88
88 // Retrieve list of nearby wifi networks 89 // Retrieve list of nearby wifi networks
89 chromeos::NetworkTypePattern network_pattern = 90 chromeos::NetworkTypePattern network_pattern =
90 chromeos::onc::NetworkTypePatternFromOncType(onc::network_type::kWiFi); 91 chromeos::onc::NetworkTypePatternFromOncType(onc::network_type::kWiFi);
91 scoped_ptr<base::ListValue> network_properties_list = 92 std::unique_ptr<base::ListValue> network_properties_list =
92 chromeos::network_util::TranslateNetworkListToONC( 93 chromeos::network_util::TranslateNetworkListToONC(
93 network_pattern, configured_only, visible_only, 94 network_pattern, configured_only, visible_only,
94 kGetNetworksListLimit); 95 kGetNetworksListLimit);
95 96
96 // Extract info for each network and add it to the list. 97 // Extract info for each network and add it to the list.
97 // Even if there's no WiFi, an empty (size=0) list must be returned and not a 98 // Even if there's no WiFi, an empty (size=0) list must be returned and not a
98 // null one. The explicitly sized New() constructor ensures the non-null 99 // null one. The explicitly sized New() constructor ensures the non-null
99 // property. 100 // property.
100 mojo::Array<mojom::WifiConfigurationPtr> networks = 101 mojo::Array<mojom::WifiConfigurationPtr> networks =
101 mojo::Array<mojom::WifiConfigurationPtr>::New(0); 102 mojo::Array<mojom::WifiConfigurationPtr>::New(0);
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 } 183 }
183 184
184 arc_bridge_service()->net_instance()->ScanCompleted(); 185 arc_bridge_service()->net_instance()->ScanCompleted();
185 } 186 }
186 187
187 void ArcNetHostImpl::OnShuttingDown() { 188 void ArcNetHostImpl::OnShuttingDown() {
188 GetStateHandler()->RemoveObserver(this, FROM_HERE); 189 GetStateHandler()->RemoveObserver(this, FROM_HERE);
189 } 190 }
190 191
191 } // namespace arc 192 } // namespace arc
OLDNEW
« no previous file with comments | « components/arc/ime/arc_ime_service_unittest.cc ('k') | components/arc/standalone/arc_standalone_bridge_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698