OLD | NEW |
1 // Copyright 2015 PDFium Authors. All rights reserved. | 1 // Copyright 2015 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 <memory> | 7 #include <memory> |
8 | 8 |
9 #include "fpdfsdk/include/fsdk_mgr.h" // For CPDFDoc_Environment. | 9 #include "fpdfsdk/include/fsdk_mgr.h" // For CPDFDoc_Environment. |
10 #include "fpdfsdk/include/javascript/IJavaScript.h" | 10 #include "fpdfsdk/include/javascript/IJavaScript.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 131 |
132 IJS_Context* GetCurrentContext() override { return m_pContext.get(); } | 132 IJS_Context* GetCurrentContext() override { return m_pContext.get(); } |
133 void ReleaseContext(IJS_Context* pContext) override {} | 133 void ReleaseContext(IJS_Context* pContext) override {} |
134 | 134 |
135 void SetReaderDocument(CPDFSDK_Document* pReaderDoc) override { | 135 void SetReaderDocument(CPDFSDK_Document* pReaderDoc) override { |
136 m_pDoc = pReaderDoc; | 136 m_pDoc = pReaderDoc; |
137 } | 137 } |
138 CPDFSDK_Document* GetReaderDocument() override { return m_pDoc; } | 138 CPDFSDK_Document* GetReaderDocument() override { return m_pDoc; } |
139 | 139 |
140 #ifdef PDF_ENABLE_XFA | 140 #ifdef PDF_ENABLE_XFA |
141 virtual FX_BOOL GetHValueByName(const CFX_ByteStringC&, | 141 FX_BOOL GetHValueByName(const CFX_ByteStringC&, FXJSE_HVALUE) override { |
142 FXJSE_HVALUE) override { | |
143 return FALSE; | 142 return FALSE; |
144 } | 143 } |
145 | 144 |
146 virtual FX_BOOL SetHValueByName(const CFX_ByteStringC&, | 145 FX_BOOL SetHValueByName(const CFX_ByteStringC&, FXJSE_HVALUE) override { |
147 FXJSE_HVALUE) override { | |
148 return FALSE; | 146 return FALSE; |
149 } | 147 } |
150 #endif // PDF_ENABLE_XFA | 148 #endif // PDF_ENABLE_XFA |
151 | 149 |
152 int Execute(IJS_Context* cc, | 150 int Execute(IJS_Context* cc, |
153 const wchar_t* script, | 151 const wchar_t* script, |
154 CFX_WideString* info) override { | 152 CFX_WideString* info) override { |
155 return 0; | 153 return 0; |
156 } | 154 } |
157 | 155 |
158 protected: | 156 protected: |
159 CPDFSDK_Document* m_pDoc; | 157 CPDFSDK_Document* m_pDoc; |
160 std::unique_ptr<CJS_ContextStub> m_pContext; | 158 std::unique_ptr<CJS_ContextStub> m_pContext; |
161 }; | 159 }; |
162 | 160 |
163 // static | 161 // static |
164 void IJS_Runtime::Initialize(unsigned int slot, void* isolate) { | 162 void IJS_Runtime::Initialize(unsigned int slot, void* isolate) { |
165 } | 163 } |
166 | 164 |
167 // static | 165 // static |
168 IJS_Runtime* IJS_Runtime::Create(CPDFDoc_Environment* pEnv) { | 166 IJS_Runtime* IJS_Runtime::Create(CPDFDoc_Environment* pEnv) { |
169 return new CJS_RuntimeStub; | 167 return new CJS_RuntimeStub; |
170 } | 168 } |
OLD | NEW |