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

Issue 3940002: Use scoped_refptr for refcounted param in DomStorageDispatcherHost. (Closed)

Created:
10 years, 2 months ago by willchan no longer on Chromium
Modified:
9 years, 7 months ago
Reviewers:
jorlow
CC:
chromium-reviews, darin-cc_chromium.org, ben+cc_chromium.org
Visibility:
Public.

Description

Use scoped_refptr for refcounted param in DomStorageDispatcherHost. BUG=28083 TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=63214

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -1 line) Patch
M chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc View 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 3 (0 generated)
willchan no longer on Chromium
10 years, 2 months ago (2010-10-20 06:25:19 UTC) #1
jorlow
LGTM Is this needed for clang or something?
10 years, 2 months ago (2010-10-20 09:02:32 UTC) #2
willchan no longer on Chromium
10 years, 2 months ago (2010-10-20 15:33:00 UTC) #3
Nope, it's unsafe to pass them as a raw pointer, since the RunnableMethod
task that gets created will store a Tuple with a raw pointer instead of a
scoped_refptr.  This means that before the task invokes the function pointer
later, its refcounted parameter may get deleted since the RunnableMethod
doesn't hold a refcount to it.

Once I fix all instances of this anti-pattern, I'm going to add a template
type trait to prevent anyone from doing this again.

On Wed, Oct 20, 2010 at 2:02 AM, <jorlow@chromium.org> wrote:

> LGTM
>
> Is this needed for clang or something?
>
>
> http://codereview.chromium.org/3940002/show
>

Powered by Google App Engine
This is Rietveld 408576698