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

Side by Side Diff: base/path_service.h

Issue 2805100: Fix CheckFalseTest.CheckFails on Linux after my change to ui_test. (Closed)
Patch Set: final Created 10 years, 3 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
« no previous file with comments | « no previous file | base/path_service.cc » ('j') | chrome/browser/profile_impl.cc » ('J')
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
51 // To extend the set of supported keys, you can register a path provider, 48 // To extend the set of supported keys, you can register a path provider,
52 // which is just a function mirroring PathService::Get. The ProviderFunc 49 // which is just a function mirroring PathService::Get. The ProviderFunc
53 // returns false if it cannot provide a non-empty path for the given key. 50 // returns false if it cannot provide a non-empty path for the given key.
54 // Otherwise, true is returned. 51 // Otherwise, true is returned.
55 // 52 //
56 // WARNING: This function could be called on any thread from which the 53 // WARNING: This function could be called on any thread from which the
57 // PathService is used, so a the ProviderFunc MUST BE THREADSAFE. 54 // PathService is used, so a the ProviderFunc MUST BE THREADSAFE.
58 // 55 //
59 typedef bool (*ProviderFunc)(int, FilePath*); 56 typedef bool (*ProviderFunc)(int, FilePath*);
60 57
61 // Call to register a path provider. You must specify the range "[key_start, 58 // Call to register a path provider. You must specify the range "[key_start,
62 // key_end)" of supported path keys. 59 // key_end)" of supported path keys.
63 static void RegisterProvider(ProviderFunc provider, 60 static void RegisterProvider(ProviderFunc provider,
64 int key_start, 61 int key_start,
65 int key_end); 62 int key_end);
66 private: 63 private:
67 static bool GetFromCache(int key, FilePath* path); 64 static bool GetFromCache(int key, FilePath* path);
65 static bool GetFromOverrides(int key, FilePath* path);
68 static void AddToCache(int key, const FilePath& path); 66 static void AddToCache(int key, const FilePath& path);
69 }; 67 };
70 68
71 #endif // BASE_PATH_SERVICE_H_ 69 #endif // BASE_PATH_SERVICE_H_
OLDNEW
« no previous file with comments | « no previous file | base/path_service.cc » ('j') | chrome/browser/profile_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698