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

Issue 1088733002: Kill CFX_Object. (Closed)

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

Description

Kill CFX_Object. CFX_Object is a type that implements its own new operators that return NULL on error. There's no need for this given the |new (std::nothrow)| syntax; in fact, the current code can only work if there is no activity in the constructors. This may explain the pervasive lack of constructors and reliance on Init() methods throughout the codebase. The activity takes place in fx_memory.h, where FX_NEW is mapped onto the std::nothrow syntax. The rest is just cleanup. Down the road, we will simply throw and remove all the error-checking paths for new objects. Landing this patch first will at least show a simple path back to the old behaviour without having to re-introduce CFX_Object should someone want to do so in their own fork. R=thestig@chromium.org Committed: https://pdfium.googlesource.com/pdfium/+/4926900ab54a493d236291b5a24dfa4476792182

Patch Set 1 #

Patch Set 2 : Rebase. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+297 lines, -354 lines) Patch
M core/include/fpdfapi/fpdf_module.h View 3 chunks +3 lines, -3 lines 0 comments Download
M core/include/fpdfapi/fpdf_objects.h View 4 chunks +4 lines, -4 lines 0 comments Download
M core/include/fpdfapi/fpdf_page.h View 3 chunks +3 lines, -3 lines 0 comments Download
M core/include/fpdfapi/fpdf_pageobj.h View 8 chunks +8 lines, -8 lines 0 comments Download
M core/include/fpdfapi/fpdf_parser.h View 9 chunks +9 lines, -9 lines 0 comments Download
M core/include/fpdfapi/fpdf_render.h View 6 chunks +6 lines, -6 lines 0 comments Download
M core/include/fpdfapi/fpdf_resource.h View 1 9 chunks +10 lines, -9 lines 0 comments Download
M core/include/fpdfapi/fpdf_serial.h View 1 chunk +1 line, -1 line 0 comments Download
M core/include/fpdfdoc/fpdf_doc.h View 23 chunks +23 lines, -23 lines 0 comments Download
M core/include/fpdfdoc/fpdf_tagged.h View 2 chunks +2 lines, -2 lines 0 comments Download
M core/include/fpdfdoc/fpdf_vt.h View 2 chunks +2 lines, -2 lines 0 comments Download
M core/include/fpdftext/fpdf_text.h View 4 chunks +4 lines, -4 lines 0 comments Download
M core/include/fxcodec/fx_codec.h View 9 chunks +10 lines, -10 lines 0 comments Download
M core/include/fxcrt/fx_basic.h View 19 chunks +19 lines, -19 lines 0 comments Download
M core/include/fxcrt/fx_coordinates.h View 1 4 chunks +4 lines, -4 lines 0 comments Download
M core/include/fxcrt/fx_memory.h View 2 chunks +7 lines, -64 lines 0 comments Download
M core/include/fxcrt/fx_string.h View 5 chunks +5 lines, -5 lines 0 comments Download
M core/include/fxcrt/fx_xml.h View 3 chunks +4 lines, -4 lines 0 comments Download
M core/include/fxge/fx_dib.h View 8 chunks +8 lines, -8 lines 0 comments Download
M core/include/fxge/fx_font.h View 8 chunks +10 lines, -10 lines 0 comments Download
M core/include/fxge/fx_ge.h View 7 chunks +7 lines, -7 lines 0 comments Download
M core/src/fpdfapi/fpdf_edit/editint.h View 2 chunks +2 lines, -2 lines 0 comments Download
M core/src/fpdfapi/fpdf_font/font_int.h View 1 7 chunks +7 lines, -7 lines 0 comments Download
M core/src/fpdfapi/fpdf_font/fpdf_font.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M core/src/fpdfapi/fpdf_font/ttgsubtable.h View 2 chunks +2 lines, -2 lines 0 comments Download
M core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M core/src/fpdfapi/fpdf_page/pageint.h View 7 chunks +8 lines, -8 lines 0 comments Download
M core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp View 1 chunk +1 line, -1 line 0 comments Download
M core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp View 1 chunk +1 line, -1 line 0 comments Download
M core/src/fpdfapi/fpdf_render/render_int.h View 12 chunks +12 lines, -12 lines 0 comments Download
M core/src/fpdfdoc/doc_form.cpp View 2 chunks +3 lines, -3 lines 0 comments Download
M core/src/fpdfdoc/pdf_vt.h View 5 chunks +5 lines, -5 lines 0 comments Download
M core/src/fpdftext/fpdf_text_search.cpp View 1 chunk +1 line, -1 line 0 comments Download
M core/src/fpdftext/text_int.h View 3 chunks +3 lines, -3 lines 0 comments Download
M core/src/fpdftext/txtproc.h View 3 chunks +4 lines, -4 lines 0 comments Download
M core/src/fxcodec/codec/codec_int.h View 2 chunks +2 lines, -2 lines 0 comments Download
M core/src/fxcodec/codec/fx_codec_fax.cpp View 1 chunk +1 line, -1 line 0 comments Download
M core/src/fxcodec/codec/fx_codec_flate.cpp View 1 chunk +1 line, -1 line 0 comments Download
M core/src/fxcodec/codec/fx_codec_icc.cpp View 3 chunks +3 lines, -3 lines 0 comments Download
M core/src/fxcodec/codec/fx_codec_jpx_opj.cpp View 1 chunk +1 line, -1 line 0 comments Download
M core/src/fxcrt/extension.h View 2 chunks +2 lines, -2 lines 0 comments Download
M core/src/fxcrt/fx_arabic.h View 1 chunk +1 line, -1 line 0 comments Download
M core/src/fxcrt/fx_basic_util.cpp View 1 chunk +1 line, -1 line 0 comments Download
M core/src/fxcrt/fxcrt_platforms.h View 1 chunk +1 line, -1 line 0 comments Download
M core/src/fxcrt/fxcrt_posix.h View 1 chunk +1 line, -1 line 0 comments Download
M core/src/fxcrt/fxcrt_windows.h View 1 chunk +1 line, -1 line 0 comments Download
M core/src/fxcrt/xml_int.h View 2 chunks +2 lines, -2 lines 0 comments Download
M core/src/fxge/agg/agg23/agg_array.h View 3 chunks +3 lines, -3 lines 0 comments Download
M core/src/fxge/agg/agg23/agg_basics.h View 3 chunks +3 lines, -3 lines 0 comments Download
M core/src/fxge/agg/agg23/agg_conv_adaptor_vcgen.h View 2 chunks +2 lines, -2 lines 0 comments Download
M core/src/fxge/agg/agg23/agg_curves.h View 3 chunks +3 lines, -3 lines 0 comments Download
M core/src/fxge/agg/agg23/agg_path_storage.h View 2 chunks +2 lines, -2 lines 0 comments Download
M core/src/fxge/agg/agg23/agg_pixfmt_gray.h View 2 chunks +2 lines, -2 lines 0 comments Download
M core/src/fxge/agg/agg23/agg_rasterizer_scanline_aa.h View 5 chunks +5 lines, -5 lines 0 comments Download
M core/src/fxge/agg/agg23/agg_renderer_base.h View 1 chunk +1 line, -1 line 0 comments Download
M core/src/fxge/agg/agg23/agg_renderer_scanline.h View 1 chunk +1 line, -1 line 0 comments Download
M core/src/fxge/agg/agg23/agg_rendering_buffer.h View 1 chunk +3 lines, -3 lines 0 comments Download
M core/src/fxge/agg/agg23/agg_scanline_u.h View 1 chunk +2 lines, -2 lines 0 comments Download
M core/src/fxge/agg/agg23/agg_vcgen_dash.h View 1 chunk +1 line, -1 line 0 comments Download
M core/src/fxge/agg/agg23/agg_vcgen_stroke.h View 1 chunk +1 line, -1 line 0 comments Download
M core/src/fxge/agg/agg23/agg_vertex_sequence.h View 1 chunk +1 line, -1 line 0 comments Download
M core/src/fxge/agg/agg23/fx_agg_driver.cpp View 1 chunk +1 line, -1 line 0 comments Download
M core/src/fxge/agg/include/fx_agg_driver.h View 1 chunk +1 line, -1 line 0 comments Download
M core/src/fxge/android/fpf_skiafont.h View 1 chunk +1 line, -1 line 0 comments Download
M core/src/fxge/android/fpf_skiafontmgr.h View 2 chunks +2 lines, -2 lines 0 comments Download
M core/src/fxge/android/fpf_skiamodule.h View 1 chunk +1 line, -1 line 0 comments Download
M core/src/fxge/apple/apple_int.h View 1 chunk +1 line, -1 line 0 comments Download
M core/src/fxge/dib/dib_int.h View 3 chunks +3 lines, -3 lines 0 comments Download
M core/src/fxge/dib/fx_dib_convert.cpp View 1 chunk +1 line, -1 line 0 comments Download
M core/src/fxge/ge/fx_ge_ps.cpp View 1 chunk +1 line, -1 line 0 comments Download
M core/src/fxge/ge/text_int.h View 4 chunks +4 lines, -4 lines 0 comments Download
M core/src/fxge/skia/fx_skia_blitter_new.h View 3 chunks +3 lines, -3 lines 0 comments Download
M core/src/fxge/skia/fx_skia_device.cpp View 1 chunk +1 line, -1 line 0 comments Download
M core/src/fxge/win32/fx_win32_dwrite.cpp View 4 chunks +4 lines, -4 lines 0 comments Download
M core/src/fxge/win32/fx_win32_gdipext.cpp View 1 chunk +1 line, -1 line 0 comments Download
M core/src/fxge/win32/win32_int.h View 2 chunks +2 lines, -2 lines 0 comments Download
M core/src/reflow/autoreflow.h View 3 chunks +3 lines, -3 lines 0 comments Download
M core/src/reflow/layoutprovider_taggedpdf.h View 2 chunks +2 lines, -2 lines 0 comments Download
M core/src/reflow/reflowedpage.h View 9 chunks +8 lines, -9 lines 0 comments Download
M fpdfsdk/include/fsdk_baseannot.h View 1 chunk +1 line, -1 line 0 comments Download
M fpdfsdk/include/fsdk_define.h View 1 chunk +1 line, -1 line 0 comments Download
M fpdfsdk/include/fsdk_rendercontext.h View 1 chunk +1 line, -1 line 0 comments Download
M fpdfsdk/include/javascript/JS_Object.h View 2 chunks +2 lines, -2 lines 0 comments Download
M fpdfsdk/src/fpdf_dataavail.cpp View 1 chunk +1 line, -1 line 0 comments Download
M fpdfsdk/src/fpdfview.cpp View 1 chunk +1 line, -1 line 0 comments Download
M fpdfsdk/src/jsapi/fxjs_v8.cpp View 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 8 (2 generated)
Tom Sepez
Lei, for review.
5 years, 8 months ago (2015-04-13 23:46:47 UTC) #2
Tom Sepez
+Bruce for windows-isms
5 years, 8 months ago (2015-04-13 23:48:42 UTC) #4
Lei Zhang
On 2015/04/13 23:48:42, Tom Sepez wrote: > +Bruce for windows-isms BTW, it looks like fx_memory.h ...
5 years, 8 months ago (2015-04-14 00:15:33 UTC) #5
Lei Zhang
lgtm
5 years, 8 months ago (2015-04-14 00:28:59 UTC) #6
brucedawson
I haven't looked at it in detail but it seems good. An official looks-good could ...
5 years, 8 months ago (2015-04-14 18:59:33 UTC) #7
Tom Sepez
5 years, 8 months ago (2015-04-14 19:54:43 UTC) #8
Message was sent while issue was closed.
Committed patchset #2 (id:20001) manually as
4926900ab54a493d236291b5a24dfa4476792182 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698