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

Side by Side Diff: net/base/mime_util.cc

Issue 8491043: Allow linker initialization of lazy instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: willchan comments + rebase Created 9 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « net/base/ev_root_ca_metadata.cc ('k') | net/base/net_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/base/ev_root_ca_metadata.cc ('k') | net/base/net_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698