OLD | NEW |
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 "net/base/net_util.h" | 5 #include "net/base/net_util.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 1937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1948 string16 result = FormatUrlWithOffsets(url, languages, format_types, | 1948 string16 result = FormatUrlWithOffsets(url, languages, format_types, |
1949 unescape_rules, new_parsed, prefix_end, &offsets); | 1949 unescape_rules, new_parsed, prefix_end, &offsets); |
1950 if (offset_for_adjustment) | 1950 if (offset_for_adjustment) |
1951 *offset_for_adjustment = offsets[0]; | 1951 *offset_for_adjustment = offsets[0]; |
1952 return result; | 1952 return result; |
1953 } | 1953 } |
1954 | 1954 |
1955 bool CanStripTrailingSlash(const GURL& url) { | 1955 bool CanStripTrailingSlash(const GURL& url) { |
1956 // Omit the path only for standard, non-file URLs with nothing but "/" after | 1956 // Omit the path only for standard, non-file URLs with nothing but "/" after |
1957 // the hostname. | 1957 // the hostname. |
1958 return url.IsStandard() && !url.SchemeIsFile() && !url.has_query() && | 1958 return url.IsStandard() && !url.SchemeIsFile() && |
1959 !url.has_ref() && url.path() == "/"; | 1959 !url.SchemeIsFileSystem() && !url.has_query() && !url.has_ref() |
| 1960 && url.path() == "/"; |
1960 } | 1961 } |
1961 | 1962 |
1962 GURL SimplifyUrlForRequest(const GURL& url) { | 1963 GURL SimplifyUrlForRequest(const GURL& url) { |
1963 DCHECK(url.is_valid()); | 1964 DCHECK(url.is_valid()); |
1964 GURL::Replacements replacements; | 1965 GURL::Replacements replacements; |
1965 replacements.ClearUsername(); | 1966 replacements.ClearUsername(); |
1966 replacements.ClearPassword(); | 1967 replacements.ClearPassword(); |
1967 replacements.ClearRef(); | 1968 replacements.ClearRef(); |
1968 return url.ReplaceComponents(replacements); | 1969 return url.ReplaceComponents(replacements); |
1969 } | 1970 } |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2458 | 2459 |
2459 NetworkInterface::NetworkInterface(const std::string& name, | 2460 NetworkInterface::NetworkInterface(const std::string& name, |
2460 const IPAddressNumber& address) | 2461 const IPAddressNumber& address) |
2461 : name(name), address(address) { | 2462 : name(name), address(address) { |
2462 } | 2463 } |
2463 | 2464 |
2464 NetworkInterface::~NetworkInterface() { | 2465 NetworkInterface::~NetworkInterface() { |
2465 } | 2466 } |
2466 | 2467 |
2467 } // namespace net | 2468 } // namespace net |
OLD | NEW |