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

Side by Side Diff: base/path_service.h

Issue 3169031: Revert 56738 - Fix CheckFalseTest.CheckFails on Linux after my change to ui_t... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 4 months 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 #pragma once 7 #pragma once
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 10
(...skipping 27 matching lines...) Expand all
38 // path specifies a directory that does not exist, the directory will be 38 // path specifies a directory that does not exist, the directory will be
39 // created by this method. This method returns true if successful. 39 // created by this method. This method returns true if successful.
40 // 40 //
41 // If the given path is relative, then it will be resolved against 41 // If the given path is relative, then it will be resolved against
42 // DIR_CURRENT. 42 // DIR_CURRENT.
43 // 43 //
44 // WARNING: Consumers of PathService::Get may expect paths to be constant 44 // WARNING: Consumers of PathService::Get may expect paths to be constant
45 // over the lifetime of the app, so this method should be used with caution. 45 // over the lifetime of the app, so this method should be used with caution.
46 static bool Override(int key, const FilePath& path); 46 static bool Override(int key, const FilePath& path);
47 47
48 // Return whether a path was overridden.
49 static bool IsOverridden(int key);
50
48 // To extend the set of supported keys, you can register a path provider, 51 // To extend the set of supported keys, you can register a path provider,
49 // which is just a function mirroring PathService::Get. The ProviderFunc 52 // which is just a function mirroring PathService::Get. The ProviderFunc
50 // returns false if it cannot provide a non-empty path for the given key. 53 // returns false if it cannot provide a non-empty path for the given key.
51 // Otherwise, true is returned. 54 // Otherwise, true is returned.
52 // 55 //
53 // WARNING: This function could be called on any thread from which the 56 // WARNING: This function could be called on any thread from which the
54 // PathService is used, so a the ProviderFunc MUST BE THREADSAFE. 57 // PathService is used, so a the ProviderFunc MUST BE THREADSAFE.
55 // 58 //
56 typedef bool (*ProviderFunc)(int, FilePath*); 59 typedef bool (*ProviderFunc)(int, FilePath*);
57 60
58 // Call to register a path provider. You must specify the range "[key_start, 61 // Call to register a path provider. You must specify the range "[key_start,
59 // key_end)" of supported path keys. 62 // key_end)" of supported path keys.
60 static void RegisterProvider(ProviderFunc provider, 63 static void RegisterProvider(ProviderFunc provider,
61 int key_start, 64 int key_start,
62 int key_end); 65 int key_end);
63 private: 66 private:
64 static bool GetFromCache(int key, FilePath* path); 67 static bool GetFromCache(int key, FilePath* path);
65 static bool GetFromOverrides(int key, FilePath* path);
66 static void AddToCache(int key, const FilePath& path); 68 static void AddToCache(int key, const FilePath& path);
67 }; 69 };
68 70
69 #endif // BASE_PATH_SERVICE_H_ 71 #endif // BASE_PATH_SERVICE_H_
OLDNEW
« no previous file with comments | « no previous file | base/path_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698