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

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

Issue 7811006: Add full support for filesystem URLs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Style fixes, removed duplicate set of var Created 8 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
OLDNEW
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 1889 matching lines...) Expand 10 before | Expand all | Expand 10 after
1900 string16 result = FormatUrlWithOffsets(url, languages, format_types, 1900 string16 result = FormatUrlWithOffsets(url, languages, format_types,
1901 unescape_rules, new_parsed, prefix_end, &offsets); 1901 unescape_rules, new_parsed, prefix_end, &offsets);
1902 if (offset_for_adjustment) 1902 if (offset_for_adjustment)
1903 *offset_for_adjustment = offsets[0]; 1903 *offset_for_adjustment = offsets[0];
1904 return result; 1904 return result;
1905 } 1905 }
1906 1906
1907 bool CanStripTrailingSlash(const GURL& url) { 1907 bool CanStripTrailingSlash(const GURL& url) {
1908 // Omit the path only for standard, non-file URLs with nothing but "/" after 1908 // Omit the path only for standard, non-file URLs with nothing but "/" after
1909 // the hostname. 1909 // the hostname.
1910 return url.IsStandard() && !url.SchemeIsFile() && !url.has_query() && 1910 return url.IsStandard() && !url.SchemeIsFile() &&
1911 !url.has_ref() && url.path() == "/"; 1911 !url.SchemeIsFileSystem() && !url.has_query() && !url.has_ref()
1912 && url.path() == "/";
1912 } 1913 }
1913 1914
1914 GURL SimplifyUrlForRequest(const GURL& url) { 1915 GURL SimplifyUrlForRequest(const GURL& url) {
1915 DCHECK(url.is_valid()); 1916 DCHECK(url.is_valid());
1916 GURL::Replacements replacements; 1917 GURL::Replacements replacements;
1917 replacements.ClearUsername(); 1918 replacements.ClearUsername();
1918 replacements.ClearPassword(); 1919 replacements.ClearPassword();
1919 replacements.ClearRef(); 1920 replacements.ClearRef();
1920 return url.ReplaceComponents(replacements); 1921 return url.ReplaceComponents(replacements);
1921 } 1922 }
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
2412 2413
2413 NetworkInterface::NetworkInterface(const std::string& name, 2414 NetworkInterface::NetworkInterface(const std::string& name,
2414 const IPAddressNumber& address) 2415 const IPAddressNumber& address)
2415 : name(name), address(address) { 2416 : name(name), address(address) {
2416 } 2417 }
2417 2418
2418 NetworkInterface::~NetworkInterface() { 2419 NetworkInterface::~NetworkInterface() {
2419 } 2420 }
2420 2421
2421 } // namespace net 2422 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698