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

Issue 1541703003: Use std::map as CPDF_Dictionary's underlying store. (Closed)

Created:
5 years ago by Oliver Chang
Modified:
4 years, 11 months ago
Reviewers:
Lei Zhang, Tom Sepez
CC:
pdfium-reviews_googlegroups.com
Base URL:
https://pdfium.googlesource.com/pdfium.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Use std::map as CPDF_Dictionary's underlying store. Replaces CFX_CMapByteStringToPtr. XFA still uses CFX_CMapByteStringToPtr so it's not completely removed just yet. Adds begin()/end() to CPDF_Dictionary and removes the GetStartPos()/GetNextElement() functions to traverse the dictionary. Callers are changed accordingly. AddValue() is also removed. R=tsepez@chromium.org, thestig@chromium.org Committed: https://pdfium.googlesource.com/pdfium/+/14f39950451bb9c2a11fbc7173fd47367410f80f

Patch Set 1 #

Patch Set 2 : XFA still uses CFX_CMapByteStringToPtr :( #

Total comments: 4

Patch Set 3 : rebase + address comments #

Total comments: 10

Patch Set 4 : address comments, rebase, fix embedder test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+175 lines, -264 lines) Patch
M core/include/fpdfapi/fpdf_objects.h View 1 2 4 chunks +13 lines, -7 lines 0 comments Download
M core/include/fpdfdoc/fpdf_doc.h View 1 2 1 chunk +0 lines, -4 lines 0 comments Download
M core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp View 1 2 3 5 chunks +16 lines, -16 lines 0 comments Download
M core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp View 1 2 3 1 chunk +3 lines, -5 lines 0 comments Download
M core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp View 1 chunk +3 lines, -4 lines 0 comments Download
M core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp View 1 2 3 2 chunks +6 lines, -8 lines 0 comments Download
M core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp View 1 2 3 8 chunks +56 lines, -82 lines 0 comments Download
M core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp View 1 2 3 4 chunks +9 lines, -19 lines 0 comments Download
M core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp View 1 2 3 1 chunk +3 lines, -4 lines 0 comments Download
M core/src/fpdfdoc/doc_action.cpp View 1 chunk +0 lines, -31 lines 0 comments Download
M core/src/fpdfdoc/doc_formcontrol.cpp View 3 chunks +8 lines, -13 lines 0 comments Download
M core/src/fpdfdoc/doc_utils.cpp View 6 chunks +17 lines, -30 lines 0 comments Download
M fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp View 1 2 1 chunk +3 lines, -5 lines 0 comments Download
M fpdfsdk/src/fpdf_flatten.cpp View 1 chunk +3 lines, -4 lines 0 comments Download
M fpdfsdk/src/fpdf_transformpage.cpp View 1 chunk +3 lines, -5 lines 0 comments Download
M fpdfsdk/src/fpdfedit_embeddertest.cpp View 1 2 3 1 chunk +6 lines, -5 lines 0 comments Download
M fpdfsdk/src/fpdfppo.cpp View 1 2 2 chunks +6 lines, -9 lines 0 comments Download
M fpdfsdk/src/fpdfview.cpp View 1 2 2 chunks +17 lines, -9 lines 0 comments Download
M fpdfsdk/src/javascript/Document.cpp View 1 2 3 1 chunk +3 lines, -4 lines 0 comments Download

Messages

Total messages: 18 (4 generated)
Oliver Chang
ptal, no rush. Depending on how much extra work needs to be done in XFA, ...
5 years ago (2015-12-21 23:00:00 UTC) #4
Tom Sepez
Last time I tried this, I had some test failures based on the ordering and ...
4 years, 11 months ago (2016-01-05 19:41:56 UTC) #5
Oliver Chang
that's strange, i'm not seeing any tests fail locally. do you remember what those guarantees ...
4 years, 11 months ago (2016-01-07 16:04:25 UTC) #6
Charles Lew
https://codereview.chromium.org/1541703003/diff/40001/core/include/fpdfapi/fpdf_objects.h File core/include/fpdfapi/fpdf_objects.h (right): https://codereview.chromium.org/1541703003/diff/40001/core/include/fpdfapi/fpdf_objects.h#newcode437 core/include/fpdfapi/fpdf_objects.h:437: std::map<CFX_ByteString, CPDF_Object*> m_Map; Not sure if it is a ...
4 years, 11 months ago (2016-01-07 16:44:49 UTC) #7
Tom Sepez
On 2016/01/07 16:04:25, Oliver Chang wrote: > that's strange, i'm not seeing any tests fail ...
4 years, 11 months ago (2016-01-07 17:00:22 UTC) #8
Tom Sepez
> https://code.google.com/p/chromium/codesearch#chromium/src/third_party/pdfium/fpdfsdk/src/fpdfview.cpp&rcl=1452170155&l=885 > -- I think iFPDF_GetNamedDest() that returns an index to the caller of ...
4 years, 11 months ago (2016-01-07 21:43:21 UTC) #9
Tom Sepez
https://codereview.chromium.org/1541703003/diff/40001/core/include/fpdfapi/fpdf_objects.h File core/include/fpdfapi/fpdf_objects.h (right): https://codereview.chromium.org/1541703003/diff/40001/core/include/fpdfapi/fpdf_objects.h#newcode437 core/include/fpdfapi/fpdf_objects.h:437: std::map<CFX_ByteString, CPDF_Object*> m_Map; On 2016/01/07 16:44:49, crlf0710 wrote: > ...
4 years, 11 months ago (2016-01-07 21:45:16 UTC) #10
Oliver Chang
On 2016/01/07 21:43:21, Tom Sepez wrote: > > > https://code.google.com/p/chromium/codesearch#chromium/src/third_party/pdfium/fpdfsdk/src/fpdfview.cpp&rcl=1452170155&l=885 > > -- I think ...
4 years, 11 months ago (2016-01-07 23:01:33 UTC) #11
Tom Sepez
> To be safe, we can probably preserve insertion order by making m_Map's value be ...
4 years, 11 months ago (2016-01-07 23:05:23 UTC) #12
Tom Sepez
https://codereview.chromium.org/1541703003/diff/40001/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp File core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp (right): https://codereview.chromium.org/1541703003/diff/40001/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp#newcode1780 core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp:1780: if (key == "Encrypt" || key == "Size" || ...
4 years, 11 months ago (2016-01-08 00:33:52 UTC) #13
Oliver Chang
Tried this patch on Windows and things seem to work. XFA doesn't look like too ...
4 years, 11 months ago (2016-01-08 23:14:58 UTC) #14
Oliver Chang
https://codereview.chromium.org/1541703003/diff/40001/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp File core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp (right): https://codereview.chromium.org/1541703003/diff/40001/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp#newcode690 core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp:690: return m_Map.find(key) != m_Map.end(); On 2016/01/08 00:33:52, Tom Sepez ...
4 years, 11 months ago (2016-01-08 23:15:42 UTC) #15
Tom Sepez
lgtm
4 years, 11 months ago (2016-01-09 00:38:42 UTC) #16
Oliver Chang
4 years, 11 months ago (2016-01-11 16:30:24 UTC) #18
Message was sent while issue was closed.
Committed patchset #4 (id:60001) manually as
14f39950451bb9c2a11fbc7173fd47367410f80f (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698