diff options
author | ericu@google.com <ericu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-24 16:56:58 +0000 |
---|---|---|
committer | ericu@google.com <ericu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-24 16:56:58 +0000 |
commit | 932df839a6562730cd741f24fc469606d9d9ffb7 (patch) | |
tree | 2c244f93639d2c0f50e6e917cc01ea33fd637a43 /net | |
parent | 3bfc16cf47deae24f43b3967edf769112a674482 (diff) | |
download | chromium_src-932df839a6562730cd741f24fc469606d9d9ffb7.zip chromium_src-932df839a6562730cd741f24fc469606d9d9ffb7.tar.gz chromium_src-932df839a6562730cd741f24fc469606d9d9ffb7.tar.bz2 |
Add full support for filesystem URLs.
BUG=114484
TEST=existing filesystem tests don't break
Review URL: https://chromiumcodereview.appspot.com/7811006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128753 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/base/mime_sniffer.cc | 6 | ||||
-rw-r--r-- | net/base/net_util.cc | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/net/base/mime_sniffer.cc b/net/base/mime_sniffer.cc index b0b6d03..a6f8198 100644 --- a/net/base/mime_sniffer.cc +++ b/net/base/mime_sniffer.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -567,12 +567,12 @@ bool ShouldSniffMimeType(const GURL& url, const std::string& mime_type) { if (!should_sniff_counter) should_sniff_counter = UMASnifferHistogramGet("mime_sniffer.ShouldSniffMimeType2", 3); - // We are willing to sniff the mime type for HTTP, HTTPS, and FTP bool sniffable_scheme = url.is_empty() || url.SchemeIs("http") || url.SchemeIs("https") || url.SchemeIs("ftp") || - url.SchemeIsFile(); + url.SchemeIsFile() || + url.SchemeIsFileSystem(); if (!sniffable_scheme) { should_sniff_counter->Add(1); return false; diff --git a/net/base/net_util.cc b/net/base/net_util.cc index 2ba3b46..5fd3ddb 100644 --- a/net/base/net_util.cc +++ b/net/base/net_util.cc @@ -1907,8 +1907,9 @@ string16 FormatUrl(const GURL& url, bool CanStripTrailingSlash(const GURL& url) { // Omit the path only for standard, non-file URLs with nothing but "/" after // the hostname. - return url.IsStandard() && !url.SchemeIsFile() && !url.has_query() && - !url.has_ref() && url.path() == "/"; + return url.IsStandard() && !url.SchemeIsFile() && + !url.SchemeIsFileSystem() && !url.has_query() && !url.has_ref() + && url.path() == "/"; } GURL SimplifyUrlForRequest(const GURL& url) { |