summaryrefslogtreecommitdiffstats
path: root/net/base/net_util.h
diff options
context:
space:
mode:
authorasanka@chromium.org <asanka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-12 17:10:20 +0000
committerasanka@chromium.org <asanka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-12 17:10:20 +0000
commit7723edefb48e032bf961dc65240de8ffa75a6886 (patch)
treeeec1e0ae815710d4441fbd9dd8651f042ebcd256 /net/base/net_util.h
parent88c97fb2d45c72c92c26e9292046c7bd061d0149 (diff)
downloadchromium_src-7723edefb48e032bf961dc65240de8ffa75a6886.zip
chromium_src-7723edefb48e032bf961dc65240de8ffa75a6886.tar.gz
chromium_src-7723edefb48e032bf961dc65240de8ffa75a6886.tar.bz2
Overwrite extensions of filenames determined from URLs if the URL could be a generator script.
BUG=61571 TEST=net_unittests --gtest_filter=NetUtilTest.GenerateSafeFileName:NetUtilTest.GenerateFileName Review URL: http://codereview.chromium.org/7812006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100709 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/net_util.h')
-rw-r--r--net/base/net_util.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/base/net_util.h b/net/base/net_util.h
index 3384017..2e7a8f0 100644
--- a/net/base/net_util.h
+++ b/net/base/net_util.h
@@ -292,8 +292,8 @@ NET_EXPORT FilePath GenerateFileName(const GURL& url,
// Windows if the extension causes the file to have an unsafe interaction with
// the shell (see net_util::IsShellIntegratedExtension()), then it will be
// replaced by the string 'download'. If |file_path| doesn't contain an
-// extension and |mime_type| is non-empty, the preferred extension for
-// |mime_type| will be used as the extension.
+// extension or |ignore_extension| is true then the preferred extension, if one
+// exists, for |mime_type| will be used as the extension.
//
// On Windows, the filename will be checked against a set of reserved names, and
// if so, an underscore will be prepended to the name.
@@ -304,6 +304,7 @@ NET_EXPORT FilePath GenerateFileName(const GURL& url,
// Note: |mime_type| should only be non-empty if this function is called from a
// thread that allows IO.
NET_EXPORT void GenerateSafeFileName(const std::string& mime_type,
+ bool ignore_extension,
FilePath* file_path);
// Checks the given port against a list of ports which are restricted by