OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 PDFium 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 TESTING_EMBEDDER_TEST_SHARED_ISOLATE_DELEGATE_H_ |
| 6 #define TESTING_EMBEDDER_TEST_SHARED_ISOLATE_DELEGATE_H_ |
| 7 |
| 8 #include <map> |
| 9 #include <utility> |
| 10 |
| 11 #include "../fpdfsdk/include/jsapi/fxjs_v8.h" |
| 12 #include "../third_party/base/nonstd_unique_ptr.h" |
| 13 #include "embedder_test.h" |
| 14 #include "embedder_test_timer_handling_delegate.h" |
| 15 |
| 16 class EmbedderTestSharedIsolateDelegate |
| 17 : public EmbedderTestTimerHandlingDelegate { |
| 18 public: |
| 19 EmbedderTestSharedIsolateDelegate() |
| 20 : m_pArrayBufferAllocator(new FXJS_ArrayBufferAllocator) { |
| 21 v8::Isolate::CreateParams params; |
| 22 params.array_buffer_allocator = m_pArrayBufferAllocator.get(); |
| 23 m_pIsolate = v8::Isolate::New(params); |
| 24 } |
| 25 |
| 26 ~EmbedderTestSharedIsolateDelegate() { m_pIsolate->Dispose(); } |
| 27 |
| 28 v8::Isolate* GetSharedIsolate() const override { return m_pIsolate; } |
| 29 |
| 30 protected: |
| 31 nonstd::unique_ptr<FXJS_ArrayBufferAllocator> m_pArrayBufferAllocator; |
| 32 v8::Isolate* m_pIsolate; |
| 33 }; |
| 34 |
| 35 #endif // TESTING_EMBEDDER_TEST_SHARED_ISOLATE_DELEGATE_H_ |
OLD | NEW |