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/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 Loading... |
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 Loading... |
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 } |
OLD | NEW |