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

Side by Side Diff: fpdfsdk/javascript/cjs_runtime.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/JS_Runtime_Stub.cpp ('k') | fpdfsdk/javascript/ijs_runtime.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 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 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "fpdfsdk/javascript/cjs_runtime.h" 7 #include "fpdfsdk/javascript/cjs_runtime.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 22 matching lines...) Expand all
33 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_app.h" 33 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_app.h"
34 #include "fxjse/include/cfxjse_value.h" 34 #include "fxjse/include/cfxjse_value.h"
35 #endif // PDF_ENABLE_XFA 35 #endif // PDF_ENABLE_XFA
36 36
37 // static 37 // static
38 void IJS_Runtime::Initialize(unsigned int slot, void* isolate) { 38 void IJS_Runtime::Initialize(unsigned int slot, void* isolate) {
39 FXJS_Initialize(slot, reinterpret_cast<v8::Isolate*>(isolate)); 39 FXJS_Initialize(slot, reinterpret_cast<v8::Isolate*>(isolate));
40 } 40 }
41 41
42 // static 42 // static
43 void IJS_Runtime::Destroy() {
44 FXJS_Release();
45 }
46
47 // static
43 IJS_Runtime* IJS_Runtime::Create(CPDFDoc_Environment* pEnv) { 48 IJS_Runtime* IJS_Runtime::Create(CPDFDoc_Environment* pEnv) {
44 return new CJS_Runtime(pEnv); 49 return new CJS_Runtime(pEnv);
45 } 50 }
46 51
47 // static 52 // static
48 CJS_Runtime* CJS_Runtime::FromContext(const IJS_Context* cc) { 53 CJS_Runtime* CJS_Runtime::FromContext(const IJS_Context* cc) {
49 const CJS_Context* pContext = static_cast<const CJS_Context*>(cc); 54 const CJS_Context* pContext = static_cast<const CJS_Context*>(cc);
50 return pContext->GetJSRuntime(); 55 return pContext->GetJSRuntime();
51 } 56 }
52 57
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 // v8::Local<v8::Context>::New(GetIsolate(), m_context); 313 // v8::Local<v8::Context>::New(GetIsolate(), m_context);
309 v8::Local<v8::Value> propvalue = 314 v8::Local<v8::Value> propvalue =
310 v8::Local<v8::Value>::New(GetIsolate(), pValue->DirectGetValue()); 315 v8::Local<v8::Value>::New(GetIsolate(), pValue->DirectGetValue());
311 context->Global()->Set( 316 context->Global()->Set(
312 v8::String::NewFromUtf8(pIsolate, name, v8::String::kNormalString, 317 v8::String::NewFromUtf8(pIsolate, name, v8::String::kNormalString,
313 utf8Name.GetLength()), 318 utf8Name.GetLength()),
314 propvalue); 319 propvalue);
315 return TRUE; 320 return TRUE;
316 } 321 }
317 #endif 322 #endif
OLDNEW
« no previous file with comments | « fpdfsdk/javascript/JS_Runtime_Stub.cpp ('k') | fpdfsdk/javascript/ijs_runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698