Ben Murdoch | 097c5b2 | 2016-05-18 11:27:45 +0100 | [diff] [blame] | 1 | // Copyright 2016 the V8 project 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 TEST_FUZZER_FUZZER_SUPPORT_H_ |
| 6 | #define TEST_FUZZER_FUZZER_SUPPORT_H_ |
| 7 | |
| 8 | #include "include/v8.h" |
| 9 | |
| 10 | namespace v8_fuzzer { |
| 11 | |
| 12 | class FuzzerSupport { |
| 13 | public: |
| 14 | FuzzerSupport(int* argc, char*** argv); |
| 15 | ~FuzzerSupport(); |
| 16 | |
| 17 | static FuzzerSupport* Get(); |
| 18 | |
| 19 | v8::Isolate* GetIsolate(); |
| 20 | v8::Local<v8::Context> GetContext(); |
| 21 | |
| 22 | private: |
| 23 | // Prevent copying. Not implemented. |
| 24 | FuzzerSupport(const FuzzerSupport&); |
| 25 | FuzzerSupport& operator=(const FuzzerSupport&); |
| 26 | |
| 27 | class ArrayBufferAllocator; |
| 28 | |
| 29 | v8::Platform* platform_; |
| 30 | ArrayBufferAllocator* allocator_; |
| 31 | v8::Isolate* isolate_; |
| 32 | v8::Global<v8::Context> context_; |
| 33 | }; |
| 34 | |
| 35 | } // namespace |
| 36 | |
| 37 | #endif // TEST_FUZZER_FUZZER_SUPPORT_H_ |