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 1890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1901 string16 result = FormatUrlWithOffsets(url, languages, format_types, | 1901 string16 result = FormatUrlWithOffsets(url, languages, format_types, |
1902 unescape_rules, new_parsed, prefix_end, &offsets); | 1902 unescape_rules, new_parsed, prefix_end, &offsets); |
1903 if (offset_for_adjustment) | 1903 if (offset_for_adjustment) |
1904 *offset_for_adjustment = offsets[0]; | 1904 *offset_for_adjustment = offsets[0]; |
1905 return result; | 1905 return result; |
1906 } | 1906 } |
1907 | 1907 |
1908 bool CanStripTrailingSlash(const GURL& url) { | 1908 bool CanStripTrailingSlash(const GURL& url) { |
1909 // Omit the path only for standard, non-file URLs with nothing but "/" after | 1909 // Omit the path only for standard, non-file URLs with nothing but "/" after |
1910 // the hostname. | 1910 // the hostname. |
1911 return url.IsStandard() && !url.SchemeIsFile() && !url.has_query() && | 1911 return url.IsStandard() && !url.SchemeIsFile() && |
1912 !url.has_ref() && url.path() == "/"; | 1912 !url.SchemeIsFileSystem() && !url.has_query() && !url.has_ref() |
| 1913 && url.path() == "/"; |
1913 } | 1914 } |
1914 | 1915 |
1915 GURL SimplifyUrlForRequest(const GURL& url) { | 1916 GURL SimplifyUrlForRequest(const GURL& url) { |
1916 DCHECK(url.is_valid()); | 1917 DCHECK(url.is_valid()); |
1917 GURL::Replacements replacements; | 1918 GURL::Replacements replacements; |
1918 replacements.ClearUsername(); | 1919 replacements.ClearUsername(); |
1919 replacements.ClearPassword(); | 1920 replacements.ClearPassword(); |
1920 replacements.ClearRef(); | 1921 replacements.ClearRef(); |
1921 return url.ReplaceComponents(replacements); | 1922 return url.ReplaceComponents(replacements); |
1922 } | 1923 } |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2413 | 2414 |
2414 NetworkInterface::NetworkInterface(const std::string& name, | 2415 NetworkInterface::NetworkInterface(const std::string& name, |
2415 const IPAddressNumber& address) | 2416 const IPAddressNumber& address) |
2416 : name(name), address(address) { | 2417 : name(name), address(address) { |
2417 } | 2418 } |
2418 | 2419 |
2419 NetworkInterface::~NetworkInterface() { | 2420 NetworkInterface::~NetworkInterface() { |
2420 } | 2421 } |
2421 | 2422 |
2422 } // namespace net | 2423 } // namespace net |
OLD | NEW |