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

Side by Side Diff: base/path_service.h

Issue 11252: Move more code to using FilePath. (Closed)
Patch Set: rebased Created 12 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
« no previous file with comments | « base/base_paths_win.cc ('k') | base/path_service.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) 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
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 static bool SetCurrentDirectory(const std::wstring& current_directory); 56 static bool SetCurrentDirectory(const std::wstring& current_directory);
57 57
58 // To extend the set of supported keys, you can register a path provider, 58 // To extend the set of supported keys, you can register a path provider,
59 // which is just a function mirroring PathService::Get. The ProviderFunc 59 // which is just a function mirroring PathService::Get. The ProviderFunc
60 // returns false if it cannot provide a non-empty path for the given key. 60 // returns false if it cannot provide a non-empty path for the given key.
61 // Otherwise, true is returned. 61 // Otherwise, true is returned.
62 // 62 //
63 // WARNING: This function could be called on any thread from which the 63 // WARNING: This function could be called on any thread from which the
64 // PathService is used, so a the ProviderFunc MUST BE THREADSAFE. 64 // PathService is used, so a the ProviderFunc MUST BE THREADSAFE.
65 // 65 //
66 typedef bool (*ProviderFunc)(int, std::wstring*); 66 typedef bool (*ProviderFunc)(int, FilePath*);
67 67
68 // Call to register a path provider. You must specify the range "[key_start, 68 // Call to register a path provider. You must specify the range "[key_start,
69 // key_end)" of supported path keys. 69 // key_end)" of supported path keys.
70 static void RegisterProvider(ProviderFunc provider, 70 static void RegisterProvider(ProviderFunc provider,
71 int key_start, 71 int key_start,
72 int key_end); 72 int key_end);
73 private: 73 private:
74 static bool GetFromCache(int key, FilePath* path); 74 static bool GetFromCache(int key, FilePath* path);
75 static void AddToCache(int key, const FilePath& path); 75 static void AddToCache(int key, const FilePath& path);
76 76
77 }; 77 };
78 78
79 #endif // BASE_PATH_SERVICE_H__ 79 #endif // BASE_PATH_SERVICE_H__
80 80
OLDNEW
« no previous file with comments | « base/base_paths_win.cc ('k') | base/path_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698