OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_BROWSER_PRELOAD_CHECK_H_ | 5 #ifndef EXTENSIONS_BROWSER_PRELOAD_CHECK_H_ |
6 #define EXTENSIONS_BROWSER_PRELOAD_CHECK_H_ | 6 #define EXTENSIONS_BROWSER_PRELOAD_CHECK_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <unordered_set> | 9 #include <unordered_set> |
10 #include <utility> | 10 #include <utility> |
(...skipping 10 matching lines...) Expand all Loading... |
21 // precondition holds for loading the given extension. | 21 // precondition holds for loading the given extension. |
22 class PreloadCheck { | 22 class PreloadCheck { |
23 public: | 23 public: |
24 // These enumerators should only be referred to by name, so it is safe to | 24 // These enumerators should only be referred to by name, so it is safe to |
25 // insert or remove values as necessary. | 25 // insert or remove values as necessary. |
26 enum Error { | 26 enum Error { |
27 NONE, | 27 NONE, |
28 BLACKLISTED_ID, | 28 BLACKLISTED_ID, |
29 BLACKLISTED_UNKNOWN, | 29 BLACKLISTED_UNKNOWN, |
30 DISALLOWED_BY_POLICY, | 30 DISALLOWED_BY_POLICY, |
| 31 NPAPI_NOT_SUPPORTED, |
| 32 WEBGL_NOT_SUPPORTED, |
| 33 WINDOW_SHAPE_NOT_SUPPORTED, |
31 }; | 34 }; |
32 | 35 |
33 // TODO(michaelpg): Remove std::hash<int> template argument once std::hash | 36 // TODO(michaelpg): Remove std::hash<int> template argument once std::hash |
34 // directly supports enums. | 37 // directly supports enums. |
35 // See http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2148 | 38 // See http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2148 |
36 using Errors = std::unordered_set<Error, std::hash<int>>; | 39 using Errors = std::unordered_set<Error, std::hash<int>>; |
37 using ResultCallback = base::OnceCallback<void(Errors)>; | 40 using ResultCallback = base::OnceCallback<void(Errors)>; |
38 | 41 |
39 explicit PreloadCheck(scoped_refptr<const Extension> extension); | 42 explicit PreloadCheck(scoped_refptr<const Extension> extension); |
40 virtual ~PreloadCheck(); | 43 virtual ~PreloadCheck(); |
(...skipping 10 matching lines...) Expand all Loading... |
51 private: | 54 private: |
52 // The extension to check. | 55 // The extension to check. |
53 scoped_refptr<const Extension> extension_; | 56 scoped_refptr<const Extension> extension_; |
54 | 57 |
55 DISALLOW_COPY_AND_ASSIGN(PreloadCheck); | 58 DISALLOW_COPY_AND_ASSIGN(PreloadCheck); |
56 }; | 59 }; |
57 | 60 |
58 } // namespace extensions | 61 } // namespace extensions |
59 | 62 |
60 #endif // EXTENSIONS_BROWSER_PRELOAD_CHECK_H_ | 63 #endif // EXTENSIONS_BROWSER_PRELOAD_CHECK_H_ |
OLD | NEW |