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 1880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1891 string16 result = FormatUrlWithOffsets(url, languages, format_types, | 1891 string16 result = FormatUrlWithOffsets(url, languages, format_types, |
1892 unescape_rules, new_parsed, prefix_end, &offsets); | 1892 unescape_rules, new_parsed, prefix_end, &offsets); |
1893 if (offset_for_adjustment) | 1893 if (offset_for_adjustment) |
1894 *offset_for_adjustment = offsets[0]; | 1894 *offset_for_adjustment = offsets[0]; |
1895 return result; | 1895 return result; |
1896 } | 1896 } |
1897 | 1897 |
1898 bool CanStripTrailingSlash(const GURL& url) { | 1898 bool CanStripTrailingSlash(const GURL& url) { |
1899 // Omit the path only for standard, non-file URLs with nothing but "/" after | 1899 // Omit the path only for standard, non-file URLs with nothing but "/" after |
1900 // the hostname. | 1900 // the hostname. |
1901 return url.IsStandard() && !url.SchemeIsFile() && !url.has_query() && | 1901 return url.IsStandard() && !url.SchemeIsFile() && |
1902 !url.has_ref() && url.path() == "/"; | 1902 !url.SchemeIsFileSystem() && !url.has_query() && !url.has_ref() |
| 1903 && url.path() == "/"; |
1903 } | 1904 } |
1904 | 1905 |
1905 GURL SimplifyUrlForRequest(const GURL& url) { | 1906 GURL SimplifyUrlForRequest(const GURL& url) { |
1906 DCHECK(url.is_valid()); | 1907 DCHECK(url.is_valid()); |
1907 GURL::Replacements replacements; | 1908 GURL::Replacements replacements; |
1908 replacements.ClearUsername(); | 1909 replacements.ClearUsername(); |
1909 replacements.ClearPassword(); | 1910 replacements.ClearPassword(); |
1910 replacements.ClearRef(); | 1911 replacements.ClearRef(); |
1911 return url.ReplaceComponents(replacements); | 1912 return url.ReplaceComponents(replacements); |
1912 } | 1913 } |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2403 | 2404 |
2404 NetworkInterface::NetworkInterface(const std::string& name, | 2405 NetworkInterface::NetworkInterface(const std::string& name, |
2405 const IPAddressNumber& address) | 2406 const IPAddressNumber& address) |
2406 : name(name), address(address) { | 2407 : name(name), address(address) { |
2407 } | 2408 } |
2408 | 2409 |
2409 NetworkInterface::~NetworkInterface() { | 2410 NetworkInterface::~NetworkInterface() { |
2410 } | 2411 } |
2411 | 2412 |
2412 } // namespace net | 2413 } // namespace net |
OLD | NEW |