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

Side by Side Diff: content/browser/geolocation/wifi_data_provider_common.cc

Issue 10534002: replace wstring printf in geolocation as wstring is deprecated (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/geolocation/wifi_data_provider_common.h" 5 #include "content/browser/geolocation/wifi_data_provider_common.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/stringprintf.h" 8 #include "base/stringprintf.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 10
11 string16 MacAddressAsString16(const uint8 mac_as_int[6]) { 11 string16 MacAddressAsString16(const uint8 mac_as_int[6]) {
12 // mac_as_int is big-endian. Write in byte chunks. 12 // mac_as_int is big-endian. Write in byte chunks.
13 // Format is XX-XX-XX-XX-XX-XX. 13 // Format is XX-XX-XX-XX-XX-XX.
14 static const wchar_t* const kMacFormatString = 14 static const char* const kMacFormatString =
15 L"%02x-%02x-%02x-%02x-%02x-%02x"; 15 "%02x-%02x-%02x-%02x-%02x-%02x";
16 return WideToUTF16(base::StringPrintf(kMacFormatString, 16 return ASCIIToUTF16(base::StringPrintf(kMacFormatString,
17 mac_as_int[0], 17 mac_as_int[0],
18 mac_as_int[1], 18 mac_as_int[1],
19 mac_as_int[2], 19 mac_as_int[2],
20 mac_as_int[3], 20 mac_as_int[3],
21 mac_as_int[4], 21 mac_as_int[4],
22 mac_as_int[5])); 22 mac_as_int[5]));
23 } 23 }
24 24
25 WifiDataProviderCommon::WifiDataProviderCommon() 25 WifiDataProviderCommon::WifiDataProviderCommon()
26 : Thread("Geolocation_wifi_provider"), 26 : Thread("Geolocation_wifi_provider"),
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 } 100 }
101 } 101 }
102 102
103 void WifiDataProviderCommon::ScheduleNextScan(int interval) { 103 void WifiDataProviderCommon::ScheduleNextScan(int interval) {
104 message_loop()->PostDelayedTask( 104 message_loop()->PostDelayedTask(
105 FROM_HERE, 105 FROM_HERE,
106 base::Bind(&WifiDataProviderCommon::DoWifiScanTask, 106 base::Bind(&WifiDataProviderCommon::DoWifiScanTask,
107 weak_factory_.GetWeakPtr()), 107 weak_factory_.GetWeakPtr()),
108 base::TimeDelta::FromMilliseconds(interval)); 108 base::TimeDelta::FromMilliseconds(interval));
109 } 109 }
OLDNEW
« 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