OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 EXTENSIONS_COMMON_FILE_UTIL_H_ | 5 #ifndef EXTENSIONS_COMMON_FILE_UTIL_H_ |
6 #define EXTENSIONS_COMMON_FILE_UTIL_H_ | 6 #define EXTENSIONS_COMMON_FILE_UTIL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 std::unique_ptr<base::DictionaryValue> LoadManifest( | 64 std::unique_ptr<base::DictionaryValue> LoadManifest( |
65 const base::FilePath& extension_root, | 65 const base::FilePath& extension_root, |
66 std::string* error); | 66 std::string* error); |
67 | 67 |
68 // Convenience overload for specifying a manifest filename. | 68 // Convenience overload for specifying a manifest filename. |
69 std::unique_ptr<base::DictionaryValue> LoadManifest( | 69 std::unique_ptr<base::DictionaryValue> LoadManifest( |
70 const base::FilePath& extension_root, | 70 const base::FilePath& extension_root, |
71 const base::FilePath::CharType* manifest_filename, | 71 const base::FilePath::CharType* manifest_filename, |
72 std::string* error); | 72 std::string* error); |
73 | 73 |
| 74 bool IndexAndPersistRulesetIfNeeded(const Extension* extension, |
| 75 const base::FilePath& indexed_ruleset_path, |
| 76 std::string* error); |
| 77 |
74 // Returns true if the given extension object is valid and consistent. | 78 // Returns true if the given extension object is valid and consistent. |
75 // May also append a series of warning messages to |warnings|, but they | 79 // May also append a series of warning messages to |warnings|, but they |
76 // should not prevent the extension from running. | 80 // should not prevent the extension from running. |
77 // | 81 // |
78 // Otherwise, returns false, and a description of the error is | 82 // Otherwise, returns false, and a description of the error is |
79 // returned in |error|. | 83 // returned in |error|. |
80 bool ValidateExtension(const Extension* extension, | 84 bool ValidateExtension(const Extension* extension, |
81 std::string* error, | 85 std::string* error, |
82 std::vector<InstallWarning>* warnings); | 86 std::vector<InstallWarning>* warnings); |
83 | 87 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 // Contains at least the extension_id item. | 148 // Contains at least the extension_id item. |
145 MessageBundle::SubstitutionMap* LoadMessageBundleSubstitutionMapFromPaths( | 149 MessageBundle::SubstitutionMap* LoadMessageBundleSubstitutionMapFromPaths( |
146 const std::vector<base::FilePath>& paths, | 150 const std::vector<base::FilePath>& paths, |
147 const std::string& extension_id, | 151 const std::string& extension_id, |
148 const std::string& default_locale); | 152 const std::string& default_locale); |
149 | 153 |
150 // Helper functions for getting paths for files used in content verification. | 154 // Helper functions for getting paths for files used in content verification. |
151 base::FilePath GetVerifiedContentsPath(const base::FilePath& extension_path); | 155 base::FilePath GetVerifiedContentsPath(const base::FilePath& extension_path); |
152 base::FilePath GetComputedHashesPath(const base::FilePath& extension_path); | 156 base::FilePath GetComputedHashesPath(const base::FilePath& extension_path); |
153 | 157 |
| 158 // Helper function to get path where the indexed ruleset file used for the |
| 159 // Declarative Net Request API is stored. |
| 160 base::FilePath GetIndexedRulesetPath(const base::FilePath& extension_path); |
154 } // namespace file_util | 161 } // namespace file_util |
155 } // namespace extensions | 162 } // namespace extensions |
156 | 163 |
157 #endif // EXTENSIONS_COMMON_FILE_UTIL_H_ | 164 #endif // EXTENSIONS_COMMON_FILE_UTIL_H_ |
OLD | NEW |