rdevlin.cronin | 892cc67 | 2016-12-19 20:00:18 | [diff] [blame] | 1 | // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef EXTENSIONS_RENDERER_TEST_V8_EXTENSION_CONFIGURATION_H_ |
| 6 | #define EXTENSIONS_RENDERER_TEST_V8_EXTENSION_CONFIGURATION_H_ |
| 7 | |
| 8 | #include <memory> |
| 9 | #include <vector> |
| 10 | |
| 11 | #include "base/macros.h" |
| 12 | |
| 13 | namespace v8 { |
| 14 | class Extension; |
| 15 | class ExtensionConfiguration; |
| 16 | } |
| 17 | |
| 18 | namespace extensions { |
| 19 | |
| 20 | // A test helper to allow for the instantiation of the SafeBuiltins |
| 21 | // v8::Extension, which is needed by most/all of our custom bindings. |
| 22 | class TestV8ExtensionConfiguration { |
| 23 | public: |
| 24 | TestV8ExtensionConfiguration(); |
| 25 | ~TestV8ExtensionConfiguration(); |
| 26 | |
| 27 | static v8::ExtensionConfiguration* GetConfiguration(); |
| 28 | |
| 29 | private: |
| 30 | std::unique_ptr<v8::Extension> safe_builtins_; |
| 31 | std::vector<const char*> v8_extension_names_; |
| 32 | std::unique_ptr<v8::ExtensionConfiguration> v8_extension_configuration_; |
| 33 | |
| 34 | DISALLOW_COPY_AND_ASSIGN(TestV8ExtensionConfiguration); |
| 35 | }; |
| 36 | |
| 37 | } // namespace extensions |
| 38 | |
| 39 | #endif // EXTENSIONS_RENDERER_TEST_V8_EXTENSION_CONFIGURATION_H_ |