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/JS_GlobalData.h" | 7 #include "fpdfsdk/javascript/JS_GlobalData.h" |
8 | 8 |
9 #include "core/fdrm/crypto/include/fx_crypt.h" | 9 #include "core/fdrm/crypto/include/fx_crypt.h" |
10 #include "third_party/base/stl_util.h" | 10 #include "third_party/base/stl_util.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 CJS_KeyValue* pNewObjData = new CJS_KeyValue; | 54 CJS_KeyValue* pNewObjData = new CJS_KeyValue; |
55 pNewObjData->sKey = pOldObjData->sKey; | 55 pNewObjData->sKey = pOldObjData->sKey; |
56 pNewObjData->nType = pOldObjData->nType; | 56 pNewObjData->nType = pOldObjData->nType; |
57 Add(pNewObjData); | 57 Add(pNewObjData); |
58 } break; | 58 } break; |
59 } | 59 } |
60 } | 60 } |
61 } | 61 } |
62 | 62 |
63 void CJS_GlobalVariableArray::Add(CJS_KeyValue* p) { | 63 void CJS_GlobalVariableArray::Add(CJS_KeyValue* p) { |
64 array.Add(p); | 64 m_Array.Add(p); |
65 } | 65 } |
66 | 66 |
67 int CJS_GlobalVariableArray::Count() const { | 67 int CJS_GlobalVariableArray::Count() const { |
68 return array.GetSize(); | 68 return m_Array.GetSize(); |
69 } | 69 } |
70 | 70 |
71 CJS_KeyValue* CJS_GlobalVariableArray::GetAt(int index) const { | 71 CJS_KeyValue* CJS_GlobalVariableArray::GetAt(int index) const { |
72 return array.GetAt(index); | 72 return m_Array.GetAt(index); |
73 } | 73 } |
74 | 74 |
75 void CJS_GlobalVariableArray::Empty() { | 75 void CJS_GlobalVariableArray::Empty() { |
76 for (int i = 0, sz = array.GetSize(); i < sz; i++) | 76 for (int i = 0, sz = m_Array.GetSize(); i < sz; i++) |
77 delete array.GetAt(i); | 77 delete m_Array.GetAt(i); |
78 array.RemoveAll(); | 78 m_Array.RemoveAll(); |
79 } | 79 } |
80 | 80 |
81 #define READER_JS_GLOBALDATA_FILENAME L"Reader_JsGlobal.Data" | 81 #define READER_JS_GLOBALDATA_FILENAME L"Reader_JsGlobal.Data" |
82 #define PHANTOM_JS_GLOBALDATA_FILENAME L"Phantom_JsGlobal.Data" | 82 #define PHANTOM_JS_GLOBALDATA_FILENAME L"Phantom_JsGlobal.Data" |
83 #define SDK_JS_GLOBALDATA_FILENAME L"SDK_JsGlobal.Data" | 83 #define SDK_JS_GLOBALDATA_FILENAME L"SDK_JsGlobal.Data" |
84 | 84 |
85 static const uint8_t JS_RC4KEY[] = { | 85 static const uint8_t JS_RC4KEY[] = { |
86 0x19, 0xa8, 0xe8, 0x01, 0xf6, 0xa8, 0xb6, 0x4d, 0x82, 0x04, 0x45, 0x6d, | 86 0x19, 0xa8, 0xe8, 0x01, 0xf6, 0xa8, 0xb6, 0x4d, 0x82, 0x04, 0x45, 0x6d, |
87 0xb4, 0xcf, 0xd7, 0x77, 0x67, 0xf9, 0x75, 0x9f, 0xf0, 0xe0, 0x1e, 0x51, | 87 0xb4, 0xcf, 0xd7, 0x77, 0x67, 0xf9, 0x75, 0x9f, 0xf0, 0xe0, 0x1e, 0x51, |
88 0xee, 0x46, 0xfd, 0x0b, 0xc9, 0x93, 0x25, 0x55, 0x4a, 0xee, 0xe0, 0x16, | 88 0xee, 0x46, 0xfd, 0x0b, 0xc9, 0x93, 0x25, 0x55, 0x4a, 0xee, 0xe0, 0x16, |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 case JS_GLOBALDATA_TYPE_NULL: { | 446 case JS_GLOBALDATA_TYPE_NULL: { |
447 uint32_t dwNameLen = (uint32_t)name.GetLength(); | 447 uint32_t dwNameLen = (uint32_t)name.GetLength(); |
448 sData.AppendBlock(&dwNameLen, sizeof(uint32_t)); | 448 sData.AppendBlock(&dwNameLen, sizeof(uint32_t)); |
449 sData.AppendString(name); | 449 sData.AppendString(name); |
450 sData.AppendBlock(&wType, sizeof(uint32_t)); | 450 sData.AppendBlock(&wType, sizeof(uint32_t)); |
451 } break; | 451 } break; |
452 default: | 452 default: |
453 break; | 453 break; |
454 } | 454 } |
455 } | 455 } |
OLD | NEW |