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

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

Issue 1381633008: Merge to XFA: Pass v8::Isolate to PDFium at init time. (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/fpdfview.cpp » ('j') | fpdfsdk/src/jsapi/fxjs_v8_embeddertest.cpp » ('J')
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 // PDFium wrapper around V8 APIs. PDFium code should include this file rather 7 // PDFium wrapper around V8 APIs. PDFium code should include this file rather
8 // than including V8 headers directly. 8 // than including V8 headers directly.
9 9
10 #ifndef FPDFSDK_INCLUDE_JSAPI_FXJS_V8_H_ 10 #ifndef FPDFSDK_INCLUDE_JSAPI_FXJS_V8_H_
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 void* AllocateUninitialized(size_t length) override; 61 void* AllocateUninitialized(size_t length) override;
62 void Free(void* data, size_t length) override; 62 void Free(void* data, size_t length) override;
63 }; 63 };
64 64
65 using FXJS_CONSTRUCTOR = void (*)(IFXJS_Context* cc, 65 using FXJS_CONSTRUCTOR = void (*)(IFXJS_Context* cc,
66 v8::Local<v8::Object> obj, 66 v8::Local<v8::Object> obj,
67 v8::Local<v8::Object> global); 67 v8::Local<v8::Object> global);
68 using FXJS_DESTRUCTOR = void (*)(v8::Local<v8::Object> obj); 68 using FXJS_DESTRUCTOR = void (*)(v8::Local<v8::Object> obj);
69 69
70 // Call before making FXJS_PrepareIsolate call. 70 // Call before making FXJS_PrepareIsolate call.
71 void FXJS_Initialize(unsigned int embedderDataSlot); 71 void FXJS_Initialize(unsigned int embedderDataSlot, v8::Isolate* pIsolate);
72 void FXJS_Release(); 72 void FXJS_Release();
73 73
74 // Gets the global isolate set by FXJS_Initialize(), or makes a new one each
75 // time if there is no such isolate. Returns true if a new isolate had to be
76 // created.
77 bool FXJS_GetIsolate(v8::Isolate** pResultIsolate);
78
74 // Call before making FXJS_Define* calls. Resources allocated here are cleared 79 // Call before making FXJS_Define* calls. Resources allocated here are cleared
75 // as part of FXJS_ReleaseRuntime(). 80 // as part of FXJS_ReleaseRuntime().
76 void FXJS_PrepareIsolate(v8::Isolate* pIsolate); 81 void FXJS_PrepareIsolate(v8::Isolate* pIsolate);
77 82
78 // Call before making JS_Define* calls. Resources allocated here are cleared 83 // Call before making JS_Define* calls. Resources allocated here are cleared
79 // as part of JS_ReleaseRuntime(). 84 // as part of JS_ReleaseRuntime().
80 void JS_PrepareIsolate(v8::Isolate* pIsolate); 85 void JS_PrepareIsolate(v8::Isolate* pIsolate);
81 86
82 // Always returns a valid, newly-created objDefnID. 87 // Always returns a valid, newly-created objDefnID.
83 int FXJS_DefineObj(v8::Isolate* pIsolate, 88 int FXJS_DefineObj(v8::Isolate* pIsolate,
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 double FXJS_ToNumber(v8::Isolate* pIsolate, v8::Local<v8::Value> pValue); 215 double FXJS_ToNumber(v8::Isolate* pIsolate, v8::Local<v8::Value> pValue);
211 v8::Local<v8::Object> FXJS_ToObject(v8::Isolate* pIsolate, 216 v8::Local<v8::Object> FXJS_ToObject(v8::Isolate* pIsolate,
212 v8::Local<v8::Value> pValue); 217 v8::Local<v8::Value> pValue);
213 CFX_WideString FXJS_ToString(v8::Isolate* pIsolate, 218 CFX_WideString FXJS_ToString(v8::Isolate* pIsolate,
214 v8::Local<v8::Value> pValue); 219 v8::Local<v8::Value> pValue);
215 v8::Local<v8::Array> FXJS_ToArray(v8::Isolate* pIsolate, 220 v8::Local<v8::Array> FXJS_ToArray(v8::Isolate* pIsolate,
216 v8::Local<v8::Value> pValue); 221 v8::Local<v8::Value> pValue);
217 void FXJS_ValueCopy(v8::Local<v8::Value>& pTo, v8::Local<v8::Value> pFrom); 222 void FXJS_ValueCopy(v8::Local<v8::Value>& pTo, v8::Local<v8::Value> pFrom);
218 223
219 #endif // FPDFSDK_INCLUDE_JSAPI_FXJS_V8_H_ 224 #endif // FPDFSDK_INCLUDE_JSAPI_FXJS_V8_H_
OLDNEW
« no previous file with comments | « no previous file | fpdfsdk/src/fpdfview.cpp » ('j') | fpdfsdk/src/jsapi/fxjs_v8_embeddertest.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698