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

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

Issue 1837483003: Move base::FreeDeleter into its own header. (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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 // Windows Vista uses the Native Wifi (WLAN) API for accessing WiFi cards. See 5 // Windows Vista uses the Native Wifi (WLAN) API for accessing WiFi cards. See
6 // http://msdn.microsoft.com/en-us/library/ms705945(VS.85).aspx. Windows XP 6 // http://msdn.microsoft.com/en-us/library/ms705945(VS.85).aspx. Windows XP
7 // Service Pack 3 (and Windows XP Service Pack 2, if upgraded with a hot fix) 7 // Service Pack 3 (and Windows XP Service Pack 2, if upgraded with a hot fix)
8 // also support a limited version of the WLAN API. See 8 // also support a limited version of the WLAN API. See
9 // http://msdn.microsoft.com/en-us/library/bb204766.aspx. The WLAN API uses 9 // http://msdn.microsoft.com/en-us/library/bb204766.aspx. The WLAN API uses
10 // wlanapi.h, which is not part of the SDK used by Gears, so is replicated 10 // wlanapi.h, which is not part of the SDK used by Gears, so is replicated
11 // locally using data from the MSDN. 11 // locally using data from the MSDN.
12 // 12 //
13 // Windows XP from Service Pack 2 onwards supports the Wireless Zero 13 // Windows XP from Service Pack 2 onwards supports the Wireless Zero
14 // Configuration (WZC) programming interface. See 14 // Configuration (WZC) programming interface. See
15 // http://msdn.microsoft.com/en-us/library/ms706587(VS.85).aspx. 15 // http://msdn.microsoft.com/en-us/library/ms706587(VS.85).aspx.
16 // 16 //
17 // The MSDN recommends that one use the WLAN API where available, and WZC 17 // The MSDN recommends that one use the WLAN API where available, and WZC
18 // otherwise. 18 // otherwise.
19 // 19 //
20 // However, it seems that WZC fails for some wireless cards. Also, WLAN seems 20 // However, it seems that WZC fails for some wireless cards. Also, WLAN seems
21 // not to work on XP SP3. So we use WLAN on Vista, and use NDIS directly 21 // not to work on XP SP3. So we use WLAN on Vista, and use NDIS directly
22 // otherwise. 22 // otherwise.
23 23
24 #include "content/browser/geolocation/wifi_data_provider_win.h" 24 #include "content/browser/geolocation/wifi_data_provider_win.h"
25 25
26 #include <windows.h> 26 #include <windows.h>
27 #include <winioctl.h> 27 #include <winioctl.h>
28 #include <wlanapi.h> 28 #include <wlanapi.h>
29 29
30 #include "base/memory/free_deleter.h"
30 #include "base/metrics/histogram.h" 31 #include "base/metrics/histogram.h"
31 #include "base/strings/utf_string_conversions.h" 32 #include "base/strings/utf_string_conversions.h"
32 #include "base/win/windows_version.h" 33 #include "base/win/windows_version.h"
33 #include "content/browser/geolocation/wifi_data_provider_common.h" 34 #include "content/browser/geolocation/wifi_data_provider_common.h"
34 #include "content/browser/geolocation/wifi_data_provider_common_win.h" 35 #include "content/browser/geolocation/wifi_data_provider_common_win.h"
35 #include "content/browser/geolocation/wifi_data_provider_manager.h" 36 #include "content/browser/geolocation/wifi_data_provider_manager.h"
36 37
37 // Taken from ndis.h for WinCE. 38 // Taken from ndis.h for WinCE.
38 #define NDIS_STATUS_INVALID_LENGTH ((NDIS_STATUS)0xC0010014L) 39 #define NDIS_STATUS_INVALID_LENGTH ((NDIS_STATUS)0xC0010014L)
39 #define NDIS_STATUS_BUFFER_TOO_SHORT ((NDIS_STATUS)0xC0010016L) 40 #define NDIS_STATUS_BUFFER_TOO_SHORT ((NDIS_STATUS)0xC0010016L)
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 634
634 if (*path->rbegin() != L'\\') { 635 if (*path->rbegin() != L'\\') {
635 path->append(L"\\"); 636 path->append(L"\\");
636 } 637 }
637 DCHECK_EQ(L'\\', *path->rbegin()); 638 DCHECK_EQ(L'\\', *path->rbegin());
638 return true; 639 return true;
639 } 640 }
640 } // namespace 641 } // namespace
641 642
642 } // namespace content 643 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698