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

Side by Side Diff: net/base/net_util.h

Issue 6711046: Add an opt-out header for HTTP throttling. Never throttle for localhost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update copyright years. Created 9 years, 9 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 | net/base/net_util.cc » ('j') | net/base/net_util.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef NET_BASE_NET_UTIL_H_ 5 #ifndef NET_BASE_NET_UTIL_H_
6 #define NET_BASE_NET_UTIL_H_ 6 #define NET_BASE_NET_UTIL_H_
7 #pragma once 7 #pragma once
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 10
11 #if defined(OS_WIN) 11 #if defined(OS_WIN)
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 416
417 // Returns the value of |info's| port (in host byte ordering). 417 // Returns the value of |info's| port (in host byte ordering).
418 int GetPortFromAddrinfo(const struct addrinfo* info); 418 int GetPortFromAddrinfo(const struct addrinfo* info);
419 419
420 // Same except for struct sockaddr. 420 // Same except for struct sockaddr.
421 const uint16* GetPortFieldFromSockaddr(const struct sockaddr* address, 421 const uint16* GetPortFieldFromSockaddr(const struct sockaddr* address,
422 socklen_t address_len); 422 socklen_t address_len);
423 int GetPortFromSockaddr(const struct sockaddr* address, 423 int GetPortFromSockaddr(const struct sockaddr* address,
424 socklen_t address_len); 424 socklen_t address_len);
425 425
426 // Returns true if |host| is "localhost" or one of the IP-address
427 // representations of the loopback address (IPv4 127.0.0.0/8 or IPv6 ::1).
428 //
429 // Note that this function does not check for IP addresses other than
430 // the above being mapped back to the local machine, it only checks
431 // for those exact IP addresses.
432 bool IsLocalhost(const std::string& host);
433
426 } // namespace net 434 } // namespace net
427 435
428 #endif // NET_BASE_NET_UTIL_H_ 436 #endif // NET_BASE_NET_UTIL_H_
OLDNEW
« no previous file with comments | « no previous file | net/base/net_util.cc » ('j') | net/base/net_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698