OLD | NEW |
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 <algorithm> | 5 #include <algorithm> |
6 #include <iterator> | 6 #include <iterator> |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <unordered_set> | 9 #include <unordered_set> |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... |
41 bool MatchesMimeType(const std::string &mime_type_pattern, | 41 bool MatchesMimeType(const std::string &mime_type_pattern, |
42 const std::string &mime_type) const; | 42 const std::string &mime_type) const; |
43 | 43 |
44 bool ParseMimeTypeWithoutParameter(const std::string& type_string, | 44 bool ParseMimeTypeWithoutParameter(const std::string& type_string, |
45 std::string* top_level_type, | 45 std::string* top_level_type, |
46 std::string* subtype) const; | 46 std::string* subtype) const; |
47 | 47 |
48 bool IsValidTopLevelMimeType(const std::string& type_string) const; | 48 bool IsValidTopLevelMimeType(const std::string& type_string) const; |
49 | 49 |
50 private: | 50 private: |
51 friend struct base::DefaultLazyInstanceTraits<MimeUtil>; | 51 friend struct base::LazyInstanceTraitsBase<MimeUtil>; |
52 | 52 |
53 MimeUtil(); | 53 MimeUtil(); |
54 | 54 |
55 bool GetMimeTypeFromExtensionHelper(const base::FilePath::StringType& ext, | 55 bool GetMimeTypeFromExtensionHelper(const base::FilePath::StringType& ext, |
56 bool include_platform_types, | 56 bool include_platform_types, |
57 std::string* mime_type) const; | 57 std::string* mime_type) const; |
58 }; // class MimeUtil | 58 }; // class MimeUtil |
59 | 59 |
60 // This variable is Leaky because we need to access it from WorkerPool threads. | 60 // This variable is Leaky because we need to access it from WorkerPool threads. |
61 static base::LazyInstance<MimeUtil>::Leaky g_mime_util = | 61 static base::LazyInstance<MimeUtil>::Leaky g_mime_util = |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
638 post_data->append("\r\n" + value + "\r\n"); | 638 post_data->append("\r\n" + value + "\r\n"); |
639 } | 639 } |
640 | 640 |
641 void AddMultipartFinalDelimiterForUpload(const std::string& mime_boundary, | 641 void AddMultipartFinalDelimiterForUpload(const std::string& mime_boundary, |
642 std::string* post_data) { | 642 std::string* post_data) { |
643 DCHECK(post_data); | 643 DCHECK(post_data); |
644 post_data->append("--" + mime_boundary + "--\r\n"); | 644 post_data->append("--" + mime_boundary + "--\r\n"); |
645 } | 645 } |
646 | 646 |
647 } // namespace net | 647 } // namespace net |
OLD | NEW |