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

Issue 9958150: Make sure that scoped_ptr<> cannot be used with ref-counted objects. (Closed)

Created:
8 years, 8 months ago by Sergey Ulanov
Modified:
8 years, 8 months ago
Reviewers:
brettw
CC:
chromium-reviews, erikwright (departed), brettw-cc_chromium.org, Jamie
Visibility:
Public.

Description

Make sure that scoped_ptr<> cannot be used with ref-counted objects. It's easy to type scoped_ptr<> instead of scoped_refptr<>. Such bugs are hard to debug sometimes. This change adds compile-time check to make sure that scoped_ptr<> is not used for ref-counted objects. Also fixed one (benign) instance of scoped_ptr<> being used for a ref-counted object. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=130835

Patch Set 1 #

Patch Set 2 : #

Total comments: 2

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+40 lines, -4 lines) Patch
M base/memory/scoped_ptr.h View 1 2 2 chunks +25 lines, -0 lines 0 comments Download
M base/memory/scoped_ptr_unittest.nc View 3 chunks +11 lines, -0 lines 0 comments Download
M chrome/common/service_process_util_mac.mm View 1 1 chunk +2 lines, -2 lines 0 comments Download
M ppapi/proxy/ppb_network_monitor_private_proxy.cc View 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
Sergey Ulanov
8 years, 8 months ago (2012-04-04 02:27:25 UTC) #1
brettw
How much of a problem is this? scoped_ptr is included everywhere and this is a ...
8 years, 8 months ago (2012-04-04 04:08:27 UTC) #2
Sergey Ulanov
On 2012/04/04 04:08:27, brettw wrote: > How much of a problem is this? scoped_ptr is ...
8 years, 8 months ago (2012-04-04 17:55:34 UTC) #3
Sergey Ulanov
CC: +alexeypa, +jamiewalch - in case you want to add something here.
8 years, 8 months ago (2012-04-04 17:57:43 UTC) #4
alexeypa (please no reviews)
On 2012/04/04 17:57:43, sergeyu wrote: > CC: +alexeypa, +jamiewalch - in case you want to ...
8 years, 8 months ago (2012-04-04 18:20:16 UTC) #5
brettw
lgtm http://codereview.chromium.org/9958150/diff/9001/base/memory/scoped_ptr_unittest.nc File base/memory/scoped_ptr_unittest.nc (right): http://codereview.chromium.org/9958150/diff/9001/base/memory/scoped_ptr_unittest.nc#newcode28 base/memory/scoped_ptr_unittest.nc:28: #elif defined(NCTEST_NO_REF_COUNTED_SCOPED_PTR) // [r"creating array with negative size"] ...
8 years, 8 months ago (2012-04-04 21:31:05 UTC) #6
Sergey Ulanov
http://codereview.chromium.org/9958150/diff/9001/base/memory/scoped_ptr_unittest.nc File base/memory/scoped_ptr_unittest.nc (right): http://codereview.chromium.org/9958150/diff/9001/base/memory/scoped_ptr_unittest.nc#newcode28 base/memory/scoped_ptr_unittest.nc:28: #elif defined(NCTEST_NO_REF_COUNTED_SCOPED_PTR) // [r"creating array with negative size"] On ...
8 years, 8 months ago (2012-04-04 22:28:37 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sergeyu@chromium.org/9958150/16001
8 years, 8 months ago (2012-04-04 22:33:03 UTC) #8
commit-bot: I haz the power
8 years, 8 months ago (2012-04-05 03:51:13 UTC) #9
Change committed as 130835

Powered by Google App Engine
This is Rietveld 408576698