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

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

Issue 1358263004: Revert "Merge to master: contention over isolate data slots" (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: 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/jsapi/fxjs_v8.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 // 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_
11 #define FPDFSDK_INCLUDE_JSAPI_FXJS_V8_H_ 11 #define FPDFSDK_INCLUDE_JSAPI_FXJS_V8_H_
12 12
13 #include <v8.h> 13 #include <v8.h>
14 #include "../../../core/include/fxcrt/fx_basic.h" 14 #include "../../../core/include/fxcrt/fx_string.h" // For CFX_WideString
15
16 // FXJS_V8 places no interpretation on these two classes; it merely
17 // passes them on to the caller-provided FXJS_CONSTRUCTORs.
18 class IFXJS_Context;
19 class IFXJS_Runtime;
20 15
21 enum FXJSOBJTYPE { 16 enum FXJSOBJTYPE {
22 FXJS_DYNAMIC = 0, 17 FXJS_DYNAMIC = 0,
23 FXJS_STATIC = 1, 18 FXJS_STATIC = 1,
24 }; 19 };
25 20
26 struct FXJSErr { 21 struct FXJSErr {
27 const wchar_t* message; 22 const wchar_t* message;
28 const wchar_t* srcline; 23 const wchar_t* srcline;
29 unsigned linnum; 24 unsigned linnum;
30 }; 25 };
31 26
32 class FXJS_PerIsolateData {
33 public:
34 static void SetUp(v8::Isolate* pIsolate);
35 static FXJS_PerIsolateData* Get(v8::Isolate* pIsolate);
36
37 CFX_PtrArray m_ObjectDefnArray;
38 IFXJS_Runtime* m_pFXJSRuntime;
39
40 protected:
41 FXJS_PerIsolateData() : m_pFXJSRuntime(nullptr) {}
42 };
43
44 extern const wchar_t kFXJSValueNameString[]; 27 extern const wchar_t kFXJSValueNameString[];
45 extern const wchar_t kFXJSValueNameNumber[]; 28 extern const wchar_t kFXJSValueNameNumber[];
46 extern const wchar_t kFXJSValueNameBoolean[]; 29 extern const wchar_t kFXJSValueNameBoolean[];
47 extern const wchar_t kFXJSValueNameDate[]; 30 extern const wchar_t kFXJSValueNameDate[];
48 extern const wchar_t kFXJSValueNameObject[]; 31 extern const wchar_t kFXJSValueNameObject[];
49 extern const wchar_t kFXJSValueNameFxobj[]; 32 extern const wchar_t kFXJSValueNameFxobj[];
50 extern const wchar_t kFXJSValueNameNull[]; 33 extern const wchar_t kFXJSValueNameNull[];
51 extern const wchar_t kFXJSValueNameUndefined[]; 34 extern const wchar_t kFXJSValueNameUndefined[];
52 35
36 // FXJS_V8 places no interpretation on these two classes; it merely
37 // passes them on to the caller-provided FXJS_CONSTRUCTORs.
38 class IFXJS_Context;
39 class IFXJS_Runtime;
53 40
54 class FXJS_ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { 41 class FXJS_ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
55 void* Allocate(size_t length) override; 42 void* Allocate(size_t length) override;
56 void* AllocateUninitialized(size_t length) override; 43 void* AllocateUninitialized(size_t length) override;
57 void Free(void* data, size_t length) override; 44 void Free(void* data, size_t length) override;
58 }; 45 };
59 46
60 using FXJS_CONSTRUCTOR = void (*)(IFXJS_Context* cc, 47 using FXJS_CONSTRUCTOR = void (*)(IFXJS_Context* cc,
61 v8::Local<v8::Object> obj, 48 v8::Local<v8::Object> obj,
62 v8::Local<v8::Object> global); 49 v8::Local<v8::Object> global);
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 double FXJS_ToNumber(v8::Isolate* pIsolate, v8::Local<v8::Value> pValue); 196 double FXJS_ToNumber(v8::Isolate* pIsolate, v8::Local<v8::Value> pValue);
210 v8::Local<v8::Object> FXJS_ToObject(v8::Isolate* pIsolate, 197 v8::Local<v8::Object> FXJS_ToObject(v8::Isolate* pIsolate,
211 v8::Local<v8::Value> pValue); 198 v8::Local<v8::Value> pValue);
212 CFX_WideString FXJS_ToString(v8::Isolate* pIsolate, 199 CFX_WideString FXJS_ToString(v8::Isolate* pIsolate,
213 v8::Local<v8::Value> pValue); 200 v8::Local<v8::Value> pValue);
214 v8::Local<v8::Array> FXJS_ToArray(v8::Isolate* pIsolate, 201 v8::Local<v8::Array> FXJS_ToArray(v8::Isolate* pIsolate,
215 v8::Local<v8::Value> pValue); 202 v8::Local<v8::Value> pValue);
216 void FXJS_ValueCopy(v8::Local<v8::Value>& pTo, v8::Local<v8::Value> pFrom); 203 void FXJS_ValueCopy(v8::Local<v8::Value>& pTo, v8::Local<v8::Value> pFrom);
217 204
218 #endif // FPDFSDK_INCLUDE_JSAPI_FXJS_V8_H_ 205 #endif // FPDFSDK_INCLUDE_JSAPI_FXJS_V8_H_
OLDNEW
« no previous file with comments | « no previous file | fpdfsdk/src/jsapi/fxjs_v8.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698