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

Issue 10383262: RefCounted types should not have public destructors, delegate cleanup (Closed)

Created:
8 years, 7 months ago by Ryan Sleevi
Modified:
8 years, 6 months ago
CC:
chromium-reviews, jam, amit, native-client-reviews_googlegroups.com, dcaiafa+watch_chromium.org, cbentzel+watch_chromium.org, kkania, apatrick_chromium, joi+watch-content_chromium.org, darin-cc_chromium.org, brettw-cc_chromium.org, jochen+watch-content_chromium.org, wez+watch_chromium.org, sanjeevr, simonmorris+watch_chromium.org, feature-media-reviews_chromium.org, sergeyu+watch_chromium.org, jamiewalch+watch_chromium.org, hclam+watch_chromium.org, mihaip-chromium-reviews_chromium.org, tfarina, garykac+watch_chromium.org, Aaron Boodman, lambroslambrou+watch_chromium.org, robertshield, rdsmith+dwatch_chromium.org, alexeypa+watch_chromium.org
Visibility:
Public.

Description

RefCounted types should not have public destructors, delegate cleanup For Delegate/Observer-type classes that specify an interface but do not have any particular lifetime requirements, make their destructors protected. This is to allow their interfaces to be implemented safely by RefCounted types. With public destructors, it's possible to do "scoped_ptr<Delegate> foo", and then assign a RefCountedDelegateImpl, which would lead to a double free. As none of these Delegates actually need public destructors (ownership of the Delegate* is not transferred during a function call / class constructor), mark the destructors protected so that it becomes a compile warning to try to delete them via the Delegate*. BUG=123295 TEST=it compiles Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=144086

Patch Set 1 #

Total comments: 1

Patch Set 2 : Rebased to r139261 #

Patch Set 3 : Rebase to r140259 #

Patch Set 4 : Rebase to ToT #

Patch Set 5 : Make win bot happy #

Patch Set 6 : Make win bot happy #

Unified diffs Side-by-side diffs Delta from patch set Stats (+180 lines, -99 lines) Patch
M chrome/browser/bookmarks/base_bookmark_model_observer.h View 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/cancelable_request.h View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/cancelable_request.cc View 2 chunks +11 lines, -11 lines 0 comments Download
M chrome/browser/content_settings/content_settings_observer.h View 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/downloads/downloads_api.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/extensions/app_notify_channel_ui.h View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/extensions/bundle_installer.h View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_pref_value_map.h View 1 2 3 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/extensions/webstore_install_helper.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/extensions/webstore_installer.h View 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/history/history.h View 1 2 3 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/nacl_host/nacl_process_host.h View 1 2 3 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/nacl_host/nacl_process_host.cc View 1 2 3 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/policy/policy_service.h View 1 2 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_service.h View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/common/important_file_writer.h View 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/common/net/gaia/gaia_oauth_client.h View 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/common/net/gaia/oauth2_access_token_consumer.h View 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/common/net/gaia/oauth2_mint_token_flow.h View 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/common/pref_store.h View 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/service/cloud_print/cloud_print_url_fetcher.h View 1 2 chunks +3 lines, -1 line 0 comments Download
M chrome/service/cloud_print/print_system.h View 1 chunk +6 lines, -4 lines 0 comments Download
M chrome/test/automation/javascript_execution_controller.h View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/test/automation/javascript_execution_controller.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/device_orientation/provider.h View 1 chunk +3 lines, -0 lines 0 comments Download
M content/browser/download/download_item_impl.h View 1 2 3 2 chunks +3 lines, -1 line 0 comments Download
M content/browser/pepper_flash_settings_helper_impl.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M content/browser/ppapi_plugin_process_host.h View 1 2 3 4 1 chunk +8 lines, -0 lines 0 comments Download
M content/browser/renderer_host/media/audio_input_device_manager_event_handler.h View 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/ssl/ssl_error_handler.h View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h View 1 2 3 1 chunk +3 lines, -1 line 0 comments Download
M content/common/gpu/gpu_command_buffer_stub.h View 1 2 3 4 1 chunk +3 lines, -2 lines 0 comments Download
M content/common/gpu/gpu_watchdog.h View 1 chunk +4 lines, -6 lines 0 comments Download
M content/common/gpu/image_transport_surface.h View 1 2 3 4 2 chunks +3 lines, -1 line 0 comments Download
M content/public/browser/download_manager_delegate.h View 1 2 3 2 chunks +3 lines, -2 lines 0 comments Download
M content/public/browser/download_manager_delegate.cc View 1 2 3 2 chunks +2 lines, -3 lines 0 comments Download
M content/public/browser/profiler_subscriber.h View 2 chunks +3 lines, -2 lines 0 comments Download
M content/public/browser/worker_service_observer.h View 1 chunk +3 lines, -2 lines 0 comments Download
M content/public/renderer/render_view.h View 1 2 3 2 chunks +3 lines, -2 lines 0 comments Download
M content/renderer/media/scoped_loop_observer.h View 1 chunk +2 lines, -1 line 0 comments Download
M content/renderer/pepper/pepper_parent_context_provider.h View 1 chunk +1 line, -1 line 0 comments Download
M ipc/ipc_channel.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M media/audio/audio_input_controller.h View 1 chunk +3 lines, -1 line 0 comments Download
M media/audio/audio_io.h View 4 chunks +6 lines, -4 lines 0 comments Download
M media/audio/audio_output_controller.h View 1 2 3 1 chunk +3 lines, -1 line 0 comments Download
M media/base/data_source.h View 1 2 3 2 chunks +3 lines, -2 lines 0 comments Download
M media/base/demuxer.h View 1 2 2 chunks +3 lines, -2 lines 0 comments Download
M media/filters/ffmpeg_glue.h View 2 chunks +3 lines, -2 lines 0 comments Download
M media/video/capture/video_capture.h View 1 2 3 4 3 chunks +7 lines, -2 lines 0 comments Download
M media/video/video_decode_accelerator.h View 1 2 3 2 chunks +3 lines, -2 lines 0 comments Download
M media/webm/webm_stream_parser.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M ppapi/proxy/host_dispatcher.h View 1 2 3 1 chunk +3 lines, -2 lines 0 comments Download
M remoting/client/frame_consumer.h View 2 chunks +4 lines, -3 lines 0 comments Download
M remoting/client/frame_producer.h View 2 chunks +3 lines, -1 line 0 comments Download
M remoting/host/client_session.h View 1 2 3 2 chunks +3 lines, -2 lines 0 comments Download
M remoting/protocol/session_manager.h View 3 chunks +6 lines, -4 lines 0 comments Download

Messages

Total messages: 30 (0 generated)
Ryan Sleevi
Updating a bunch of delegates to have protected destructors, since their interfaces may be implemented ...
8 years, 7 months ago (2012-05-21 08:12:03 UTC) #1
Ami GONE FROM CHROMIUM
On 2012/05/21 08:12:03, Ryan Sleevi wrote: > Updating a bunch of delegates to have protected ...
8 years, 7 months ago (2012-05-21 15:50:16 UTC) #2
brettw
I'm sort of in the same place as Ami. I see how you could mess ...
8 years, 7 months ago (2012-05-21 17:48:16 UTC) #3
jam
that's my feeling as well on http://codereview.chromium.org/10416003/ . the tradeoff isn't worth it cause the ...
8 years, 7 months ago (2012-05-21 17:53:46 UTC) #4
jam
that's my feeling as well on http://codereview.chromium.org/10416003/ . the tradeoff isn't worth it cause the ...
8 years, 7 months ago (2012-05-21 17:53:47 UTC) #5
Ryan Sleevi
On 2012/05/21 15:50:16, Ami Fischman wrote: > On 2012/05/21 08:12:03, Ryan Sleevi wrote: > > ...
8 years, 7 months ago (2012-05-21 18:48:11 UTC) #6
Ryan Sleevi
On 2012/05/21 17:48:16, brettw wrote: > I'm sort of in the same place as Ami. ...
8 years, 7 months ago (2012-05-21 18:52:50 UTC) #7
Ryan Sleevi
On 2012/05/21 17:53:47, John Abd-El-Malek wrote: > that's my feeling as well on http://codereview.chromium.org/10416003/ . ...
8 years, 7 months ago (2012-05-21 18:53:47 UTC) #8
alexeypa (please no reviews)
On 2012/05/21 18:48:11, Ryan Sleevi wrote: > This pattern actually occurs in Chromium code. While ...
8 years, 7 months ago (2012-05-21 18:58:00 UTC) #9
Sergey Ulanov
remoting/ - LGTM I believe that the work Ryan is doing here is very useful. ...
8 years, 7 months ago (2012-05-21 19:13:49 UTC) #10
Ami GONE FROM CHROMIUM
Ah; I misunderstood http://codereview.chromium.org/10383262/diff/1/media/webm/webm_stream_parser.cc as being a forced coupling of implementation details, whereas the previous ...
8 years, 7 months ago (2012-05-21 20:14:41 UTC) #11
Ami GONE FROM CHROMIUM
Ah; I misunderstood http://codereview.chromium.org/10383262/diff/1/media/webm/webm_stream_parser.cc as being a forced coupling of implementation details, whereas the previous ...
8 years, 7 months ago (2012-05-21 20:14:42 UTC) #12
Wez
On 2012/05/21 20:14:42, Ami Fischman wrote: > I'm sold that this is a worthwhile change. ...
8 years, 7 months ago (2012-05-21 20:19:38 UTC) #13
Ryan Sleevi
On 2012/05/21 20:19:38, Wez wrote: > On 2012/05/21 20:14:42, Ami Fischman wrote: > > I'm ...
8 years, 7 months ago (2012-05-21 22:20:50 UTC) #14
jam
On Mon, May 21, 2012 at 3:20 PM, <rsleevi@chromium.org> wrote: > On 2012/05/21 20:19:38, Wez ...
8 years, 7 months ago (2012-05-22 00:17:41 UTC) #15
jam
On Mon, May 21, 2012 at 3:20 PM, <rsleevi@chromium.org> wrote: > On 2012/05/21 20:19:38, Wez ...
8 years, 7 months ago (2012-05-22 00:17:42 UTC) #16
Wez
lgtm
8 years, 7 months ago (2012-05-22 00:19:29 UTC) #17
brettw
ppapi lgtm, was there any other place you need me to look at? This is ...
8 years, 7 months ago (2012-05-22 05:07:20 UTC) #18
Ryan Sleevi
On 2012/05/22 05:07:20, brettw wrote: > ppapi lgtm, was there any other place you need ...
8 years, 6 months ago (2012-05-28 21:02:43 UTC) #19
brettw
okay, lgtm on the rest of chrome
8 years, 6 months ago (2012-05-29 00:15:03 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rsleevi@chromium.org/10383262/13001
8 years, 6 months ago (2012-05-29 00:39:40 UTC) #21
commit-bot: I haz the power
Presubmit check for 10383262-13001 failed and returned exit status 1. Running presubmit commit checks ...
8 years, 6 months ago (2012-05-29 00:40:34 UTC) #22
Ryan Sleevi
joaodasilva: Stamp?
8 years, 6 months ago (2012-05-29 00:47:23 UTC) #23
Joao da Silva
lgtm
8 years, 6 months ago (2012-05-29 08:52:31 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rsleevi@chromium.org/10383262/13001
8 years, 6 months ago (2012-05-29 08:54:05 UTC) #25
commit-bot: I haz the power
Try job failure for 10383262-13001 (retry) on win for step "compile" (clobber build). It's a ...
8 years, 6 months ago (2012-05-29 09:16:37 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rsleevi@chromium.org/10383262/26001
8 years, 6 months ago (2012-06-25 06:58:39 UTC) #27
commit-bot: I haz the power
Try job failure for 10383262-26001 (retry) on win for step "compile" (clobber build). It's a ...
8 years, 6 months ago (2012-06-25 07:29:07 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rsleevi@chromium.org/10383262/29003
8 years, 6 months ago (2012-06-25 23:24:55 UTC) #29
commit-bot: I haz the power
8 years, 6 months ago (2012-06-26 01:06:09 UTC) #30
Change committed as 144086

Powered by Google App Engine
This is Rietveld 408576698