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

Issue 66069: Don't overload the meaning of the RENDERER_PROCESS_TERMINATED notification, i... (Closed)

Created:
11 years, 8 months ago by jam
Modified:
9 years, 7 months ago
Reviewers:
Charlie Reis
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Don't overload the meaning of the RENDERER_PROCESS_TERMINATED notification, instead create a new one for crashing. The old way of using notifications was incorrect since a RenderProcessHost might have sent only one notification even though a new renderer might have been created after a crash. BUG=9379 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=13629

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+25 lines, -35 lines) Patch
M chrome/browser/cert_store.cc View 2 chunks +5 lines, -1 line 0 comments Download
M chrome/browser/metrics/metrics_service.cc View 2 chunks +3 lines, -4 lines 0 comments Download
M chrome/browser/renderer_host/browser_render_process_host.cc View 1 chunk +5 lines, -13 lines 0 comments Download
M chrome/browser/renderer_host/render_process_host.h View 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/renderer_host/render_process_host.cc View 2 chunks +3 lines, -9 lines 0 comments Download
M chrome/browser/tab_contents/site_instance.h View 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/common/notification_type.h View 1 1 chunk +6 lines, -4 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
jam
11 years, 8 months ago (2009-04-11 01:40:39 UTC) #1
Charlie Reis
Hmm. I'll admit that I'm less familiar with the code you're changing here, but separating ...
11 years, 8 months ago (2009-04-11 16:10:44 UTC) #2
jam
On 2009/04/11 16:10:44, creis wrote: > Hmm. I'll admit that I'm less familiar with the ...
11 years, 8 months ago (2009-04-13 18:11:35 UTC) #3
Charlie Reis
On 2009/04/13 18:11:35, John Abd-El-Malek wrote: > On 2009/04/11 16:10:44, creis wrote: > > Hmm. ...
11 years, 8 months ago (2009-04-13 18:32:50 UTC) #4
Charlie Reis
11 years, 8 months ago (2009-04-13 19:44:14 UTC) #5
>> Yes, I must have misunderstood it.  I was under the impression that
>> "terminated vs crashed" could have meant "killed via Task Manager vs hit
>> a bug in the rendering engine."  But you're saying that "terminated"
>> means the process was cleanly ended by Chrome because all of its tabs
>> were closed?
>
>
> Yep that's correct.  I think the problem that caused this bug (and other
> leaks that I found) was overloading "terminated" to mean crashed as well,
> even though the associated RenderProcessHost was still around.

Gotcha.

>>  In that case, it does seem like the SiteInstance will be
>> deleted as well, so it's ok to set its process_ to null.
>>
>> Is there a reason SiteInstance still needs the explicit observer to set
>> process_ to null, though, and that just relying on it being deleted
>> isn't enough?  (Do we ever expect the SiteInstance to outlast its
>> RenderProcessHost?)
>
>
> Yep SiteInstance outlives RPH sometimes, since a pointer to it is cached by
> NavigationEntry.

Ah, right.  That concerned me for a second, but I think it works out.  Consider
navigating two tabs in the same SiteInstance to different sites.  The process
will go away, and the SiteInstance's process_ field will be set to null.  If the
user then goes back in both tabs, we want them to end up in the same process
again.  It works, though, because they share the same SiteInstance object, so it
will only create a new RenderProcessHost once.  Seems ok.

When verifying this, I noticed that the SiteInstance::Observe code gets called
for *every* tab any time a process goes away.  I don't suppose there's a way to
make that more efficient?  (e.g., Giving a RenderProcessHost a list of the tabs
it needs to notify when it goes away?)  Could be n^2 updates if the user is
closing all windows.  Anyway, that's a different issue, if you think it's worth
following up on.

LGTM.

Powered by Google App Engine
This is Rietveld 408576698