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

Issue 9958145: Audit the destructors of classes derived from net::URLRequestContextGetter (Closed)

Created:
8 years, 8 months ago by Ryan Sleevi
Modified:
8 years, 8 months ago
CC:
chromium-reviews, jamiewalch+watch_chromium.org, dcaiafa+watch_chromium.org, simonmorris+watch_chromium.org, hclam+watch_chromium.org, wez+watch_chromium.org, amit, sanjeevr, garykac+watch_chromium.org, lambroslambrou+watch_chromium.org, alexeypa+watch_chromium.org, sergeyu+watch_chromium.org
Visibility:
Public.

Description

All classes that directly derive from net::URLRequestContextGetter should have "protected" virtual destructors, not "public". By having a public destructor, it becomes possible to stack allocate the derived class. Stack allocating a RCTS is a dangerous behaviour, since there may still be a caller who holds a reference when the object goes out of scope. BUG=none TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=131072

Patch Set 1 #

Patch Set 2 : More unsafe patterns #

Patch Set 3 : Two private dtor -> protected dtor #

Patch Set 4 : ToT #

Unified diffs Side-by-side diffs Delta from patch set Stats (+25 lines, -8 lines) Patch
M chrome/browser/io_thread.cc View 1 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/policy/device_management_service.cc View 1 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_service.cc View 1 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/sync/glue/http_bridge.h View 1 2 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/sync/glue/http_bridge.cc View 1 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/test/base/testing_profile.cc View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M content/common/net/url_fetcher_impl_unittest.cc View 1 1 chunk +3 lines, -2 lines 0 comments Download
M content/shell/shell_url_request_context_getter.h View 1 2 chunks +3 lines, -1 line 0 comments Download
M remoting/host/url_request_context.h View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 10 (0 generated)
Ryan Sleevi
jam: content/ jamiewalch: remoting/ atwilson: chrome/browser/sync mnissler: chrome/browser/policy eroman: content/common/net I noticed this after alexeypa ...
8 years, 8 months ago (2012-04-04 00:42:00 UTC) #1
jam
content lgtm
8 years, 8 months ago (2012-04-04 01:02:24 UTC) #2
Jamie
remoting lgtm. Regarding your virtual dtor remark, I agree that the derived classes should specify ...
8 years, 8 months ago (2012-04-04 01:04:12 UTC) #3
Andrew T Wilson (Slow)
browser/sync LGTM
8 years, 8 months ago (2012-04-04 01:10:28 UTC) #4
Mattias Nissler (ping if slow)
policy lgtm
8 years, 8 months ago (2012-04-04 09:16:09 UTC) #5
eroman
lgtm
8 years, 8 months ago (2012-04-05 00:56:52 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rsleevi@chromium.org/9958145/6001
8 years, 8 months ago (2012-04-05 00:59:37 UTC) #7
commit-bot: I haz the power
Can't apply patch for file remoting/host/url_request_context.h. While running patch -p1 --forward --force; patching file remoting/host/url_request_context.h ...
8 years, 8 months ago (2012-04-05 00:59:42 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rsleevi@chromium.org/9958145/10001
8 years, 8 months ago (2012-04-06 00:25:48 UTC) #9
commit-bot: I haz the power
8 years, 8 months ago (2012-04-06 02:27:19 UTC) #10
Change committed as 131072

Powered by Google App Engine
This is Rietveld 408576698