| 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 "../../../core/include/fdrm/fx_crypt.h" | 7 #include "../../../core/include/fdrm/fx_crypt.h" |
| 8 #include "../../include/javascript/JavaScript.h" | 8 #include "../../include/javascript/JavaScript.h" |
| 9 #include "../../include/javascript/IJavaScript.h" | 9 #include "../../include/javascript/IJavaScript.h" |
| 10 #include "../../include/javascript/JS_GlobalData.h" | 10 #include "../../include/javascript/JS_GlobalData.h" |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 SetGlobalVariablePersistent(sEntry, TRUE); | 391 SetGlobalVariablePersistent(sEntry, TRUE); |
| 392 } | 392 } |
| 393 } | 393 } |
| 394 } | 394 } |
| 395 } | 395 } |
| 396 } | 396 } |
| 397 FX_Free(pBuffer); | 397 FX_Free(pBuffer); |
| 398 } | 398 } |
| 399 } | 399 } |
| 400 | 400 |
| 401 /* | |
| 402 struct js_global_datafile_header | |
| 403 { | |
| 404 FX_WORD type; //FX ('X' << 8) | 'F' | |
| 405 FX_WORD version; //1.0 | |
| 406 FX_DWORD datacount; | |
| 407 }; | |
| 408 struct js_global_datafile_data | |
| 409 { | |
| 410 FX_WORD type; | |
| 411 FX_DWORD nData; | |
| 412 FX_WORD bData; | |
| 413 FX_DWORD nStrLen; | |
| 414 char* pStr; | |
| 415 }; | |
| 416 */ | |
| 417 | |
| 418 void CJS_GlobalData::SaveGlobalPersisitentVariables() { | 401 void CJS_GlobalData::SaveGlobalPersisitentVariables() { |
| 419 FX_DWORD nCount = 0; | 402 FX_DWORD nCount = 0; |
| 420 CFX_BinaryBuf sData; | 403 CFX_BinaryBuf sData; |
| 421 | 404 |
| 422 for (int i = 0, sz = m_arrayGlobalData.GetSize(); i < sz; i++) { | 405 for (int i = 0, sz = m_arrayGlobalData.GetSize(); i < sz; i++) { |
| 423 CJS_GlobalData_Element* pElement = m_arrayGlobalData.GetAt(i); | 406 CJS_GlobalData_Element* pElement = m_arrayGlobalData.GetAt(i); |
| 424 ASSERT(pElement != NULL); | 407 ASSERT(pElement != NULL); |
| 425 | 408 |
| 426 if (pElement->bPersistent) { | 409 if (pElement->bPersistent) { |
| 427 CFX_BinaryBuf sElement; | 410 CFX_BinaryBuf sElement; |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 case JS_GLOBALDATA_TYPE_NULL: { | 484 case JS_GLOBALDATA_TYPE_NULL: { |
| 502 FX_DWORD dwNameLen = (FX_DWORD)name.GetLength(); | 485 FX_DWORD dwNameLen = (FX_DWORD)name.GetLength(); |
| 503 sData.AppendBlock(&dwNameLen, sizeof(FX_DWORD)); | 486 sData.AppendBlock(&dwNameLen, sizeof(FX_DWORD)); |
| 504 sData.AppendString(name); | 487 sData.AppendString(name); |
| 505 sData.AppendBlock(&wType, sizeof(FX_DWORD)); | 488 sData.AppendBlock(&wType, sizeof(FX_DWORD)); |
| 506 } break; | 489 } break; |
| 507 default: | 490 default: |
| 508 break; | 491 break; |
| 509 } | 492 } |
| 510 } | 493 } |
| OLD | NEW |