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

Side by Side Diff: webrtc/base/proxydetect.cc

Issue 2684613002: Delete webrtc/base/common.h (Closed)
Patch Set: Use #if instead of ATTRIBUTE_UNUSED. Created 3 years, 10 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 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 16 matching lines...) Expand all
27 #ifdef WEBRTC_IOS 27 #ifdef WEBRTC_IOS
28 #include <CFNetwork/CFNetwork.h> 28 #include <CFNetwork/CFNetwork.h>
29 #include "macconversion.h" 29 #include "macconversion.h"
30 #endif 30 #endif
31 31
32 #include <map> 32 #include <map>
33 #include <memory> 33 #include <memory>
34 34
35 #include "webrtc/base/arraysize.h" 35 #include "webrtc/base/arraysize.h"
36 #include "webrtc/base/checks.h" 36 #include "webrtc/base/checks.h"
37 #include "webrtc/base/common.h"
38 #include "webrtc/base/fileutils.h" 37 #include "webrtc/base/fileutils.h"
39 #include "webrtc/base/httpcommon.h" 38 #include "webrtc/base/httpcommon.h"
40 #include "webrtc/base/httpcommon-inl.h" 39 #include "webrtc/base/httpcommon-inl.h"
41 #include "webrtc/base/pathutils.h" 40 #include "webrtc/base/pathutils.h"
42 #include "webrtc/base/stringutils.h" 41 #include "webrtc/base/stringutils.h"
42 #include "webrtc/common_types.h"
43 43
44 #define _TRY_JSPROXY 0 44 #define _TRY_JSPROXY 0
45 #define _TRY_WM_FINDPROXY 0 45 #define _TRY_WM_FINDPROXY 0
46 46
47 #if defined(WEBRTC_WIN) 47 #if defined(WEBRTC_WIN)
48 #define _TRY_WINHTTP 1 48 #define _TRY_WINHTTP 1
49 #define _TRY_IE_LAN_SETTINGS 1 49 #define _TRY_IE_LAN_SETTINGS 1
50 #else 50 #else
51 #define _TRY_WINHTTP 0 51 #define _TRY_WINHTTP 0
52 #define _TRY_IE_LAN_SETTINGS 0 52 #define _TRY_IE_LAN_SETTINGS 0
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 SocketAddress addr(url.host(), 0); 228 SocketAddress addr(url.host(), 0);
229 // TODO: Support IPv6 proxyitems. This code block is IPv4 only anyway. 229 // TODO: Support IPv6 proxyitems. This code block is IPv4 only anyway.
230 return !addr.IsUnresolvedIP() && 230 return !addr.IsUnresolvedIP() &&
231 ((addr.ipaddr().v4AddressAsHostOrderInteger() & mask) == (ip & mask)); 231 ((addr.ipaddr().v4AddressAsHostOrderInteger() & mask) == (ip & mask));
232 } 232 }
233 233
234 // .foo.com 234 // .foo.com
235 if (*item == '.') { 235 if (*item == '.') {
236 size_t hostlen = url.host().length(); 236 size_t hostlen = url.host().length();
237 return (hostlen > len) 237 return (hostlen > len)
238 && (stricmp(url.host().c_str() + (hostlen - len), item) == 0); 238 && (STR_CASE_CMP(url.host().c_str() + (hostlen - len), item) == 0);
239 } 239 }
240 240
241 // localhost or www.*.com 241 // localhost or www.*.com
242 if (!string_match(url.host().c_str(), item)) 242 if (!string_match(url.host().c_str(), item))
243 return false; 243 return false;
244 244
245 return true; 245 return true;
246 } 246 }
247 247
248 bool ProxyListMatch(const Url<char>& url, const std::string& proxy_list, 248 bool ProxyListMatch(const Url<char>& url, const std::string& proxy_list,
(...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after
1283 if (!result) { 1283 if (!result) {
1284 // Either auto detection is not supported or we simply didn't 1284 // Either auto detection is not supported or we simply didn't
1285 // find any proxy, reset type. 1285 // find any proxy, reset type.
1286 proxy->type = rtc::PROXY_NONE; 1286 proxy->type = rtc::PROXY_NONE;
1287 } 1287 }
1288 } 1288 }
1289 return result; 1289 return result;
1290 } 1290 }
1291 1291
1292 } // namespace rtc 1292 } // namespace rtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698