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

Issue 362013: [Mac] Delay TabContents::Close() when event-tracking. (Closed)

Created:
11 years, 1 month ago by Scott Hess - ex-Googler
Modified:
9 years, 6 months ago
CC:
chromium-reviews_googlegroups.com, John Grabowski
Visibility:
Public.

Description

[Mac] Delay TabContents::Close() when event-tracking. The close is delayed until the main event loop restarts. Renderers can cause UI state changes which can badly break event-tracking loops. The basic pattern is "Run JavaScript to close window after a timeout, and start event-tracking loop and keep it going across the timeout." Things crash when UI elements attempt to refer to freed objects. Examples: - Last tab in a window closes while dragging the window. - Last tab in a window closes while bookmark bar context menu visible. - Last tab in a window closes while download shelf context menu visible. - Tab closes while dragging a link over the tab. - Tab closes while dragging a link from the tab. - Tab closes while back/forward context menu is open. - Tab closes while click-hold in the tab's close button. - Tab closes while closing info bar. - Tab closes while tab context menu is visible. - Probably more I'm not aware of. Supersedes (and reverts) previous fix for issues 25462 and 25465. BUG=25462, 25463, 25465, 26135, 26136, 26137, 25467 TEST=See bugs for repro cases. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=31183

Patch Set 1 #

Total comments: 15

Patch Set 2 : Mark and dmac suggestions. #

Patch Set 3 : 0.0 is supposed to work. #

Patch Set 4 : Match nameing from dmac's change. #

Patch Set 5 : Merged with dmac's change. #

Patch Set 6 : Oops, included file moved. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+80 lines, -11 lines) Patch
M chrome/browser/cocoa/tab_controller.mm View 1 chunk +0 lines, -11 lines 0 comments Download
M chrome/browser/tab_contents/tab_contents.cc View 1 chunk +15 lines, -0 lines 0 comments Download
M chrome/browser/tab_contents/tab_contents_view.h View 1 chunk +10 lines, -0 lines 0 comments Download
M chrome/browser/tab_contents/tab_contents_view_mac.h View 3 chunks +7 lines, -0 lines 0 comments Download
M chrome/browser/tab_contents/tab_contents_view_mac.mm View 1 2 3 4 5 6 chunks +48 lines, -0 lines 0 comments Download

Messages

Total messages: 25 (0 generated)
Scott Hess - ex-Googler
Superceeds http://codereview.chromium.org/348047
11 years, 1 month ago (2009-11-04 22:51:14 UTC) #1
Avi (use Gerrit)
On 2009/11/04 22:51:14, shess wrote: > Superceeds http://codereview.chromium.org/348047 For the commit comment: supersedes
11 years, 1 month ago (2009-11-04 22:55:35 UTC) #2
Scott Hess - ex-Googler
On 2009/11/04 22:55:35, Avi wrote: > On 2009/11/04 22:51:14, shess wrote: > > Superceeds http://codereview.chromium.org/348047 ...
11 years, 1 month ago (2009-11-04 23:05:58 UTC) #3
dmac
take a look at http://codereview.chromium.org/345051 which may fix this as well. Testing now.
11 years, 1 month ago (2009-11-04 23:18:01 UTC) #4
dmac
On 2009/11/04 23:18:01, dmac wrote: > take a look at http://codereview.chromium.org/345051 which may fix this ...
11 years, 1 month ago (2009-11-05 00:06:35 UTC) #5
Scott Hess - ex-Googler
The problem in most of these is that the Chrome-side objects unwind while the Cocoa-side ...
11 years, 1 month ago (2009-11-05 00:16:27 UTC) #6
Mark Mentovai
Adding myself to the cc here (as if I wasn't working on enough already)
11 years, 1 month ago (2009-11-05 00:29:38 UTC) #7
dmaclach1
Understood. Keeping stuff alive in the top level autorelease pool should accomplish and should fix ...
11 years, 1 month ago (2009-11-05 00:32:48 UTC) #8
Scott Hess - ex-Googler
http://codereview.chromium.org/362013/diff/1/8 File chrome/browser/tab_contents/tab_contents_view_mac.mm (right): http://codereview.chromium.org/362013/diff/1/8#newcode286 Line 286: afterDelay:0.02]; I swear to goodness that when I ...
11 years, 1 month ago (2009-11-05 01:06:52 UTC) #9
Mark Mentovai
http://codereview.chromium.org/362013/diff/1/3 File chrome/browser/chrome_application_mac.mm (right): http://codereview.chromium.org/362013/diff/1/3#newcode260 Line 260: isEventTracking_ = NO; Guard against nested -sendEvent: calls. ...
11 years, 1 month ago (2009-11-05 02:51:21 UTC) #10
dmac
Scott, we need to decide what to do with the CL vs my CL (http://codereview.chromium.org/345051). ...
11 years, 1 month ago (2009-11-05 04:28:50 UTC) #11
Scott Hess - ex-Googler
Maybe I need to patch your change in and play with it, because I don't ...
11 years, 1 month ago (2009-11-05 05:42:23 UTC) #12
Scott Hess - ex-Googler
Hmm, as a specific for-instance of a case which my change doesn't currently address, but ...
11 years, 1 month ago (2009-11-05 06:01:02 UTC) #13
dmac
http://codereview.chromium.org/362013/diff/1/2 File chrome/browser/chrome_application_mac.h (right): http://codereview.chromium.org/362013/diff/1/2#newcode13 Line 13: BOOL isEventTracking_; @private http://codereview.chromium.org/362013/diff/1/8 File chrome/browser/tab_contents/tab_contents_view_mac.mm (right): http://codereview.chromium.org/362013/diff/1/8#newcode75 ...
11 years, 1 month ago (2009-11-05 06:13:57 UTC) #14
Scott Hess - ex-Googler
[Have not compiled the uploaded CL in the interests of getting to bed.] http://codereview.chromium.org/362013/diff/1/2 File ...
11 years, 1 month ago (2009-11-05 06:41:13 UTC) #15
dmac
On 2009/11/05 06:41:13, shess wrote: > On 2009/11/05 06:13:57, dmac wrote: > > do you ...
11 years, 1 month ago (2009-11-05 07:04:11 UTC) #16
Mark Mentovai
http://codereview.chromium.org/362013/diff/1/8 File chrome/browser/tab_contents/tab_contents_view_mac.mm (right): http://codereview.chromium.org/362013/diff/1/8#newcode75 Line 75: [cocoa_view_.get() cancelDeferredClose]; shess wrote: > Do not know. ...
11 years, 1 month ago (2009-11-05 14:45:21 UTC) #17
dmac
> I read this as meaning "the loop always fires off the selector;" the > ...
11 years, 1 month ago (2009-11-05 17:09:41 UTC) #18
Scott Hess - ex-Googler
On 2009/11/05 17:09:41, dmac wrote: > > I read this as meaning "the loop always ...
11 years, 1 month ago (2009-11-05 19:20:07 UTC) #19
Mark Mentovai
Who's gonna go first, you or dmac? Mark Scott wrote: > On 2009/11/05 17:09:41, dmac ...
11 years, 1 month ago (2009-11-05 19:21:49 UTC) #20
Scott Hess - ex-Googler
dmac can go. With his change in place, mine will require trivial merging (mainly deleting ...
11 years, 1 month ago (2009-11-05 20:41:42 UTC) #21
dmaclach1
shess. My cl is in (31135). 13 other changes in there. Hopefully the tree stays ...
11 years, 1 month ago (2009-11-05 22:09:30 UTC) #22
Scott Hess - ex-Googler
On 2009/11/05 22:09:30, dmaclach_google.com wrote: > shess. My cl is in (31135). 13 other changes ...
11 years, 1 month ago (2009-11-05 23:33:17 UTC) #23
Mark Mentovai
Sometimes when I mean to say LGTM, I don't actually say it. LGTM.
11 years, 1 month ago (2009-11-05 23:44:27 UTC) #24
dmac
11 years, 1 month ago (2009-11-05 23:51:33 UTC) #25
On 2009/11/05 23:44:27, Mark Mentovai wrote:
> Sometimes when I mean to say LGTM, I don't actually say it.
> 
> LGTM.

LGTM here too.

Powered by Google App Engine
This is Rietveld 408576698