diff options
author | tsepez <tsepez@chromium.org> | 2016-04-11 15:18:40 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-11 15:18:40 -0700 |
commit | 24a48881c5407651a58cfd6547ac9b6a9823a63e (patch) | |
tree | 845e370897a8479fe83b99d56352965c562da717 /fpdfsdk/javascript/JS_GlobalData.h | |
parent | 1fdde02d90963f774e7d1b6b0353d23aefe0a357 (diff) | |
download | pdfium-24a48881c5407651a58cfd6547ac9b6a9823a63e.tar.xz |
Pass CFX_ByteStrings rather than raw ptrs to JS_GlobalData.
Helps to avoid re-allocating strings when the caller already
has one allocated.
Review URL: https://codereview.chromium.org/1876203002
Diffstat (limited to 'fpdfsdk/javascript/JS_GlobalData.h')
-rw-r--r-- | fpdfsdk/javascript/JS_GlobalData.h | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/fpdfsdk/javascript/JS_GlobalData.h b/fpdfsdk/javascript/JS_GlobalData.h index 65bb921ad9..056f26193f 100644 --- a/fpdfsdk/javascript/JS_GlobalData.h +++ b/fpdfsdk/javascript/JS_GlobalData.h @@ -64,17 +64,16 @@ class CJS_GlobalData { static CJS_GlobalData* GetRetainedInstance(CPDFDoc_Environment* pApp); void Release(); - void SetGlobalVariableNumber(const FX_CHAR* propname, double dData); - void SetGlobalVariableBoolean(const FX_CHAR* propname, bool bData); - void SetGlobalVariableString(const FX_CHAR* propname, + void SetGlobalVariableNumber(const CFX_ByteString& propname, double dData); + void SetGlobalVariableBoolean(const CFX_ByteString& propname, bool bData); + void SetGlobalVariableString(const CFX_ByteString& propname, const CFX_ByteString& sData); - void SetGlobalVariableObject(const FX_CHAR* propname, + void SetGlobalVariableObject(const CFX_ByteString& propname, const CJS_GlobalVariableArray& array); - void SetGlobalVariableNull(const FX_CHAR* propname); - - FX_BOOL SetGlobalVariablePersistent(const FX_CHAR* propname, + void SetGlobalVariableNull(const CFX_ByteString& propname); + FX_BOOL SetGlobalVariablePersistent(const CFX_ByteString& propname, FX_BOOL bPersistent); - FX_BOOL DeleteGlobalVariable(const FX_CHAR* propname); + FX_BOOL DeleteGlobalVariable(const CFX_ByteString& propname); int32_t GetSize() const; CJS_GlobalData_Element* GetAt(int index) const; @@ -93,9 +92,9 @@ class CJS_GlobalData { void LoadGlobalPersistentVariables(); void SaveGlobalPersisitentVariables(); - CJS_GlobalData_Element* GetGlobalVariable(const FX_CHAR* propname); - iterator FindGlobalVariable(const FX_CHAR* propname); - const_iterator FindGlobalVariable(const FX_CHAR* propname) const; + CJS_GlobalData_Element* GetGlobalVariable(const CFX_ByteString& sPropname); + iterator FindGlobalVariable(const CFX_ByteString& sPropname); + const_iterator FindGlobalVariable(const CFX_ByteString& sPropname) const; void LoadFileBuffer(const FX_WCHAR* sFilePath, uint8_t*& pBuffer, |