OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_MANIFEST_HANDLER_H_ | 5 #ifndef EXTENSIONS_COMMON_MANIFEST_HANDLER_H_ |
6 #define EXTENSIONS_COMMON_MANIFEST_HANDLER_H_ | 6 #define EXTENSIONS_COMMON_MANIFEST_HANDLER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 11 matching lines...) Expand all Loading... | |
22 // An interface for clients that recognize and parse keys in extension | 22 // An interface for clients that recognize and parse keys in extension |
23 // manifests. | 23 // manifests. |
24 class ManifestHandler { | 24 class ManifestHandler { |
25 public: | 25 public: |
26 ManifestHandler(); | 26 ManifestHandler(); |
27 virtual ~ManifestHandler(); | 27 virtual ~ManifestHandler(); |
28 | 28 |
29 // Attempts to parse the extension's manifest. | 29 // Attempts to parse the extension's manifest. |
30 // Returns true on success or false on failure; if false, |error| will | 30 // Returns true on success or false on failure; if false, |error| will |
31 // be set to a failure message. | 31 // be set to a failure message. |
32 // This should not do any IO. | |
lazyboy
2017/04/26 22:06:53
nit:
// This does not require any IO operations.
karandeepb
2017/04/26 22:20:00
Done. I was directing comments to the "implementor
| |
32 virtual bool Parse(Extension* extension, base::string16* error) = 0; | 33 virtual bool Parse(Extension* extension, base::string16* error) = 0; |
33 | 34 |
34 // Validate that files associated with this manifest key exist. | 35 // Validate that files associated with this manifest key exist. |
35 // Validation takes place after parsing. May also append a series of | 36 // Validation takes place after parsing. May also append a series of |
36 // warning messages to |warnings|. | 37 // warning messages to |warnings|. It is guaranteed that this is called on a |
lazyboy
2017/04/26 22:06:53
nit: It is not guaranteed, but the caller should g
karandeepb
2017/04/26 22:20:00
Done.
| |
38 // thread which can make IO calls. | |
37 // | 39 // |
38 // Otherwise, returns false, and a description of the error is | 40 // Otherwise, returns false, and a description of the error is |
39 // returned in |error|. | 41 // returned in |error|. |
40 // TODO(yoz): Change error to base::string16. See crbug.com/71980. | 42 // TODO(yoz): Change error to base::string16. See crbug.com/71980. |
41 virtual bool Validate(const Extension* extension, | 43 virtual bool Validate(const Extension* extension, |
42 std::string* error, | 44 std::string* error, |
43 std::vector<InstallWarning>* warnings) const; | 45 std::vector<InstallWarning>* warnings) const; |
44 | 46 |
45 // If false (the default), only parse the manifest if a registered | 47 // If false (the default), only parse the manifest if a registered |
46 // key is present in the manifest. If true, always attempt to parse | 48 // key is present in the manifest. If true, always attempt to parse |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
164 // The priority for each manifest handler. Handlers with lower priority | 166 // The priority for each manifest handler. Handlers with lower priority |
165 // values are evaluated first. | 167 // values are evaluated first. |
166 ManifestHandlerPriorityMap priority_map_; | 168 ManifestHandlerPriorityMap priority_map_; |
167 | 169 |
168 bool is_finalized_; | 170 bool is_finalized_; |
169 }; | 171 }; |
170 | 172 |
171 } // namespace extensions | 173 } // namespace extensions |
172 | 174 |
173 #endif // EXTENSIONS_COMMON_MANIFEST_HANDLER_H_ | 175 #endif // EXTENSIONS_COMMON_MANIFEST_HANDLER_H_ |
OLD | NEW |