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

Issue 160122: Make downloads not prevent tabs from closing.... (Closed)

Created:
11 years, 5 months ago by brettw
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com, darin (slow to review), brettw, jam, Ben Goodger (Google)
Visibility:
Public.

Description

Make downloads not prevent tabs from closing. If a download creates a cross-site transition (for example, if you click a link in Gmail that results in a download in a new tab), that tab will be stuck and you can't close it or the browser. This is the opposite problem with a similar cause as bug 16246. In both cases we were using some secondary signal to tell us if we're closing for a cross site transition or closing the tab, and that signal was wrong. In this case, we were running the onunload handler, but because there was a pending RenderViewHost, the RenderManager would think that the close was a cross-site one, and not forward the close message to actually close the tab. This patch adds a flag to the on unload handlers that indicates whether it's for a tab closure or a cross-site transition, so we can do the right thing unambiguously when the message returns. In this case I keep this information in the RenderView in case we send multiple close requests, we'll close the tab if any of them were for the entire tab, even if that particular one was dropped because we don't want to have more than one in flight at once. BUG=17560 TEST=none. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=21673

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+63 lines, -40 lines) Patch
M chrome/browser/browser.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/renderer_host/render_view_host.h View 2 chunks +14 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/render_view_host.cc View 3 chunks +20 lines, -5 lines 1 comment Download
M chrome/browser/renderer_host/render_view_host_delegate.h View 1 chunk +5 lines, -3 lines 0 comments Download
M chrome/browser/renderer_host/test/render_view_host_manager_browsertest.cc View 1 chunk +1 line, -2 lines 1 comment Download
M chrome/browser/tab_contents/render_view_host_manager.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/tab_contents/render_view_host_manager.cc View 2 chunks +20 lines, -21 lines 0 comments Download
M chrome/browser/tab_contents/tab_contents.h View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/tab_contents/tab_contents.cc View 1 chunk +0 lines, -4 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
brettw
11 years, 5 months ago (2009-07-24 20:56:10 UTC) #1
darin (slow to review)
LGTM http://codereview.chromium.org/160122/diff/1/9 File chrome/browser/renderer_host/render_view_host.cc (right): http://codereview.chromium.org/160122/diff/1/9#newcode324 Line 324: unload_ack_is_for_cross_site_transition_ = nit: could use &&= to ...
11 years, 5 months ago (2009-07-25 00:25:11 UTC) #2
brettw
On Fri, Jul 24, 2009 at 5:25 PM, <darin@chromium.org> wrote: > LGTM > > > ...
11 years, 4 months ago (2009-07-25 22:34:39 UTC) #3
Peter Kasting
On Sat, Jul 25, 2009 at 3:06 PM, Brett Wilson <brettw@chromium.org> wrote: > > http://codereview.chromium.org/160122/diff/1/9#newcode324 ...
11 years, 4 months ago (2009-07-25 22:56:36 UTC) #4
darin (slow to review)
On Sat, Jul 25, 2009 at 3:06 PM, Brett Wilson <brettw@chromium.org> wrote: > On Fri, ...
11 years, 4 months ago (2009-07-26 00:20:27 UTC) #5
Peter Kasting
On Sat, Jul 25, 2009 at 5:19 PM, Darin Fisher <darin@chromium.org> wrote: > On Sat, ...
11 years, 4 months ago (2009-07-26 04:02:34 UTC) #6
brettw
On Sat, Jul 25, 2009 at 9:02 PM, Peter Kasting<pkasting@chromium.org> wrote= : > On Sat, ...
11 years, 4 months ago (2009-07-26 04:36:58 UTC) #7
Peter Kasting
On 2009/07/26 04:36:58, brettw wrote: > &= scares me in this case. I will keep ...
11 years, 4 months ago (2009-07-26 05:22:42 UTC) #8
darin (slow to review)
11 years, 4 months ago (2009-07-26 13:55:25 UTC) #9
On Sat, Jul 25, 2009 at 9:02 PM, Peter Kasting <pkasting@chromium.org>wrote:

> On Sat, Jul 25, 2009 at 5:19 PM, Darin Fisher <darin@chromium.org> wrote:
>
>> On Sat, Jul 25, 2009 at 3:06 PM, Brett Wilson <brettw@chromium.org>wrote:
>>
>>> On Fri, Jul 24, 2009 at 5:25 PM, <darin@chromium.org> wrote:
>>> > http://codereview.chromium.org/160122/diff/1/9#newcode324
>>> > Line 324: unload_ack_is_for_cross_site_transition_ =
>>> > nit: could use &&= to shorten this up.
>>>
>>> That's what I did originally. But it turns out there is no such
>>> operator as "&&=" !
>>>
>>
>> I'm left scratching my head... I wonder why I thought that would work.  It
>> isn't supported in JS either.  Is there some language where it does work?
>>
>
> I still claim it's because you were thinking of &= (which works).
>


No... that's not the case.  I was imagining a logical assignment operator
:-/

-Darin

Powered by Google App Engine
This is Rietveld 408576698