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

Side by Side Diff: base/path_service.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 | « base/nix/mime_util_xdg.cc ('k') | base/rand_util_posix.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 "base/path_service.h" 5 #include "base/path_service.h"
6 6
7 #ifdef OS_WIN 7 #ifdef OS_WIN
8 #include <windows.h> 8 #include <windows.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #include <shlobj.h> 10 #include <shlobj.h>
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 Provider* p = providers; 127 Provider* p = providers;
128 while (p) { 128 while (p) {
129 Provider* next = p->next; 129 Provider* next = p->next;
130 if (!p->is_static) 130 if (!p->is_static)
131 delete p; 131 delete p;
132 p = next; 132 p = next;
133 } 133 }
134 } 134 }
135 }; 135 };
136 136
137 static base::LazyInstance<PathData> g_path_data(base::LINKER_INITIALIZED); 137 static base::LazyInstance<PathData> g_path_data = LAZY_INSTANCE_INITIALIZER;
138 138
139 static PathData* GetPathData() { 139 static PathData* GetPathData() {
140 return g_path_data.Pointer(); 140 return g_path_data.Pointer();
141 } 141 }
142 142
143 } // namespace 143 } // namespace
144 144
145 145
146 // static 146 // static
147 bool PathService::GetFromCache(int key, FilePath* result) { 147 bool PathService::GetFromCache(int key, FilePath* result) {
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 p = new Provider; 275 p = new Provider;
276 p->is_static = false; 276 p->is_static = false;
277 p->func = func; 277 p->func = func;
278 p->next = path_data->providers; 278 p->next = path_data->providers;
279 #ifndef NDEBUG 279 #ifndef NDEBUG
280 p->key_start = key_start; 280 p->key_start = key_start;
281 p->key_end = key_end; 281 p->key_end = key_end;
282 #endif 282 #endif
283 path_data->providers = p; 283 path_data->providers = p;
284 } 284 }
OLDNEW
« no previous file with comments | « base/nix/mime_util_xdg.cc ('k') | base/rand_util_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698