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

Side by Side Diff: base/path_service.h

Issue 265013002: Revert of Enable Enterprise enrollment on desktop builds. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <string> 8 #include <string>
9 9
10 #include "base/base_export.h" 10 #include "base/base_export.h"
(...skipping 28 matching lines...) Expand all
39 // If the given path is relative, then it will be resolved against 39 // If the given path is relative, then it will be resolved against
40 // DIR_CURRENT. 40 // DIR_CURRENT.
41 // 41 //
42 // WARNING: Consumers of PathService::Get may expect paths to be constant 42 // WARNING: Consumers of PathService::Get may expect paths to be constant
43 // over the lifetime of the app, so this method should be used with caution. 43 // over the lifetime of the app, so this method should be used with caution.
44 // 44 //
45 // Unit tests generally should use ScopedPathOverride instead. Overrides from 45 // Unit tests generally should use ScopedPathOverride instead. Overrides from
46 // one test should not carry over to another. 46 // one test should not carry over to another.
47 static bool Override(int key, const base::FilePath& path); 47 static bool Override(int key, const base::FilePath& path);
48 48
49 // This function does the same as PathService::Override but it takes extra 49 // This function does the same as PathService::Override but it takes an extra
50 // parameters: 50 // parameter |create| which guides whether the directory to be overriden must
51 // - |is_absolute| indicates that |path| has already been expanded into an
52 // absolute path, otherwise MakeAbsoluteFilePath() will be used. This is
53 // useful to override paths that may not exist yet, since MakeAbsoluteFilePath
54 // fails for those. Note that MakeAbsoluteFilePath also expands symbolic
55 // links, even if path.IsAbsolute() is already true.
56 // - |create| guides whether the directory to be overriden must
57 // be created in case it doesn't exist already. 51 // be created in case it doesn't exist already.
58 static bool OverrideAndCreateIfNeeded(int key, 52 static bool OverrideAndCreateIfNeeded(int key,
59 const base::FilePath& path, 53 const base::FilePath& path,
60 bool is_absolute,
61 bool create); 54 bool create);
62 55
63 // To extend the set of supported keys, you can register a path provider, 56 // To extend the set of supported keys, you can register a path provider,
64 // which is just a function mirroring PathService::Get. The ProviderFunc 57 // which is just a function mirroring PathService::Get. The ProviderFunc
65 // returns false if it cannot provide a non-empty path for the given key. 58 // returns false if it cannot provide a non-empty path for the given key.
66 // Otherwise, true is returned. 59 // Otherwise, true is returned.
67 // 60 //
68 // WARNING: This function could be called on any thread from which the 61 // WARNING: This function could be called on any thread from which the
69 // PathService is used, so a the ProviderFunc MUST BE THREADSAFE. 62 // PathService is used, so a the ProviderFunc MUST BE THREADSAFE.
70 // 63 //
(...skipping 12 matching lines...) Expand all
83 friend class base::ScopedPathOverride; 76 friend class base::ScopedPathOverride;
84 FRIEND_TEST_ALL_PREFIXES(PathServiceTest, RemoveOverride); 77 FRIEND_TEST_ALL_PREFIXES(PathServiceTest, RemoveOverride);
85 78
86 // Removes an override for a special directory or file. Returns true if there 79 // Removes an override for a special directory or file. Returns true if there
87 // was an override to remove or false if none was present. 80 // was an override to remove or false if none was present.
88 // NOTE: This function is intended to be used by tests only! 81 // NOTE: This function is intended to be used by tests only!
89 static bool RemoveOverride(int key); 82 static bool RemoveOverride(int key);
90 }; 83 };
91 84
92 #endif // BASE_PATH_SERVICE_H_ 85 #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