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

Issue 1889863002: Make CPDF_Dictionary methods take CFX_ByteString arguments (Closed)

Created:
4 years, 8 months ago by Tom Sepez
Modified:
4 years, 8 months ago
Reviewers:
dsinclair
CC:
pdfium-reviews_googlegroups.com
Base URL:
https://pdfium.googlesource.com/pdfium.git@master
Target Ref:
refs/heads/master
Project:
pdfium
Visibility:
Public.

Description

Make CPDF_Dictionary methods take CFX_ByteString arguments This will help avoid duplicate allocation of CFX_ByteStrings when the caller already has one. It may seem counter-intuitive that requiring the caller to pass an allocated CFX_ByteString rather than a static CFX_ByteStringC would improve the situation, but due to the idiosyncrasies of std::map, the CPDF_Dictionary methods must always do an allocation under the covers which can't be avoided. The changed callers in this CL are places where we would previously demote to CFX_ByteStringC and then allocate a a duplicate CFX_ByteString in the dictionary method. Committed: https://pdfium.googlesource.com/pdfium/+/7b1ccf9697692844e764d730079a0f0b98fd6d06

Patch Set 1 #

Patch Set 2 : Avoid more duplication. #

Total comments: 1

Patch Set 3 : One last caller. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+140 lines, -155 lines) Patch
M core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp View 1 2 1 chunk +2 lines, -3 lines 0 comments Download
M core/fpdfapi/fpdf_page/fpdf_page_doc.cpp View 1 chunk +1 line, -1 line 0 comments Download
M core/fpdfapi/fpdf_page/fpdf_page_parser.cpp View 1 5 chunks +8 lines, -8 lines 0 comments Download
M core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M core/fpdfapi/fpdf_parser/cpdf_dictionary.cpp View 9 chunks +36 lines, -43 lines 0 comments Download
M core/fpdfapi/fpdf_parser/cpdf_object_unittest.cpp View 1 3 chunks +3 lines, -3 lines 0 comments Download
M core/fpdfapi/fpdf_parser/cpdf_parser.cpp View 1 1 chunk +3 lines, -4 lines 0 comments Download
M core/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h View 1 chunk +30 lines, -30 lines 0 comments Download
M core/fpdfdoc/cpvt_fontmap.cpp View 1 1 chunk +2 lines, -3 lines 0 comments Download
M core/fpdfdoc/cpvt_generateap.cpp View 1 4 chunks +7 lines, -9 lines 0 comments Download
M core/fpdfdoc/doc_annot.cpp View 1 1 chunk +2 lines, -2 lines 0 comments Download
M core/fpdfdoc/doc_basic.cpp View 1 chunk +1 line, -1 line 0 comments Download
M core/fpdfdoc/doc_form.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M core/fpdfdoc/doc_formcontrol.cpp View 1 3 chunks +3 lines, -3 lines 0 comments Download
M core/fpdfdoc/doc_formfield.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M core/fpdfdoc/doc_ocg.cpp View 1 2 chunks +4 lines, -4 lines 0 comments Download
M core/fpdfdoc/doc_tagged.cpp View 2 chunks +3 lines, -4 lines 0 comments Download
M core/fpdfdoc/doc_utils.cpp View 1 4 chunks +4 lines, -5 lines 0 comments Download
M fpdfsdk/formfiller/cba_fontmap.cpp View 1 4 chunks +7 lines, -7 lines 0 comments Download
M fpdfsdk/fpdf_flatten.cpp View 1 4 chunks +4 lines, -4 lines 0 comments Download
M fpdfsdk/fpdfppo.cpp View 1 2 chunks +4 lines, -4 lines 0 comments Download
M fpdfsdk/fsdk_baseannot.cpp View 1 1 chunk +5 lines, -5 lines 0 comments Download
M fpdfsdk/fsdk_baseform.cpp View 1 3 chunks +5 lines, -6 lines 0 comments Download

Messages

Total messages: 15 (8 generated)
Tom Sepez
Dan, avoid a few malloc/copies.
4 years, 8 months ago (2016-04-14 17:23:50 UTC) #4
Tom Sepez
On 2016/04/14 17:23:50, Tom Sepez wrote: > Dan, avoid a few malloc/copies. Hang on. Found ...
4 years, 8 months ago (2016-04-14 17:26:57 UTC) #7
Tom Sepez
Ok, please review.
4 years, 8 months ago (2016-04-14 17:43:24 UTC) #8
dsinclair
lgtm w/ question. https://codereview.chromium.org/1889863002/diff/20001/core/fpdfapi/fpdf_parser/cpdf_object_unittest.cpp File core/fpdfapi/fpdf_parser/cpdf_object_unittest.cpp (right): https://codereview.chromium.org/1889863002/diff/20001/core/fpdfapi/fpdf_parser/cpdf_object_unittest.cpp#newcode559 core/fpdfapi/fpdf_parser/cpdf_object_unittest.cpp:559: vals[i]->SetAt(key.c_str(), new CPDF_Number(value)); I'm assuming we'll ...
4 years, 8 months ago (2016-04-14 17:48:19 UTC) #9
Tom Sepez
On 2016/04/14 17:48:19, dsinclair wrote: > lgtm w/ question. > > https://codereview.chromium.org/1889863002/diff/20001/core/fpdfapi/fpdf_parser/cpdf_object_unittest.cpp > File core/fpdfapi/fpdf_parser/cpdf_object_unittest.cpp ...
4 years, 8 months ago (2016-04-14 17:51:49 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1889863002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1889863002/40001
4 years, 8 months ago (2016-04-14 17:52:08 UTC) #13
commit-bot: I haz the power
4 years, 8 months ago (2016-04-14 18:05:01 UTC) #15
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://pdfium.googlesource.com/pdfium/+/7b1ccf9697692844e764d730079a0f0b98fd...

Powered by Google App Engine
This is Rietveld 408576698