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

Side by Side Diff: chrome/browser/resources_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
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 "chrome/browser/resources_util.h" 5 #include "chrome/browser/resources_util.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/hash_tables.h" 9 #include "base/hash_tables.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 23 matching lines...) Expand all
34 StringIntMap::const_iterator it = id_map_.find(resource_name); 34 StringIntMap::const_iterator it = id_map_.find(resource_name);
35 if (it == id_map_.end()) 35 if (it == id_map_.end())
36 return -1; 36 return -1;
37 return it->second; 37 return it->second;
38 } 38 }
39 39
40 private: 40 private:
41 StringIntMap id_map_; 41 StringIntMap id_map_;
42 }; 42 };
43 43
44 static base::LazyInstance<ThemeMap> g_theme_ids(base::LINKER_INITIALIZED); 44 static base::LazyInstance<ThemeMap> g_theme_ids = LAZY_INSTANCE_INITIALIZER;
45 45
46 } // namespace 46 } // namespace
47 47
48 int ResourcesUtil::GetThemeResourceId(const std::string& resource_name) { 48 int ResourcesUtil::GetThemeResourceId(const std::string& resource_name) {
49 return g_theme_ids.Get().GetId(resource_name); 49 return g_theme_ids.Get().GetId(resource_name);
50 } 50 }
OLDNEW
« no previous file with comments | « chrome/browser/printing/printing_message_filter.cc ('k') | chrome/browser/safe_browsing/malware_details.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698