| 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 "base/mime_util.h" | 5 #include "base/mime_util.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 #include <sys/time.h> | 8 #include <sys/time.h> |
| 9 #include <time.h> | 9 #include <time.h> |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "base/string_split.h" | 22 #include "base/string_split.h" |
| 23 #include "base/string_util.h" | 23 #include "base/string_util.h" |
| 24 #include "base/synchronization/lock.h" | 24 #include "base/synchronization/lock.h" |
| 25 #include "base/third_party/xdg_mime/xdgmime.h" | 25 #include "base/third_party/xdg_mime/xdgmime.h" |
| 26 #include "base/threading/thread_restrictions.h" | 26 #include "base/threading/thread_restrictions.h" |
| 27 | 27 |
| 28 namespace { | 28 namespace { |
| 29 | 29 |
| 30 // None of the XDG stuff is thread-safe, so serialize all access under | 30 // None of the XDG stuff is thread-safe, so serialize all access under |
| 31 // this lock. | 31 // this lock. |
| 32 static base::LazyInstance<base::Lock> | 32 static base::LazyInstance<base::Lock, |
| 33 g_mime_util_xdg_lock(base::LINKER_INITIALIZED); | 33 base::LeakyLazyInstanceTraits<base::Lock> > |
| 34 g_mime_util_xdg_lock(base::LINKER_INITIALIZED); |
| 34 | 35 |
| 35 class IconTheme; | 36 class IconTheme; |
| 36 | 37 |
| 37 class MimeUtilConstants { | 38 class MimeUtilConstants { |
| 38 public: | 39 public: |
| 39 typedef std::map<std::string, IconTheme*> IconThemeMap; | 40 typedef std::map<std::string, IconTheme*> IconThemeMap; |
| 40 typedef std::map<FilePath, int> IconDirMtimeMap; | 41 typedef std::map<FilePath, int> IconDirMtimeMap; |
| 41 typedef std::vector<std::string> IconFormats; | 42 typedef std::vector<std::string> IconFormats; |
| 42 | 43 |
| 43 // In seconds, specified by icon theme specs. | 44 // In seconds, specified by icon theme specs. |
| (...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 } else { | 634 } else { |
| 634 icon_file = LookupIconInDefaultTheme(icon_names[i], size); | 635 icon_file = LookupIconInDefaultTheme(icon_names[i], size); |
| 635 if (!icon_file.empty()) | 636 if (!icon_file.empty()) |
| 636 return icon_file; | 637 return icon_file; |
| 637 } | 638 } |
| 638 } | 639 } |
| 639 return FilePath(); | 640 return FilePath(); |
| 640 } | 641 } |
| 641 | 642 |
| 642 } // namespace mime_util | 643 } // namespace mime_util |
| OLD | NEW |