diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-01-05 13:57:58 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-01-05 21:18:36 +0000 |
commit | 7855a2c57745c8f81ce410e6af0e4068fa2e8967 (patch) | |
tree | 1665c5fb69a504eafc6add770cad92d742e8d80d /xfa/fxfa/fm2js/xfa_fm2jscontext.h | |
parent | e647799f6a2f7f747c9f55d9f0ce08dcdfbd53f4 (diff) | |
download | pdfium-7855a2c57745c8f81ce410e6af0e4068fa2e8967.tar.xz |
Cleaning up memory allocation in CXFA_FM2JSContext - Ichromium/2974
This CL updates ::ParseResolveResult to accept a
std::vector<std::unique_ptr<CFXJSE_Value>>& instead of a CFXJSE_Value**&. This
removes a bunch of manual new/delete code used to mantain the values.
The size parameter was also removed and is retrieved by calling .size() on the
vector now.
Change-Id: I60fc6176523ece112d41fdefc767aaefedfae2db
Reviewed-on: https://pdfium-review.googlesource.com/2153
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/fm2js/xfa_fm2jscontext.h')
-rw-r--r-- | xfa/fxfa/fm2js/xfa_fm2jscontext.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/xfa/fxfa/fm2js/xfa_fm2jscontext.h b/xfa/fxfa/fm2js/xfa_fm2jscontext.h index 413cb3027a..66e5dcce8b 100644 --- a/xfa/fxfa/fm2js/xfa_fm2jscontext.h +++ b/xfa/fxfa/fm2js/xfa_fm2jscontext.h @@ -8,6 +8,7 @@ #define XFA_FXFA_FM2JS_XFA_FM2JSCONTEXT_H_ #include <memory> +#include <vector> #include "fxjs/cfxjse_arguments.h" #include "fxjs/cfxjse_context.h" @@ -423,12 +424,12 @@ class CXFA_FM2JSContext : public CFXJSE_HostObject { XFA_RESOLVENODE_RS& resoveNodeRS, bool bdotAccessor = true, bool bHasNoResolveName = false); - static void ParseResolveResult(CFXJSE_Value* pThis, - const XFA_RESOLVENODE_RS& resoveNodeRS, - CFXJSE_Value* pParentValue, - CFXJSE_Value**& resultValues, - int32_t& iSize, - bool& bAttribute); + static void ParseResolveResult( + CFXJSE_Value* pThis, + const XFA_RESOLVENODE_RS& resoveNodeRS, + CFXJSE_Value* pParentValue, + std::vector<std::unique_ptr<CFXJSE_Value>>* resultValues, + bool* bAttribute); static std::unique_ptr<CFXJSE_Value> GetSimpleValue(CFXJSE_Value* pThis, CFXJSE_Arguments& args, |