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

Issue 1879683002: Remove CPDF_Object::GetConstString and overrides (Closed)

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

Description

Remove CPDF_Object::GetConstString and overrides GetConstString() has sharp edges in that when applied to a CPDF_Number, it must return null whereas GetString() returns a the stringified number, because of the inability to control the lifetime of the underlying allocated string. Deleting this method showed several places where we actually wanted a *String, not a *StringC, so we were re-allocating a string we already had. Committed: https://pdfium.googlesource.com/pdfium/+/822484b5f88d92dbcd567b1c2da38af1e720b56f

Patch Set 1 #

Total comments: 5

Patch Set 2 : Move bLuminosity down. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+21 lines, -94 lines) Patch
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 chunk +4 lines, -3 lines 0 comments Download
M core/fpdfapi/fpdf_parser/cpdf_array.cpp View 1 chunk +0 lines, -6 lines 0 comments Download
M core/fpdfapi/fpdf_parser/cpdf_dictionary.cpp View 2 chunks +0 lines, -13 lines 0 comments Download
M core/fpdfapi/fpdf_parser/cpdf_name.cpp View 1 chunk +0 lines, -4 lines 0 comments Download
M core/fpdfapi/fpdf_parser/cpdf_object.cpp View 1 chunk +0 lines, -4 lines 0 comments Download
M core/fpdfapi/fpdf_parser/cpdf_object_unittest.cpp View 3 chunks +0 lines, -32 lines 0 comments Download
M core/fpdfapi/fpdf_parser/cpdf_reference.cpp View 1 chunk +0 lines, -5 lines 0 comments Download
M core/fpdfapi/fpdf_parser/cpdf_string.cpp View 1 chunk +0 lines, -4 lines 0 comments Download
M core/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M core/fpdfapi/fpdf_parser/include/cpdf_array.h View 1 chunk +0 lines, -1 line 0 comments Download
M core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h View 1 chunk +0 lines, -3 lines 0 comments Download
M core/fpdfapi/fpdf_parser/include/cpdf_name.h View 1 chunk +0 lines, -1 line 0 comments Download
M core/fpdfapi/fpdf_parser/include/cpdf_object.h View 1 chunk +0 lines, -3 lines 0 comments Download
M core/fpdfapi/fpdf_parser/include/cpdf_reference.h View 1 chunk +0 lines, -1 line 0 comments Download
M core/fpdfapi/fpdf_parser/include/cpdf_string.h View 1 chunk +0 lines, -1 line 0 comments Download
M core/fpdfapi/fpdf_render/fpdf_render_image.cpp View 1 3 chunks +7 lines, -6 lines 0 comments Download
M core/fpdfdoc/cpvt_generateap.cpp View 1 chunk +1 line, -1 line 0 comments Download
M core/fpdfdoc/doc_annot.cpp View 2 chunks +4 lines, -2 lines 0 comments Download
M core/fpdfdoc/doc_basic.cpp View 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 10 (5 generated)
Tom Sepez
Lei, 180 degree about-face.
4 years, 8 months ago (2016-04-11 20:17:13 UTC) #3
Tom Sepez
https://codereview.chromium.org/1879683002/diff/1/core/fpdfapi/fpdf_page/fpdf_page_doc.cpp File core/fpdfapi/fpdf_page/fpdf_page_doc.cpp (right): https://codereview.chromium.org/1879683002/diff/1/core/fpdfapi/fpdf_page/fpdf_page_doc.cpp#newcode329 core/fpdfapi/fpdf_page/fpdf_page_doc.cpp:329: CFX_ByteString name = pCSObj->GetString(); note: avoids a duplicate alloc ...
4 years, 8 months ago (2016-04-11 20:19:46 UTC) #4
Lei Zhang
lgtm https://codereview.chromium.org/1879683002/diff/1/core/fpdfapi/fpdf_render/fpdf_render_image.cpp File core/fpdfapi/fpdf_render/fpdf_render_image.cpp (right): https://codereview.chromium.org/1879683002/diff/1/core/fpdfapi/fpdf_render/fpdf_render_image.cpp#newcode885 core/fpdfapi/fpdf_render/fpdf_render_image.cpp:885: FX_BOOL bLuminosity = pSMaskDict->GetStringBy("S") != "Alpha"; You can ...
4 years, 8 months ago (2016-04-11 21:57:34 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1879683002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1879683002/20001
4 years, 8 months ago (2016-04-12 00:45:40 UTC) #8
commit-bot: I haz the power
4 years, 8 months ago (2016-04-12 01:14:59 UTC) #10
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://pdfium.googlesource.com/pdfium/+/822484b5f88d92dbcd567b1c2da38af1e720...

Powered by Google App Engine
This is Rietveld 408576698