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

Side by Side Diff: fpdfsdk/include/jsapi/fxjs_v8.h

Issue 1400503003: Merge to XFA: Only call DefineJSObjects() once for the global V8 isolate. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: rebase Created 5 years, 2 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 | « no previous file | fpdfsdk/src/javascript/JS_Runtime.cpp » ('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 // FXJS_V8 is a layer that makes it easier to define native objects in V8, but 7 // FXJS_V8 is a layer that makes it easier to define native objects in V8, but
8 // has no knowledge of PDF-specific native objects. It could in theory be used 8 // has no knowledge of PDF-specific native objects. It could in theory be used
9 // to implement other sets of native objects. 9 // to implement other sets of native objects.
10 10
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 71
72 // Call before making FXJS_PrepareIsolate call. 72 // Call before making FXJS_PrepareIsolate call.
73 void FXJS_Initialize(unsigned int embedderDataSlot, v8::Isolate* pIsolate); 73 void FXJS_Initialize(unsigned int embedderDataSlot, v8::Isolate* pIsolate);
74 void FXJS_Release(); 74 void FXJS_Release();
75 75
76 // Gets the global isolate set by FXJS_Initialize(), or makes a new one each 76 // Gets the global isolate set by FXJS_Initialize(), or makes a new one each
77 // time if there is no such isolate. Returns true if a new isolate had to be 77 // time if there is no such isolate. Returns true if a new isolate had to be
78 // created. 78 // created.
79 bool FXJS_GetIsolate(v8::Isolate** pResultIsolate); 79 bool FXJS_GetIsolate(v8::Isolate** pResultIsolate);
80 80
81 // Get the global isolate's ref count.
82 size_t FXJS_GlobalIsolateRefCount();
83
81 // Call before making FXJS_Define* calls. Resources allocated here are cleared 84 // Call before making FXJS_Define* calls. Resources allocated here are cleared
82 // as part of FXJS_ReleaseRuntime(). 85 // as part of FXJS_ReleaseRuntime().
83 void FXJS_PrepareIsolate(v8::Isolate* pIsolate); 86 void FXJS_PrepareIsolate(v8::Isolate* pIsolate);
84 87
85 // Call before making JS_Define* calls. Resources allocated here are cleared 88 // Call before making JS_Define* calls. Resources allocated here are cleared
86 // as part of JS_ReleaseRuntime(). 89 // as part of JS_ReleaseRuntime().
87 void JS_PrepareIsolate(v8::Isolate* pIsolate); 90 void JS_PrepareIsolate(v8::Isolate* pIsolate);
88 91
89 // Always returns a valid, newly-created objDefnID. 92 // Always returns a valid, newly-created objDefnID.
90 int FXJS_DefineObj(v8::Isolate* pIsolate, 93 int FXJS_DefineObj(v8::Isolate* pIsolate,
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 double FXJS_ToNumber(v8::Isolate* pIsolate, v8::Local<v8::Value> pValue); 220 double FXJS_ToNumber(v8::Isolate* pIsolate, v8::Local<v8::Value> pValue);
218 v8::Local<v8::Object> FXJS_ToObject(v8::Isolate* pIsolate, 221 v8::Local<v8::Object> FXJS_ToObject(v8::Isolate* pIsolate,
219 v8::Local<v8::Value> pValue); 222 v8::Local<v8::Value> pValue);
220 CFX_WideString FXJS_ToString(v8::Isolate* pIsolate, 223 CFX_WideString FXJS_ToString(v8::Isolate* pIsolate,
221 v8::Local<v8::Value> pValue); 224 v8::Local<v8::Value> pValue);
222 v8::Local<v8::Array> FXJS_ToArray(v8::Isolate* pIsolate, 225 v8::Local<v8::Array> FXJS_ToArray(v8::Isolate* pIsolate,
223 v8::Local<v8::Value> pValue); 226 v8::Local<v8::Value> pValue);
224 void FXJS_ValueCopy(v8::Local<v8::Value>& pTo, v8::Local<v8::Value> pFrom); 227 void FXJS_ValueCopy(v8::Local<v8::Value>& pTo, v8::Local<v8::Value> pFrom);
225 228
226 #endif // FPDFSDK_INCLUDE_JSAPI_FXJS_V8_H_ 229 #endif // FPDFSDK_INCLUDE_JSAPI_FXJS_V8_H_
OLDNEW
« no previous file with comments | « no previous file | fpdfsdk/src/javascript/JS_Runtime.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698