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

Issue 995007: Fix a crash due to UserScriptListener unregistering notifications on the wrong (Closed)

Created:
10 years, 9 months ago by Matt Perry
Modified:
9 years, 7 months ago
CC:
chromium-reviews, huanr
Visibility:
Public.

Description

Fix a crash due to UserScriptListener unregistering notifications on the wrong thread, then being sent a notification after it was deleted. BUG=38374 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=42120

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -0 lines) Patch
M chrome/browser/extensions/user_script_listener.h View 1 chunk +4 lines, -0 lines 2 comments Download
M chrome/browser/extensions/user_script_listener.cc View 2 chunks +6 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/resource_dispatcher_host.cc View 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Matt Perry
10 years, 9 months ago (2010-03-17 22:38:01 UTC) #1
Paweł Hajdan Jr.
http://codereview.chromium.org/995007/diff/1/3 File chrome/browser/extensions/user_script_listener.h (right): http://codereview.chromium.org/995007/diff/1/3#newcode35 chrome/browser/extensions/user_script_listener.h:35: void ShutdownMainThread(); The object is constructed on the UI ...
10 years, 9 months ago (2010-03-18 07:47:54 UTC) #2
Matt Perry
http://codereview.chromium.org/995007/diff/1/3 File chrome/browser/extensions/user_script_listener.h (right): http://codereview.chromium.org/995007/diff/1/3#newcode35 chrome/browser/extensions/user_script_listener.h:35: void ShutdownMainThread(); On 2010/03/18 07:47:54, Paweł Hajdan Jr. wrote: ...
10 years, 9 months ago (2010-03-18 18:00:55 UTC) #3
Paweł Hajdan Jr.
I think I don't know this code enough to do a good review then. Changing ...
10 years, 9 months ago (2010-03-19 07:42:50 UTC) #4
darin (slow to review)
10 years, 9 months ago (2010-03-19 07:52:40 UTC) #5
On Thu, Mar 18, 2010 at 11:00 AM, <mpcomplete@chromium.org> wrote:

>
> http://codereview.chromium.org/995007/diff/1/3
> File chrome/browser/extensions/user_script_listener.h (right):
>
> http://codereview.chromium.org/995007/diff/1/3#newcode35
> chrome/browser/extensions/user_script_listener.h:35: void
> ShutdownMainThread();
> On 2010/03/18 07:47:54, Paweł Hajdan Jr. wrote:
>
>> The object is constructed on the UI thread, and currently the dtor is
>>
> empty. How
>
>> about using ChromeThread::DeleteOnUIThread, and doing the cleanup in
>>
> the dtor?
>
> That doesn't work, because the object is deleted so late in the shutdown
> process that the UI loop never has a chance to pump messages. We would
> just leak the object.


All background threads should be cleaned up before the UI thread, and maybe
we should call RunAllPending on the main thread at some opportune time.  It
seems a bit unfortunate that you cannot count on cycles on the UI thread.
 Of
course that could also lead to shutdown taking longer (if the queue is
long).

This change LGTM.

-Darin



>
>
> http://codereview.chromium.org/995007
>

Powered by Google App Engine
This is Rietveld 408576698