OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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> |
11 #endif | 11 #endif |
12 | 12 |
13 #include "base/file_path.h" | 13 #include "base/file_path.h" |
14 #include "base/file_util.h" | 14 #include "base/file_util.h" |
15 #include "base/hash_tables.h" | 15 #include "base/hash_tables.h" |
16 #include "base/lazy_instance.h" | 16 #include "base/lazy_instance.h" |
17 #include "base/logging.h" | 17 #include "base/logging.h" |
18 #include "base/synchronization/lock.h" | 18 #include "base/synchronization/lock.h" |
19 | 19 |
| 20 using base::FilePath; |
| 21 |
20 namespace base { | 22 namespace base { |
21 bool PathProvider(int key, FilePath* result); | 23 bool PathProvider(int key, FilePath* result); |
22 #if defined(OS_WIN) | 24 #if defined(OS_WIN) |
23 bool PathProviderWin(int key, FilePath* result); | 25 bool PathProviderWin(int key, FilePath* result); |
24 #elif defined(OS_MACOSX) | 26 #elif defined(OS_MACOSX) |
25 bool PathProviderMac(int key, FilePath* result); | 27 bool PathProviderMac(int key, FilePath* result); |
26 #elif defined(OS_ANDROID) | 28 #elif defined(OS_ANDROID) |
27 bool PathProviderAndroid(int key, FilePath* result); | 29 bool PathProviderAndroid(int key, FilePath* result); |
28 #elif defined(OS_POSIX) | 30 #elif defined(OS_POSIX) |
29 // PathProviderPosix is the default path provider on POSIX OSes other than | 31 // PathProviderPosix is the default path provider on POSIX OSes other than |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 | 327 |
326 // static | 328 // static |
327 void PathService::DisableCache() { | 329 void PathService::DisableCache() { |
328 PathData* path_data = GetPathData(); | 330 PathData* path_data = GetPathData(); |
329 DCHECK(path_data); | 331 DCHECK(path_data); |
330 | 332 |
331 base::AutoLock scoped_lock(path_data->lock); | 333 base::AutoLock scoped_lock(path_data->lock); |
332 path_data->cache.clear(); | 334 path_data->cache.clear(); |
333 path_data->cache_disabled = true; | 335 path_data->cache_disabled = true; |
334 } | 336 } |
OLD | NEW |