| OLD | NEW |
| 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 #include "fpdfsdk/javascript/cjs_runtime.h" | 7 #include "fpdfsdk/javascript/cjs_runtime.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| 11 #include "fpdfsdk/include/fsdk_mgr.h" | 11 #include "fpdfsdk/include/cpdfdoc_environment.h" |
| 12 #include "fpdfsdk/javascript/Annot.h" | 12 #include "fpdfsdk/javascript/Annot.h" |
| 13 #include "fpdfsdk/javascript/Consts.h" | 13 #include "fpdfsdk/javascript/Consts.h" |
| 14 #include "fpdfsdk/javascript/Document.h" | 14 #include "fpdfsdk/javascript/Document.h" |
| 15 #include "fpdfsdk/javascript/Field.h" | 15 #include "fpdfsdk/javascript/Field.h" |
| 16 #include "fpdfsdk/javascript/Icon.h" | 16 #include "fpdfsdk/javascript/Icon.h" |
| 17 #include "fpdfsdk/javascript/JS_Define.h" | 17 #include "fpdfsdk/javascript/JS_Define.h" |
| 18 #include "fpdfsdk/javascript/JS_EventHandler.h" | 18 #include "fpdfsdk/javascript/JS_EventHandler.h" |
| 19 #include "fpdfsdk/javascript/JS_GlobalData.h" | 19 #include "fpdfsdk/javascript/JS_GlobalData.h" |
| 20 #include "fpdfsdk/javascript/JS_Object.h" | 20 #include "fpdfsdk/javascript/JS_Object.h" |
| 21 #include "fpdfsdk/javascript/JS_Value.h" | 21 #include "fpdfsdk/javascript/JS_Value.h" |
| 22 #include "fpdfsdk/javascript/PublicMethods.h" | 22 #include "fpdfsdk/javascript/PublicMethods.h" |
| 23 #include "fpdfsdk/javascript/app.h" | 23 #include "fpdfsdk/javascript/app.h" |
| 24 #include "fpdfsdk/javascript/cjs_context.h" | 24 #include "fpdfsdk/javascript/cjs_context.h" |
| 25 #include "fpdfsdk/javascript/color.h" | 25 #include "fpdfsdk/javascript/color.h" |
| 26 #include "fpdfsdk/javascript/console.h" | 26 #include "fpdfsdk/javascript/console.h" |
| 27 #include "fpdfsdk/javascript/event.h" | 27 #include "fpdfsdk/javascript/event.h" |
| 28 #include "fpdfsdk/javascript/global.h" | 28 #include "fpdfsdk/javascript/global.h" |
| 29 #include "fpdfsdk/javascript/report.h" | 29 #include "fpdfsdk/javascript/report.h" |
| 30 #include "fpdfsdk/javascript/util.h" | 30 #include "fpdfsdk/javascript/util.h" |
| 31 #include "public/fpdf_formfill.h" |
| 31 #include "third_party/base/stl_util.h" | 32 #include "third_party/base/stl_util.h" |
| 32 | 33 |
| 33 #ifdef PDF_ENABLE_XFA | 34 #ifdef PDF_ENABLE_XFA |
| 34 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_app.h" | 35 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_app.h" |
| 35 #include "fxjs/include/cfxjse_value.h" | 36 #include "fxjs/include/cfxjse_value.h" |
| 36 #endif // PDF_ENABLE_XFA | 37 #endif // PDF_ENABLE_XFA |
| 37 | 38 |
| 38 // static | 39 // static |
| 39 void IJS_Runtime::Initialize(unsigned int slot, void* isolate) { | 40 void IJS_Runtime::Initialize(unsigned int slot, void* isolate) { |
| 40 FXJS_Initialize(slot, reinterpret_cast<v8::Isolate*>(isolate)); | 41 FXJS_Initialize(slot, reinterpret_cast<v8::Isolate*>(isolate)); |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 // v8::Local<v8::Context>::New(GetIsolate(), m_context); | 305 // v8::Local<v8::Context>::New(GetIsolate(), m_context); |
| 305 v8::Local<v8::Value> propvalue = | 306 v8::Local<v8::Value> propvalue = |
| 306 v8::Local<v8::Value>::New(GetIsolate(), pValue->DirectGetValue()); | 307 v8::Local<v8::Value>::New(GetIsolate(), pValue->DirectGetValue()); |
| 307 context->Global()->Set( | 308 context->Global()->Set( |
| 308 v8::String::NewFromUtf8(pIsolate, name, v8::String::kNormalString, | 309 v8::String::NewFromUtf8(pIsolate, name, v8::String::kNormalString, |
| 309 utf8Name.GetLength()), | 310 utf8Name.GetLength()), |
| 310 propvalue); | 311 propvalue); |
| 311 return TRUE; | 312 return TRUE; |
| 312 } | 313 } |
| 313 #endif | 314 #endif |
| OLD | NEW |