OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef BASE_PATH_SERVICE_H__ | 5 #ifndef BASE_PATH_SERVICE_H__ |
6 #define BASE_PATH_SERVICE_H__ | 6 #define BASE_PATH_SERVICE_H__ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #ifdef OS_WIN | 9 #ifdef OS_WIN |
10 // TODO(erikkay): this should be removable, but because SetCurrentDirectory | 10 // TODO(erikkay): this should be removable, but because SetCurrentDirectory |
11 // is the name of a Windows function, it gets macro-ized to SetCurrentDirectoryW | 11 // is the name of a Windows function, it gets macro-ized to SetCurrentDirectoryW |
12 // by windows.h, which leads to a different name in the header vs. the impl. | 12 // by windows.h, which leads to a different name in the header vs. the impl. |
13 // Even if we could fix that, it would still hose all callers of the function. | 13 // Even if we could fix that, it would still hose all callers of the function. |
14 // The right thing is likely to rename. | 14 // The right thing is likely to rename. |
15 #include <windows.h> | 15 #include <windows.h> |
16 #endif | 16 #endif |
17 | 17 |
| 18 #include <cstring> |
18 #include <string> | 19 #include <string> |
19 | 20 |
20 #include "base/base_paths.h" | 21 #include "base/base_paths.h" |
21 | 22 |
22 class FilePath; | 23 class FilePath; |
23 | 24 |
24 // The path service is a global table mapping keys to file system paths. It is | 25 // The path service is a global table mapping keys to file system paths. It is |
25 // OK to use this service from multiple threads. | 26 // OK to use this service from multiple threads. |
26 // | 27 // |
27 class PathService { | 28 class PathService { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 static void RegisterProvider(ProviderFunc provider, | 72 static void RegisterProvider(ProviderFunc provider, |
72 int key_start, | 73 int key_start, |
73 int key_end); | 74 int key_end); |
74 private: | 75 private: |
75 static bool GetFromCache(int key, FilePath* path); | 76 static bool GetFromCache(int key, FilePath* path); |
76 static void AddToCache(int key, const FilePath& path); | 77 static void AddToCache(int key, const FilePath& path); |
77 | 78 |
78 }; | 79 }; |
79 | 80 |
80 #endif // BASE_PATH_SERVICE_H__ | 81 #endif // BASE_PATH_SERVICE_H__ |
OLD | NEW |