Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: fpdfsdk/javascript/global.cpp

Issue 1876203002: Pass CFX_ByteStrings rather than raw ptrs to JS_GlobalData. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Pass by const ref Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fpdfsdk/javascript/global.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « fpdfsdk/javascript/global.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698