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

Side by Side Diff: components/mime_util/mime_util.cc

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: Created 3 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/mime_util/mime_util.h" 5 #include "components/mime_util/mime_util.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/containers/hash_tables.h" 9 #include "base/containers/hash_tables.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 class MimeUtil { 105 class MimeUtil {
106 public: 106 public:
107 bool IsSupportedImageMimeType(const std::string& mime_type) const; 107 bool IsSupportedImageMimeType(const std::string& mime_type) const;
108 bool IsSupportedNonImageMimeType(const std::string& mime_type) const; 108 bool IsSupportedNonImageMimeType(const std::string& mime_type) const;
109 bool IsUnsupportedTextMimeType(const std::string& mime_type) const; 109 bool IsUnsupportedTextMimeType(const std::string& mime_type) const;
110 bool IsSupportedJavascriptMimeType(const std::string& mime_type) const; 110 bool IsSupportedJavascriptMimeType(const std::string& mime_type) const;
111 111
112 bool IsSupportedMimeType(const std::string& mime_type) const; 112 bool IsSupportedMimeType(const std::string& mime_type) const;
113 113
114 private: 114 private:
115 friend struct base::DefaultLazyInstanceTraits<MimeUtil>; 115 friend struct base::LazyInstanceTraitsBase<MimeUtil>;
116 116
117 using MimeTypes = base::hash_set<std::string>; 117 using MimeTypes = base::hash_set<std::string>;
118 118
119 MimeUtil(); 119 MimeUtil();
120 120
121 MimeTypes image_types_; 121 MimeTypes image_types_;
122 MimeTypes non_image_types_; 122 MimeTypes non_image_types_;
123 MimeTypes unsupported_text_types_; 123 MimeTypes unsupported_text_types_;
124 MimeTypes javascript_types_; 124 MimeTypes javascript_types_;
125 125
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 194
195 bool IsSupportedJavascriptMimeType(const std::string& mime_type) { 195 bool IsSupportedJavascriptMimeType(const std::string& mime_type) {
196 return g_mime_util.Get().IsSupportedJavascriptMimeType(mime_type); 196 return g_mime_util.Get().IsSupportedJavascriptMimeType(mime_type);
197 } 197 }
198 198
199 bool IsSupportedMimeType(const std::string& mime_type) { 199 bool IsSupportedMimeType(const std::string& mime_type) {
200 return g_mime_util.Get().IsSupportedMimeType(mime_type); 200 return g_mime_util.Get().IsSupportedMimeType(mime_type);
201 } 201 }
202 202
203 } // namespace mime_util 203 } // namespace mime_util
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698