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

Issue 370853002: pdfium: Fix all -Wdelete-non-virtual-dtor violations on Mac. (Closed)

Created:
6 years, 5 months ago by Nico
Modified:
6 years, 5 months ago
Reviewers:
Bo Xu, jun_fang, jam
CC:
pdfium-reviews_googlegroups.com
Base URL:
https://pdfium.googlesource.com/pdfium.git@master
Visibility:
Public.

Description

pdfium: Fix all -Wdelete-non-virtual-dtor violations on Mac. Calling `delete` on an object of a type that has virtual functions but not a virtual destructor is questionable: Since the object has virtual functions, it likely has subclasses, so if it's deleted through the base pointer and the destructor isn't virtual, the subclass destructor won't be called. In most cases, the classes getting deleted can just be marked final to tell the compiler that it can't possibly have subclasses (this also enables the compiler to generate better code). Two classes didn't have any sub- or superclasses but virtual functions - this doesn't make sense, so make all methods of these classes non-virtual. (Also delete an unused function on one of the two classes.) In one case, a class actually did have a subclass that needs to be deleted virtually, so mark one destructor as virtual. BUG=none R=bo_xu@foxitsoftware.com Committed: https://pdfium.googlesource.com/pdfium/+/5eb9f7b

Patch Set 1 #

Total comments: 1

Patch Set 2 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+53 lines, -51 lines) Patch
M core/include/fpdfapi/fpdf_parser.h View 2 chunks +2 lines, -2 lines 0 comments Download
M core/include/fxcrt/fx_system.h View 1 chunk +9 lines, -0 lines 0 comments Download
M core/include/fxge/fx_font.h View 1 chunk +1 line, -1 line 0 comments Download
M core/src/fpdfapi/fpdf_font/ttgsubtable.h View 1 chunk +1 line, -1 line 0 comments Download
M core/src/fpdfdoc/tagged_int.h View 1 chunk +1 line, -1 line 0 comments Download
M core/src/fxcrt/extension.h View 1 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/fxge/apple/apple_int.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_mgr.h View 14 chunks +31 lines, -38 lines 0 comments Download
M fpdfsdk/src/fpdf_sysfontinfo.cpp View 1 chunk +1 line, -1 line 0 comments Download
M fpdfsdk/src/fpdfsave.cpp View 1 chunk +1 line, -1 line 0 comments Download
M fpdfsdk/src/fpdfview.cpp View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 8 (0 generated)
Nico
The direct motivation was that this warning isn't disabled for some reason on the clang/win ...
6 years, 5 months ago (2014-07-05 03:29:13 UTC) #1
jam
rerouting to Bo/Jun
6 years, 5 months ago (2014-07-14 22:49:08 UTC) #2
Nico
Bo/Jun: Ping.
6 years, 5 months ago (2014-07-15 21:45:24 UTC) #3
Bo Xu
On 2014/07/15 21:45:24, Nico (away) wrote: > Bo/Jun: Ping. I am looking at this one.
6 years, 5 months ago (2014-07-15 22:11:15 UTC) #4
Nico
On 2014/07/15 22:11:15, Bo Xu wrote: > On 2014/07/15 21:45:24, Nico (away) wrote: > > ...
6 years, 5 months ago (2014-07-16 20:50:03 UTC) #5
Bo Xu
On 2014/07/16 20:50:03, Nico (away) wrote: > On 2014/07/15 22:11:15, Bo Xu wrote: > > ...
6 years, 5 months ago (2014-07-16 20:55:59 UTC) #6
Bo Xu
lgtm
6 years, 5 months ago (2014-07-18 02:17:48 UTC) #7
Nico
6 years, 5 months ago (2014-07-18 16:14:39 UTC) #8
Message was sent while issue was closed.
Committed patchset #2 manually as r5eb9f7b (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698