Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: testing/js_embedder_test.cpp

Issue 2103443004: Implement IJS_Runtime::Destroy(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Fix no V8 Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fpdfsdk/javascript/ijs_runtime.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 PDFium Authors. All rights reserved. 1 // Copyright 2015 PDFium 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 #include "testing/js_embedder_test.h" 5 #include "testing/js_embedder_test.h"
6 6
7 JSEmbedderTest::JSEmbedderTest() 7 JSEmbedderTest::JSEmbedderTest()
8 : m_pArrayBufferAllocator(new FXJS_ArrayBufferAllocator), 8 : m_pArrayBufferAllocator(new FXJS_ArrayBufferAllocator),
9 m_pIsolate(nullptr) {} 9 m_pIsolate(nullptr) {}
10 10
(...skipping 10 matching lines...) Expand all
21 v8::Isolate::Scope isolate_scope(m_pIsolate); 21 v8::Isolate::Scope isolate_scope(m_pIsolate);
22 v8::HandleScope handle_scope(m_pIsolate); 22 v8::HandleScope handle_scope(m_pIsolate);
23 FXJS_PerIsolateData::SetUp(m_pIsolate); 23 FXJS_PerIsolateData::SetUp(m_pIsolate);
24 FXJS_InitializeRuntime(m_pIsolate, nullptr, &m_pPersistentContext, 24 FXJS_InitializeRuntime(m_pIsolate, nullptr, &m_pPersistentContext,
25 &m_StaticObjects); 25 &m_StaticObjects);
26 } 26 }
27 27
28 void JSEmbedderTest::TearDown() { 28 void JSEmbedderTest::TearDown() {
29 FXJS_ReleaseRuntime(m_pIsolate, &m_pPersistentContext, &m_StaticObjects); 29 FXJS_ReleaseRuntime(m_pIsolate, &m_pPersistentContext, &m_StaticObjects);
30 m_pPersistentContext.Reset(); 30 m_pPersistentContext.Reset();
31 FXJS_Release();
32 EmbedderTest::TearDown(); 31 EmbedderTest::TearDown();
33 m_pIsolate->Dispose(); 32 m_pIsolate->Dispose();
34 m_pIsolate = nullptr; 33 m_pIsolate = nullptr;
35 } 34 }
36 35
37 v8::Isolate* JSEmbedderTest::isolate() { 36 v8::Isolate* JSEmbedderTest::isolate() {
38 return m_pIsolate; 37 return m_pIsolate;
39 } 38 }
40 39
41 v8::Local<v8::Context> JSEmbedderTest::GetV8Context() { 40 v8::Local<v8::Context> JSEmbedderTest::GetV8Context() {
42 return m_pPersistentContext.Get(m_pIsolate); 41 return m_pPersistentContext.Get(m_pIsolate);
43 } 42 }
OLDNEW
« no previous file with comments | « fpdfsdk/javascript/ijs_runtime.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698