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

Issue 343024: Cleans up our autorelease handling so that we don't create a layered ... (Closed)

Created:
11 years, 1 month ago by dmac
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com, brettw+cc_chromium.org, ben+cc_chromium.org, John Grabowski, jam, pam+watch_chromium.org, darin (slow to review)
Visibility:
Public.

Description

Cleans up our autorelease handling so that we don't create a layered autorelease pool in our run loop source if there is one already on the stack above us. This allows Cocoa to clean up all the objects at the same time as it expects to do. There may be more "interesting" code that can be removed now that this is in. Initially we were going to implement it by checking the nesting levels of the runloops, but it turns out by the time sendEvent is called at the upper level we are already out of the "CFRunloopRun" call so our nesting count isn't a valid indicator of our state. TEST=1) See bug 25857. 2) Start up. Open 3+ windows. Quit. BUG=25857 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=30647

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 17

Patch Set 3 : '' #

Patch Set 4 : '' #

Total comments: 15

Patch Set 5 : '' #

Patch Set 6 : '' #

Patch Set 7 : '' #

Patch Set 8 : '' #

Patch Set 9 : '' #

Total comments: 8

Patch Set 10 : '' #

Patch Set 11 : '' #

Total comments: 68

Patch Set 12 : '' #

Patch Set 13 : '' #

Patch Set 14 : '' #

Patch Set 15 : '' #

Total comments: 50

Patch Set 16 : '' #

Patch Set 17 : '' #

Patch Set 18 : '' #

Patch Set 19 : '' #

Patch Set 20 : '' #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+290 lines, -45 lines) Patch
M base/message_pump_mac.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 5 chunks +35 lines, -1 line 1 comment Download
M base/message_pump_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 10 chunks +253 lines, -31 lines 3 comments Download
M chrome/browser/cocoa/browser_window_controller.mm View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -7 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host_view_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +1 line, -6 lines 0 comments Download

Messages

Total messages: 31 (0 generated)
dmac
Sorry for the delay...turns out that the nested count didn't work, and I had a ...
11 years, 1 month ago (2009-10-28 21:29:37 UTC) #1
Mark Mentovai
http://codereview.chromium.org/343024/diff/14/2001 File base/message_pump_mac.h (right): http://codereview.chromium.org/343024/diff/14/2001#newcode42 Line 42: // so that we know whether or not ...
11 years, 1 month ago (2009-10-28 21:40:50 UTC) #2
pink (ping after 24hrs)
http://codereview.chromium.org/343024/diff/14/2005 File chrome/browser/renderer_host/render_widget_host_view_mac.mm (left): http://codereview.chromium.org/343024/diff/14/2005#oldcode292 Line 292: // We've been told to destroy. i understand ...
11 years, 1 month ago (2009-10-28 21:43:59 UTC) #3
pink (ping after 24hrs)
11 years, 1 month ago (2009-10-28 21:44:04 UTC) #4
Nico
I'm completely underqualified (misqualified? :-) ) to say something deep and insightful (maybe except for ...
11 years, 1 month ago (2009-10-28 21:52:24 UTC) #5
TVL
Dave - can you expand on why the nesting level didn't help? If we're out ...
11 years, 1 month ago (2009-10-28 21:54:51 UTC) #6
dmac
On 2009/10/28 21:54:51, TVL wrote: > Dave - can you expand on why the nesting ...
11 years, 1 month ago (2009-10-28 22:08:18 UTC) #7
dmac
On 2009/10/28 22:08:18, dmac wrote: > On 2009/10/28 21:54:51, TVL wrote: > > Dave - ...
11 years, 1 month ago (2009-10-28 22:13:06 UTC) #8
dmac
On 2009/10/28 21:52:24, Nico wrote: > I'm completely underqualified (misqualified? :-) ) to say something ...
11 years, 1 month ago (2009-10-28 22:46:17 UTC) #9
dmac
http://codereview.chromium.org/343024/diff/14/2001 File base/message_pump_mac.h (right): http://codereview.chromium.org/343024/diff/14/2001#newcode42 Line 42: // so that we know whether or not ...
11 years, 1 month ago (2009-10-28 22:57:46 UTC) #10
dmac
On 2009/10/28 21:43:59, pink wrote: > http://codereview.chromium.org/343024/diff/14/2005 > File chrome/browser/renderer_host/render_widget_host_view_mac.mm (left): > > http://codereview.chromium.org/343024/diff/14/2005#oldcode292 > ...
11 years, 1 month ago (2009-10-28 23:00:38 UTC) #11
Mark Mentovai
The first comment is substantive, the rest are mechanical beautification things. I think that this ...
11 years, 1 month ago (2009-10-29 00:11:39 UTC) #12
Mark Mentovai
http://codereview.chromium.org/343024/diff/8003/8005 File base/message_pump_mac.mm (right): http://codereview.chromium.org/343024/diff/8003/8005#newcode554 Line 554: [pool_ release]; drain?!
11 years, 1 month ago (2009-10-29 00:12:32 UTC) #13
Nico
> http://codereview.chromium.org/343024/diff/8003/8005 > File base/message_pump_mac.mm (right): > > http://codereview.chromium.org/343024/diff/8003/8005#newcode554 > Line 554: [pool_ release]; > ...
11 years, 1 month ago (2009-10-29 00:21:21 UTC) #14
Mark Mentovai
Also... In the commit message for r29749, I left a whole bunch of test cases. ...
11 years, 1 month ago (2009-10-29 00:52:33 UTC) #15
Mark Mentovai
When you start thinking about optimization, you know you're close... http://codereview.chromium.org/343024/diff/8003/8005 File base/message_pump_mac.mm (right): http://codereview.chromium.org/343024/diff/8003/8005#newcode696 ...
11 years, 1 month ago (2009-10-29 01:52:00 UTC) #16
dmac
I'll work on putting some unit tests together. http://codereview.chromium.org/343024/diff/8003/8005 File base/message_pump_mac.mm (right): http://codereview.chromium.org/343024/diff/8003/8005#newcode9 Line 9: ...
11 years, 1 month ago (2009-10-29 18:01:26 UTC) #17
dmac
On 2009/10/29 18:01:26, dmac wrote: > I'll work on putting some unit tests together. Still ...
11 years, 1 month ago (2009-10-29 21:12:50 UTC) #18
Mark Mentovai
dmac, I meant to bring this up in the debugger to analyze myself, but there ...
11 years, 1 month ago (2009-10-29 22:02:35 UTC) #19
dmac
Latest and greatest with the DeferredAutoreleasePool. I will add a pile of unittests tomorrow AM, ...
11 years, 1 month ago (2009-10-30 06:27:17 UTC) #20
TVL
generally looks pretty nice, but some where in here I think we need to add ...
11 years, 1 month ago (2009-10-30 13:29:11 UTC) #21
pink (ping after 24hrs)
like TVL suggested, a big comment would help, but I like the idea. http://codereview.chromium.org/343024/diff/6007/6008 File ...
11 years, 1 month ago (2009-10-30 14:06:06 UTC) #22
Mark Mentovai
This is pretty darn clean, I have to say. There's one functional question remaining. I ...
11 years, 1 month ago (2009-10-30 14:18:56 UTC) #23
Mark Mentovai
http://codereview.chromium.org/343024/diff/6007/6008 File base/message_pump_mac.h (right): http://codereview.chromium.org/343024/diff/6007/6008#newcode17 Line 17: // MessagePumpCFRunLoop. For a NSRunLoop, the similar MessagePumpNSRunLoop ...
11 years, 1 month ago (2009-10-30 14:20:53 UTC) #24
TVL
http://codereview.chromium.org/343024/diff/6007/6009 File base/message_pump_mac.mm (right): http://codereview.chromium.org/343024/diff/6007/6009#newcode815 Line 815: deferredPool_ = [[NSMutableArray alloc] initWithCapacity:1]; On 2009/10/30 14:18:56, ...
11 years, 1 month ago (2009-10-30 14:24:14 UTC) #25
Avi (use Gerrit)
http://codereview.chromium.org/343024/diff/6007/6008 File base/message_pump_mac.h (right): http://codereview.chromium.org/343024/diff/6007/6008#newcode17 Line 17: // MessagePumpCFRunLoop. For a NSRunLoop, the similar MessagePumpNSRunLoop ...
11 years, 1 month ago (2009-10-30 14:30:53 UTC) #26
dmac
Think I covered everything. http://codereview.chromium.org/343024/diff/6007/6008 File base/message_pump_mac.h (right): http://codereview.chromium.org/343024/diff/6007/6008#newcode17 Line 17: // MessagePumpCFRunLoop. For a ...
11 years, 1 month ago (2009-10-30 20:16:18 UTC) #27
Mark Mentovai
Very nice. Almost done. Functionally, this is almost perfect now. There's a missing flag-clear that ...
11 years, 1 month ago (2009-10-30 20:48:36 UTC) #28
dmac
/me Calling Guinness to see if there is a record for most comments on a ...
11 years, 1 month ago (2009-10-30 21:34:36 UTC) #29
Mark Mentovai
http://codereview.chromium.org/343024/diff/25/2024 File base/message_pump_mac.h (right): http://codereview.chromium.org/343024/diff/25/2024#newcode272 Line 272: bool needs_event_loop_wake_up_; dmac wrote: > I'm confused. If ...
11 years, 1 month ago (2009-10-30 21:37:02 UTC) #30
Mark Mentovai
11 years, 1 month ago (2009-10-30 21:47:04 UTC) #31
In the TEST= section of the description, please list the three test cases for
this bug.  One of them is the test case from bug 25857.  The other two are the
test cases for the workarounds you're removing.

LGTM with this very small number of changes.

Congratulations, you've qualified for Chromium Readability!

http://codereview.chromium.org/343024/diff/8024/8025
File base/message_pump_mac.h (right):

http://codereview.chromium.org/343024/diff/8024/8025#newcode237
Line 237: // ObjC objects and C++ objects can't be friends, so this C function
remove letter C

http://codereview.chromium.org/343024/diff/8024/8026
File base/message_pump_mac.mm (right):

http://codereview.chromium.org/343024/diff/8024/8026#newcode20
Line 20: // This pool passes the objects stored in it to the pool above it in
the
pool above or pool below?  Stacks are usually described as growing up, right? 
(But the pointers decrease.  Horrors!)  The way you've used "above" here seems
contrary to how you've used it on line 764.  I think this should be "below."

http://codereview.chromium.org/343024/diff/8024/8026#newcode48
Line 48: // This class is independant from scoped_nsautoreleasepool because
having
The name of the class is actually ScopedNSAutoreleasePool.

http://codereview.chromium.org/343024/diff/8024/8026#newcode801
Line 801: // MessagePumpNSApplication::EnterExitRunLoop. We send the event just
as the
Final we.

Powered by Google App Engine
This is Rietveld 408576698