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

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: Better content_settings_pattern.cc changes. Created 9 years 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) 2011 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 #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 1933 matching lines...) Expand 10 before | Expand all | Expand 10 after
1944 string16 result = FormatUrlWithOffsets(url, languages, format_types, 1944 string16 result = FormatUrlWithOffsets(url, languages, format_types,
1945 unescape_rules, new_parsed, prefix_end, &offsets); 1945 unescape_rules, new_parsed, prefix_end, &offsets);
1946 if (offset_for_adjustment) 1946 if (offset_for_adjustment)
1947 *offset_for_adjustment = offsets[0]; 1947 *offset_for_adjustment = offsets[0];
1948 return result; 1948 return result;
1949 } 1949 }
1950 1950
1951 bool CanStripTrailingSlash(const GURL& url) { 1951 bool CanStripTrailingSlash(const GURL& url) {
1952 // Omit the path only for standard, non-file URLs with nothing but "/" after 1952 // Omit the path only for standard, non-file URLs with nothing but "/" after
1953 // the hostname. 1953 // the hostname.
1954 return url.IsStandard() && !url.SchemeIsFile() && !url.has_query() && 1954 return url.IsStandard() && !url.SchemeIsFile() &&
1955 !url.has_ref() && url.path() == "/"; 1955 !url.SchemeIsFileSystem() && !url.has_query() && !url.has_ref()
1956 && url.path() == "/";
1956 } 1957 }
1957 1958
1958 GURL SimplifyUrlForRequest(const GURL& url) { 1959 GURL SimplifyUrlForRequest(const GURL& url) {
1959 DCHECK(url.is_valid()); 1960 DCHECK(url.is_valid());
1960 GURL::Replacements replacements; 1961 GURL::Replacements replacements;
1961 replacements.ClearUsername(); 1962 replacements.ClearUsername();
1962 replacements.ClearPassword(); 1963 replacements.ClearPassword();
1963 replacements.ClearRef(); 1964 replacements.ClearRef();
1964 return url.ReplaceComponents(replacements); 1965 return url.ReplaceComponents(replacements);
1965 } 1966 }
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
2454 2455
2455 NetworkInterface::NetworkInterface(const std::string& name, 2456 NetworkInterface::NetworkInterface(const std::string& name,
2456 const IPAddressNumber& address) 2457 const IPAddressNumber& address)
2457 : name(name), address(address) { 2458 : name(name), address(address) {
2458 } 2459 }
2459 2460
2460 NetworkInterface::~NetworkInterface() { 2461 NetworkInterface::~NetworkInterface() {
2461 } 2462 }
2462 2463
2463 } // namespace net 2464 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698