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 #ifndef BASE_PATH_SERVICE_H_ | 5 #ifndef BASE_PATH_SERVICE_H_ |
6 #define BASE_PATH_SERVICE_H_ | 6 #define BASE_PATH_SERVICE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 // WARNING: This function could be called on any thread from which the | 48 // WARNING: This function could be called on any thread from which the |
49 // PathService is used, so a the ProviderFunc MUST BE THREADSAFE. | 49 // PathService is used, so a the ProviderFunc MUST BE THREADSAFE. |
50 // | 50 // |
51 typedef bool (*ProviderFunc)(int, FilePath*); | 51 typedef bool (*ProviderFunc)(int, FilePath*); |
52 | 52 |
53 // Call to register a path provider. You must specify the range "[key_start, | 53 // Call to register a path provider. You must specify the range "[key_start, |
54 // key_end)" of supported path keys. | 54 // key_end)" of supported path keys. |
55 static void RegisterProvider(ProviderFunc provider, | 55 static void RegisterProvider(ProviderFunc provider, |
56 int key_start, | 56 int key_start, |
57 int key_end); | 57 int key_end); |
| 58 // Call to unregister a path provider. |
| 59 static void UnregisterProvider(ProviderFunc provider); |
58 private: | 60 private: |
59 static bool GetFromCache(int key, FilePath* path); | 61 static bool GetFromCache(int key, FilePath* path); |
60 static bool GetFromOverrides(int key, FilePath* path); | 62 static bool GetFromOverrides(int key, FilePath* path); |
61 static void AddToCache(int key, const FilePath& path); | 63 static void AddToCache(int key, const FilePath& path); |
62 }; | 64 }; |
63 | 65 |
64 #endif // BASE_PATH_SERVICE_H_ | 66 #endif // BASE_PATH_SERVICE_H_ |
OLD | NEW |