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/global.h" | 7 #include "fpdfsdk/javascript/global.h" |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 } | 400 } |
401 } | 401 } |
402 | 402 |
403 void JSGlobalAlternate::DestroyGlobalPersisitentVariables() { | 403 void JSGlobalAlternate::DestroyGlobalPersisitentVariables() { |
404 for (const auto& pair : m_mapGlobal) { | 404 for (const auto& pair : m_mapGlobal) { |
405 delete pair.second; | 405 delete pair.second; |
406 } | 406 } |
407 m_mapGlobal.clear(); | 407 m_mapGlobal.clear(); |
408 } | 408 } |
409 | 409 |
410 FX_BOOL JSGlobalAlternate::SetGlobalVariables(const FX_CHAR* propname, | 410 FX_BOOL JSGlobalAlternate::SetGlobalVariables(const CFX_ByteString& propname, |
411 int nType, | 411 int nType, |
412 double dData, | 412 double dData, |
413 bool bData, | 413 bool bData, |
414 const CFX_ByteString& sData, | 414 const CFX_ByteString& sData, |
415 v8::Local<v8::Object> pData, | 415 v8::Local<v8::Object> pData, |
416 bool bDefaultPersistent) { | 416 bool bDefaultPersistent) { |
417 if (!propname) | 417 if (!propname) |
418 return FALSE; | 418 return FALSE; |
419 | 419 |
420 auto it = m_mapGlobal.find(propname); | 420 auto it = m_mapGlobal.find(propname); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 return CJS_Value::VT_boolean; | 504 return CJS_Value::VT_boolean; |
505 if (nHash == JSCONST_nDateHash) | 505 if (nHash == JSCONST_nDateHash) |
506 return CJS_Value::VT_date; | 506 return CJS_Value::VT_date; |
507 if (nHash == JSCONST_nObjectHash) | 507 if (nHash == JSCONST_nObjectHash) |
508 return CJS_Value::VT_object; | 508 return CJS_Value::VT_object; |
509 if (nHash == JSCONST_nFXobjHash) | 509 if (nHash == JSCONST_nFXobjHash) |
510 return CJS_Value::VT_fxobject; | 510 return CJS_Value::VT_fxobject; |
511 | 511 |
512 return CJS_Value::VT_unknown; | 512 return CJS_Value::VT_unknown; |
513 } | 513 } |
OLD | NEW |