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

Issue 7087028: roll clang 131935:132017 (Closed)

Created:
9 years, 6 months ago by Nico
Modified:
9 years, 6 months ago
Reviewers:
Evan Martin
CC:
chromium-reviews, fischman+watch_chromium.org, pam+watch_chromium.org, ukai+watch_chromium.org
Visibility:
Public.

Description

roll clang 131935:132017 clang recently added a warning that warns when invoking 'delete' on a polymorphic non-final class without a virtual destructor. This finds real bugs – see the bug referenced below for a few examples. However, one common pattern where it fires is this case: class SomeInterface { public: virtual void interfaceMethod() {} // or = 0; protected: ~SomeInterface() {} } class WorkerClass : public SomeInterface { public: // many non-virtual functions, but also: virtual void interfaceMethod() override { /* do actual work */ } }; void f() { scoped_ptr<WorkerClass> c(new WorkerClass); // simplified example } (See the 2nd half of http://www.gotw.ca/publications/mill18.htm for an explanation of this pattern.) It is arguably correct to fire the warning here, since someone might make a subclass of WorkerClass and replace |new WorkerClass| with |new WorkerClassSubclass|. This would be broken since WorkerClass doesn't have a virtual destructor. The solution that the clang folks recommend is to mark WorkerClass as |final| (a c++0x keyword that clang supports as an extension in normal c++ mode – like override). But chrome's base/OWNERS deemed that as too complicated and we decided to make virtual the destructors of leaf classes that implement these interfaces and that are deleted dynamically. All of the changes in this CL are to shut up the warning, not because of real problems (I fixed these in separate CLs). (For the gtk files, this is necessary because the CHROMEGTK_CALLBACK_ macros add virtual functions.) BUG=84424 TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=88270

Patch Set 1 #

Patch Set 2 : . #

Patch Set 3 : . #

Patch Set 4 : . #

Patch Set 5 : . #

Patch Set 6 : . #

Patch Set 7 : . #

Patch Set 8 : rebase #

Patch Set 9 : . #

Patch Set 10 : rebase #

Patch Set 11 : . #

Patch Set 12 : . #

Patch Set 13 : . #

Patch Set 14 : . #

Patch Set 15 : . #

Patch Set 16 : . #

Patch Set 17 : rebase #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+56 lines, -21 lines) Patch
M base/message_loop_unittest.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M build/common.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +11 lines, -0 lines 0 comments Download
M chrome/browser/download/base_file.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/download/save_file.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/gtk/crypto_module_password_dialog.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -0 lines 2 comments Download
M chrome/browser/ui/gtk/external_protocol_dialog_gtk.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/gtk/hung_renderer_dialog_gtk.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/gtk/importer/import_lock_dialog_gtk.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/gtk/instant_confirm_dialog_gtk.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/gtk/menu_gtk.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/gtk/update_recommended_dialog.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
M chrome/renderer/chrome_content_renderer_client.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M content/browser/device_orientation/provider_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_message_filter.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -0 lines 0 comments Download
M content/ppapi_plugin/ppapi_webkitclient_impl.cc View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M content/renderer/content_renderer_client.h View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M content/renderer/external_popup_menu.h View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M content/renderer/render_widget_fullscreen_pepper.cc View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M content/renderer/renderer_webkitclient_impl.cc View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M ppapi/proxy/plugin_resource_tracker.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ppapi/proxy/ppb_flash_file_proxy.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M remoting/jingle_glue/jingle_client.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M remoting/protocol/protocol_test_client.cc View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M tools/clang/scripts/update.sh View 1 1 chunk +1 line, -1 line 0 comments Download
M ui/base/x/active_window_watcher_x.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M webkit/fileapi/file_system_file_util.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M webkit/fileapi/quota_file_util.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M webkit/glue/resource_fetcher.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M webkit/glue/resource_fetcher_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +6 lines, -2 lines 0 comments Download
M webkit/plugins/ppapi/mock_plugin_delegate.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M webkit/plugins/ppapi/ppapi_webplugin_impl.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M webkit/tools/test_shell/test_webview_delegate.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 6 (0 generated)
Nico
I think this might finally be complete. The red linux bot is https://bugs.launchpad.net/ubuntu/+source/binutils/+bug/680584. I need ...
9 years, 6 months ago (2011-06-07 22:01:59 UTC) #1
Evan Martin
Stopping early to verify I understand. http://codereview.chromium.org/7087028/diff/19002/chrome/browser/ui/gtk/crypto_module_password_dialog.cc File chrome/browser/ui/gtk/crypto_module_password_dialog.cc (right): http://codereview.chromium.org/7087028/diff/19002/chrome/browser/ui/gtk/crypto_module_password_dialog.cc#newcode89 chrome/browser/ui/gtk/crypto_module_password_dialog.cc:89: virtual ~CryptoModulePasswordDialog() {} ...
9 years, 6 months ago (2011-06-07 22:07:20 UTC) #2
Evan Martin
On 2011/06/07 22:07:20, Evan Martin wrote: > Stopping early to verify I understand. > > ...
9 years, 6 months ago (2011-06-07 22:07:38 UTC) #3
Evan Martin
LGTM
9 years, 6 months ago (2011-06-07 22:09:49 UTC) #4
Nico
http://codereview.chromium.org/7087028/diff/19002/chrome/browser/ui/gtk/crypto_module_password_dialog.cc File chrome/browser/ui/gtk/crypto_module_password_dialog.cc (right): http://codereview.chromium.org/7087028/diff/19002/chrome/browser/ui/gtk/crypto_module_password_dialog.cc#newcode89 chrome/browser/ui/gtk/crypto_module_password_dialog.cc:89: virtual ~CryptoModulePasswordDialog() {} On 2011/06/07 22:07:20, Evan Martin wrote: ...
9 years, 6 months ago (2011-06-07 22:09:53 UTC) #5
Nico
9 years, 6 months ago (2011-06-08 02:18:26 UTC) #6
Given that this is a fairly mindless CL with LG from a base OWNER, i won't hunt
down owners for all the cleanup stuff.

(If someone has a problem with this, we need toplevel cleanup owners.)

Powered by Google App Engine
This is Rietveld 408576698