Chromium Code Reviews
Help | Chromium Project | Sign in
(170)

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

Can't Edit
Can't Publish+Mail
Start Review
Created:
4 years, 10 months ago by willchan no longer on Chromium
Modified:
4 years, 3 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
Project "None" does not have a commit queue.

Messages

Total messages: 3 (0 generated)
willchan no longer on Chromium
4 years, 10 months ago (2010-10-20 06:25:19 UTC) #1
jorlow
LGTM Is this needed for clang or something?
4 years, 10 months ago (2010-10-20 09:02:32 UTC) #2
willchan no longer on Chromium
4 years, 10 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
>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld c33a7a4