| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 scoped_ptr<base::DictionaryValue> LoadManifest( | 65 scoped_ptr<base::DictionaryValue> LoadManifest( |
| 66 const base::FilePath& extension_root, | 66 const base::FilePath& extension_root, |
| 67 std::string* error); | 67 std::string* error); |
| 68 | 68 |
| 69 // Convenience overload for specifying a manifest filename. | 69 // Convenience overload for specifying a manifest filename. |
| 70 scoped_ptr<base::DictionaryValue> LoadManifest( | 70 scoped_ptr<base::DictionaryValue> LoadManifest( |
| 71 const base::FilePath& extension_root, | 71 const base::FilePath& extension_root, |
| 72 const base::FilePath::CharType* manifest_filename, | 72 const base::FilePath::CharType* manifest_filename, |
| 73 std::string* error); | 73 std::string* error); |
| 74 | 74 |
| 75 // Returns true if the given file path exists and is not zero-length. |
| 76 bool ValidateFilePath(const base::FilePath& path); |
| 77 |
| 75 // Returns true if the given extension object is valid and consistent. | 78 // Returns true if the given extension object is valid and consistent. |
| 76 // 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 |
| 77 // should not prevent the extension from running. | 80 // should not prevent the extension from running. |
| 78 // | 81 // |
| 79 // Otherwise, returns false, and a description of the error is | 82 // Otherwise, returns false, and a description of the error is |
| 80 // returned in |error|. | 83 // returned in |error|. |
| 81 bool ValidateExtension(const Extension* extension, | 84 bool ValidateExtension(const Extension* extension, |
| 82 std::string* error, | 85 std::string* error, |
| 83 std::vector<InstallWarning>* warnings); | 86 std::vector<InstallWarning>* warnings); |
| 84 | 87 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 const ExtensionSet& extension_set); | 151 const ExtensionSet& extension_set); |
| 149 | 152 |
| 150 // Helper functions for getting paths for files used in content verification. | 153 // Helper functions for getting paths for files used in content verification. |
| 151 base::FilePath GetVerifiedContentsPath(const base::FilePath& extension_path); | 154 base::FilePath GetVerifiedContentsPath(const base::FilePath& extension_path); |
| 152 base::FilePath GetComputedHashesPath(const base::FilePath& extension_path); | 155 base::FilePath GetComputedHashesPath(const base::FilePath& extension_path); |
| 153 | 156 |
| 154 } // namespace file_util | 157 } // namespace file_util |
| 155 } // namespace extensions | 158 } // namespace extensions |
| 156 | 159 |
| 157 #endif // EXTENSIONS_COMMON_FILE_UTIL_H_ | 160 #endif // EXTENSIONS_COMMON_FILE_UTIL_H_ |
| OLD | NEW |