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

Side by Side Diff: net/base/filename_util_internal.h

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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
« no previous file with comments | « net/base/filename_util_icu.cc ('k') | net/base/filename_util_internal.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Functions used internally by filename_util, filename_util_icu and
6 // filename_util_unsafe.
7
8 #ifndef NET_BASE_FILENAME_UTIL_INTERNAL_H_
9 #define NET_BASE_FILENAME_UTIL_INTERNAL_H_
10
11 #include <string>
12
13 #include "base/callback.h"
14 #include "base/files/file_path.h"
15 #include "base/strings/string16.h"
16
17 class GURL;
18
19 namespace net {
20
21 typedef base::Callback<
22 void(base::FilePath::StringType* file_name, char replace_char)>
23 ReplaceIllegalCharactersCallback;
24
25 void SanitizeGeneratedFileName(base::FilePath::StringType* filename,
26 bool replace_trailing);
27
28 bool IsShellIntegratedExtension(const base::FilePath::StringType& extension);
29
30 bool IsReservedName(const base::FilePath::StringType& filename);
31
32 void EnsureSafeExtension(const std::string& mime_type,
33 bool ignore_extension,
34 base::FilePath* file_name);
35
36 bool FilePathToString16(const base::FilePath& path, base::string16* converted);
37
38 // Similar to GetSuggestedFilename(), but takes callback to replace illegal
39 // characters.
40 base::string16 GetSuggestedFilenameImpl(
41 const GURL& url,
42 const std::string& content_disposition,
43 const std::string& referrer_charset,
44 const std::string& suggested_name,
45 const std::string& mime_type,
46 const std::string& default_name,
47 ReplaceIllegalCharactersCallback replace_illegal_characters_callback);
48
49 // Similar to GenerateFileName(), but takes callback to replace illegal
50 // characters.
51 base::FilePath GenerateFileNameImpl(
52 const GURL& url,
53 const std::string& content_disposition,
54 const std::string& referrer_charset,
55 const std::string& suggested_name,
56 const std::string& mime_type,
57 const std::string& default_name,
58 ReplaceIllegalCharactersCallback replace_illegal_characters_callback);
59
60 } // namespace net
61
62 #endif // NET_BASE_FILENAME_UTIL_INTERNAL_H_
OLDNEW
« no previous file with comments | « net/base/filename_util_icu.cc ('k') | net/base/filename_util_internal.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698