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

Side by Side Diff: device/geolocation/wifi_data_provider_mac.mm

Issue 2833273002: Geolocation cleanup: use unique_ptr<>s and rename New{WlanApi/PollingPolicy} to CreateBla() (Closed)
Patch Set: reillyg@s nits Created 3 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "device/geolocation/wifi_data_provider_mac.h" 5 #include "device/geolocation/wifi_data_provider_mac.h"
6 6
7 #import <CoreWLAN/CoreWLAN.h> 7 #import <CoreWLAN/CoreWLAN.h>
8 #import <Foundation/Foundation.h> 8 #import <Foundation/Foundation.h>
9 9
10 #include "base/mac/scoped_nsautorelease_pool.h" 10 #include "base/mac/scoped_nsautorelease_pool.h"
11 #include "base/mac/scoped_nsobject.h" 11 #include "base/mac/scoped_nsobject.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/ptr_util.h"
13 #include "base/metrics/histogram_macros.h" 14 #include "base/metrics/histogram_macros.h"
14 #include "base/strings/sys_string_conversions.h" 15 #include "base/strings/sys_string_conversions.h"
15 #include "device/geolocation/wifi_data_provider_common.h" 16 #include "device/geolocation/wifi_data_provider_common.h"
16 #include "device/geolocation/wifi_data_provider_manager.h" 17 #include "device/geolocation/wifi_data_provider_manager.h"
17 18
18 extern "C" NSString* const kCWScanKeyMerge; 19 extern "C" NSString* const kCWScanKeyMerge;
19 20
20 @interface CWInterface (Private) 21 @interface CWInterface (Private)
21 - (NSArray*)scanForNetworksWithParameters:(NSDictionary*)params 22 - (NSArray*)scanForNetworksWithParameters:(NSDictionary*)params
22 error:(NSError**)error; 23 error:(NSError**)error;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 116
116 // static 117 // static
117 WifiDataProvider* WifiDataProviderManager::DefaultFactoryFunction() { 118 WifiDataProvider* WifiDataProviderManager::DefaultFactoryFunction() {
118 return new WifiDataProviderMac(); 119 return new WifiDataProviderMac();
119 } 120 }
120 121
121 WifiDataProviderMac::WifiDataProviderMac() {} 122 WifiDataProviderMac::WifiDataProviderMac() {}
122 123
123 WifiDataProviderMac::~WifiDataProviderMac() {} 124 WifiDataProviderMac::~WifiDataProviderMac() {}
124 125
125 WifiDataProviderMac::WlanApiInterface* WifiDataProviderMac::NewWlanApi() { 126 std::unique_ptr<WifiDataProviderMac::WlanApiInterface>
126 return new CoreWlanApi(); 127 WifiDataProviderMac::CreateWlanApi() {
128 return base::MakeUnique<CoreWlanApi>();
127 } 129 }
128 130
129 WifiPollingPolicy* WifiDataProviderMac::NewPollingPolicy() { 131 std::unique_ptr<WifiPollingPolicy> WifiDataProviderMac::CreatePollingPolicy() {
130 return new GenericWifiPollingPolicy< 132 return base::MakeUnique<GenericWifiPollingPolicy<
131 kDefaultPollingInterval, kNoChangePollingInterval, 133 kDefaultPollingInterval, kNoChangePollingInterval,
132 kTwoNoChangePollingInterval, kNoWifiPollingIntervalMilliseconds>; 134 kTwoNoChangePollingInterval, kNoWifiPollingIntervalMilliseconds>>();
133 } 135 }
134 136
135 } // namespace device 137 } // namespace device
OLDNEW
« no previous file with comments | « device/geolocation/wifi_data_provider_mac.h ('k') | device/geolocation/wifi_data_provider_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698