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

Side by Side Diff: fpdfsdk/src/javascript/JS_Runtime.h

Issue 1761073006: Re-land "Only place primitive objects on the V8 global template."" (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Better solution - destroy handles before runtime. Created 4 years, 9 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/src/javascript/Consts.cpp ('k') | 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 #ifndef FPDFSDK_SRC_JAVASCRIPT_JS_RUNTIME_H_ 7 #ifndef FPDFSDK_SRC_JAVASCRIPT_JS_RUNTIME_H_
8 #define FPDFSDK_SRC_JAVASCRIPT_JS_RUNTIME_H_ 8 #define FPDFSDK_SRC_JAVASCRIPT_JS_RUNTIME_H_
9 9
10 #include <set> 10 #include <set>
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 bool AddEventToSet(const FieldEvent& event); 51 bool AddEventToSet(const FieldEvent& event);
52 void RemoveEventFromSet(const FieldEvent& event); 52 void RemoveEventFromSet(const FieldEvent& event);
53 53
54 void BeginBlock() { m_bBlocking = TRUE; } 54 void BeginBlock() { m_bBlocking = TRUE; }
55 void EndBlock() { m_bBlocking = FALSE; } 55 void EndBlock() { m_bBlocking = FALSE; }
56 FX_BOOL IsBlocking() const { return m_bBlocking; } 56 FX_BOOL IsBlocking() const { return m_bBlocking; }
57 57
58 v8::Isolate* GetIsolate() const { return m_isolate; } 58 v8::Isolate* GetIsolate() const { return m_isolate; }
59 v8::Local<v8::Context> NewJSContext(); 59 v8::Local<v8::Context> NewJSContext();
60 60
61 void SetConstArray(const CFX_WideString& name, v8::Local<v8::Array> array);
62 v8::Local<v8::Array> GetConstArray(const CFX_WideString& name);
63
61 #ifdef PDF_ENABLE_XFA 64 #ifdef PDF_ENABLE_XFA
62 FX_BOOL GetHValueByName(const CFX_ByteStringC& utf8Name, 65 FX_BOOL GetHValueByName(const CFX_ByteStringC& utf8Name,
63 FXJSE_HVALUE hValue) override; 66 FXJSE_HVALUE hValue) override;
64 FX_BOOL SetHValueByName(const CFX_ByteStringC& utf8Name, 67 FX_BOOL SetHValueByName(const CFX_ByteStringC& utf8Name,
65 FXJSE_HVALUE hValue) override; 68 FXJSE_HVALUE hValue) override;
66 #endif // PDF_ENABLE_XFA 69 #endif // PDF_ENABLE_XFA
67 70
68 void AddObserver(Observer* observer); 71 void AddObserver(Observer* observer);
69 void RemoveObserver(Observer* observer); 72 void RemoveObserver(Observer* observer);
70 73
71 private: 74 private:
72 void DefineJSObjects(); 75 void DefineJSObjects();
73 76
74 CFX_ArrayTemplate<CJS_Context*> m_ContextArray; 77 CFX_ArrayTemplate<CJS_Context*> m_ContextArray;
75 CPDFDoc_Environment* m_pApp; 78 CPDFDoc_Environment* m_pApp;
76 CPDFSDK_Document* m_pDocument; 79 CPDFSDK_Document* m_pDocument;
77 FX_BOOL m_bBlocking; 80 FX_BOOL m_bBlocking;
78 std::set<FieldEvent> m_FieldEventSet; 81 std::set<FieldEvent> m_FieldEventSet;
79 v8::Isolate* m_isolate; 82 v8::Isolate* m_isolate;
80 bool m_isolateManaged; 83 bool m_isolateManaged;
81 v8::Global<v8::Context> m_context; 84 v8::Global<v8::Context> m_context;
82 std::vector<v8::Global<v8::Object>*> m_StaticObjects; 85 std::vector<v8::Global<v8::Object>*> m_StaticObjects;
86 std::map<CFX_WideString, v8::Global<v8::Array>> m_ConstArrays;
83 std::set<Observer*> m_observers; 87 std::set<Observer*> m_observers;
84 }; 88 };
85 89
86 #endif // FPDFSDK_SRC_JAVASCRIPT_JS_RUNTIME_H_ 90 #endif // FPDFSDK_SRC_JAVASCRIPT_JS_RUNTIME_H_
OLDNEW
« no previous file with comments | « fpdfsdk/src/javascript/Consts.cpp ('k') | fpdfsdk/src/javascript/JS_Runtime.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698