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

Side by Side Diff: base/mime_util_xdg.cc

Issue 8491043: Allow linker initialization of lazy instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: thakis comment, renamed LAZY_INSTANCE_INITIALIZER 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
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 "base/mime_util.h" 5 #include "base/mime_util.h"
6 6
7 7
8 #include <cstdlib> 8 #include <cstdlib>
9 #include <list> 9 #include <list>
10 #include <map> 10 #include <map>
(...skipping 17 matching lines...) Expand all
28 #if defined(TOOLKIT_USES_GTK) 28 #if defined(TOOLKIT_USES_GTK)
29 #include <gtk/gtk.h> 29 #include <gtk/gtk.h>
30 #endif 30 #endif
31 31
32 namespace { 32 namespace {
33 33
34 // None of the XDG stuff is thread-safe, so serialize all access under 34 // None of the XDG stuff is thread-safe, so serialize all access under
35 // this lock. 35 // this lock.
36 static base::LazyInstance<base::Lock, 36 static base::LazyInstance<base::Lock,
37 base::LeakyLazyInstanceTraits<base::Lock> > 37 base::LeakyLazyInstanceTraits<base::Lock> >
38 g_mime_util_xdg_lock(base::LINKER_INITIALIZED); 38 g_mime_util_xdg_lock = LAZY_INSTANCE_INITIALIZER;
39 39
40 class IconTheme; 40 class IconTheme;
41 41
42 class MimeUtilConstants { 42 class MimeUtilConstants {
43 public: 43 public:
44 typedef std::map<std::string, IconTheme*> IconThemeMap; 44 typedef std::map<std::string, IconTheme*> IconThemeMap;
45 typedef std::map<FilePath, base::Time> IconDirMtimeMap; 45 typedef std::map<FilePath, base::Time> IconDirMtimeMap;
46 typedef std::vector<std::string> IconFormats; 46 typedef std::vector<std::string> IconFormats;
47 47
48 // Specified by XDG icon theme specs. 48 // Specified by XDG icon theme specs.
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 } else { 666 } else {
667 icon_file = LookupIconInDefaultTheme(icon_names[i], size); 667 icon_file = LookupIconInDefaultTheme(icon_names[i], size);
668 if (!icon_file.empty()) 668 if (!icon_file.empty())
669 return icon_file; 669 return icon_file;
670 } 670 }
671 } 671 }
672 return FilePath(); 672 return FilePath();
673 } 673 }
674 674
675 } // namespace mime_util 675 } // namespace mime_util
OLDNEW
« base/lazy_instance.cc ('K') | « base/message_loop.cc ('k') | base/path_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698