OLD | NEW |
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 <map> | 5 #include <map> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "net/base/mime_util.h" | 8 #include "net/base/mime_util.h" |
9 #include "net/base/platform_mime_util.h" | 9 #include "net/base/platform_mime_util.h" |
10 | 10 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 MimeMappings media_map_; | 71 MimeMappings media_map_; |
72 MimeMappings non_image_map_; | 72 MimeMappings non_image_map_; |
73 MimeMappings javascript_map_; | 73 MimeMappings javascript_map_; |
74 MimeMappings view_source_map_; | 74 MimeMappings view_source_map_; |
75 MimeMappings codecs_map_; | 75 MimeMappings codecs_map_; |
76 | 76 |
77 typedef std::map<std::string, base::hash_set<std::string> > StrictMappings; | 77 typedef std::map<std::string, base::hash_set<std::string> > StrictMappings; |
78 StrictMappings strict_format_map_; | 78 StrictMappings strict_format_map_; |
79 }; // class MimeUtil | 79 }; // class MimeUtil |
80 | 80 |
81 static base::LazyInstance<MimeUtil> g_mime_util(base::LINKER_INITIALIZED); | 81 static base::LazyInstance<MimeUtil> g_mime_util = LAZY_INSTANCE_INITIALIZER; |
82 | 82 |
83 struct MimeInfo { | 83 struct MimeInfo { |
84 const char* mime_type; | 84 const char* mime_type; |
85 const char* extensions; // comma separated list | 85 const char* extensions; // comma separated list |
86 }; | 86 }; |
87 | 87 |
88 static const MimeInfo primary_mappings[] = { | 88 static const MimeInfo primary_mappings[] = { |
89 { "text/html", "html,htm" }, | 89 { "text/html", "html,htm" }, |
90 { "text/css", "css" }, | 90 { "text/css", "css" }, |
91 { "text/xml", "xml" }, | 91 { "text/xml", "xml" }, |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 | 741 |
742 GetExtensionsFromHardCodedMappings(secondary_mappings, | 742 GetExtensionsFromHardCodedMappings(secondary_mappings, |
743 arraysize(secondary_mappings), | 743 arraysize(secondary_mappings), |
744 mime_type, | 744 mime_type, |
745 &unique_extensions); | 745 &unique_extensions); |
746 | 746 |
747 HashSetToVector(&unique_extensions, extensions); | 747 HashSetToVector(&unique_extensions, extensions); |
748 } | 748 } |
749 | 749 |
750 } // namespace net | 750 } // namespace net |
OLD | NEW |