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

Issue 7038012: Safely cancel prerenders on threads other than the UI thread (Closed)

Created:
9 years, 7 months ago by mmenke
Modified:
9 years, 7 months ago
CC:
chromium-reviews, tburkard+watch_chromium.org, cbentzel+watch_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

Safely cancel prerenders on threads other than the UI thread. Previously, prerendering was cancelled on the IO thread by not doing something, and then passing a task to the UI thread to abort the prerender. This resulted in a race which could result in swapping in the prerender before the task was executed. This fixes that. BUG=83062 TEST=PrerenderStatusManagerTests, PrerenderBrowserTests Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=86082

Patch Set 1 : '' #

Patch Set 2 : Fix linux #

Total comments: 18

Patch Set 3 : Response to Dominic's comments #

Patch Set 4 : Response to Dominic's comments, part 2 #

Total comments: 6

Patch Set 5 : Response to Dominic's comments, part 3 #

Total comments: 8

Patch Set 6 : Add constructor to RenderViewInfo #

Patch Set 7 : '' #

Patch Set 8 : sync #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+719 lines, -126 lines) Patch
M chrome/browser/prerender/prerender_contents.h View 1 2 3 4 5 6 7 2 chunks +6 lines, -0 lines 0 comments Download
M chrome/browser/prerender/prerender_contents.cc View 1 2 3 4 5 6 7 8 chunks +45 lines, -59 lines 0 comments Download
M chrome/browser/prerender/prerender_manager.h View 1 2 3 4 5 6 7 2 chunks +1 line, -10 lines 0 comments Download
M chrome/browser/prerender/prerender_manager.cc View 1 2 3 4 5 6 7 6 chunks +22 lines, -13 lines 0 comments Download
A chrome/browser/prerender/prerender_tracker.h View 1 2 3 4 5 6 1 chunk +136 lines, -0 lines 1 comment Download
A chrome/browser/prerender/prerender_tracker.cc View 1 2 3 4 5 6 1 chunk +202 lines, -0 lines 1 comment Download
A chrome/browser/prerender/prerender_tracker_unittest.cc View 1 2 3 4 1 chunk +294 lines, -0 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/DEPS View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/renderer_host/resource_dispatcher_host.h View 1 2 3 4 5 6 7 3 chunks +0 lines, -11 lines 0 comments Download
M content/browser/renderer_host/resource_dispatcher_host.cc View 1 2 3 4 5 6 7 4 chunks +9 lines, -33 lines 0 comments Download

Messages

Total messages: 22 (0 generated)
mmenke
John: Please review the src/content changes. I know adding another dependency could be considered a ...
9 years, 7 months ago (2011-05-19 15:04:57 UTC) #1
mmenke
I should add that I talked with Chris about making this a singleton. Due to ...
9 years, 7 months ago (2011-05-19 15:39:11 UTC) #2
dominich
This actually meshes very nicely with a CL that I've been working on that removes ...
9 years, 7 months ago (2011-05-19 15:49:33 UTC) #3
dominich
http://codereview.chromium.org/7038012/diff/17012/chrome/browser/prerender/prerender_tracker.cc File chrome/browser/prerender/prerender_tracker.cc (right): http://codereview.chromium.org/7038012/diff/17012/chrome/browser/prerender/prerender_tracker.cc#newcode32 chrome/browser/prerender/prerender_tracker.cc:32: FinalStatus final_status; Should this have a constructor that takes ...
9 years, 7 months ago (2011-05-19 16:07:27 UTC) #4
mmenke
http://codereview.chromium.org/7038012/diff/17012/chrome/browser/prerender/prerender_contents.cc File chrome/browser/prerender/prerender_contents.cc (right): http://codereview.chromium.org/7038012/diff/17012/chrome/browser/prerender/prerender_contents.cc#newcode285 chrome/browser/prerender/prerender_contents.cc:285: return child_id_ >= 0; On 2011/05/19 15:49:33, dominic wrote: ...
9 years, 7 months ago (2011-05-19 16:40:42 UTC) #5
dominich
http://codereview.chromium.org/7038012/diff/17012/chrome/browser/prerender/prerender_contents.cc File chrome/browser/prerender/prerender_contents.cc (right): http://codereview.chromium.org/7038012/diff/17012/chrome/browser/prerender/prerender_contents.cc#newcode666 chrome/browser/prerender/prerender_contents.cc:666: NOTREACHED(); On 2011/05/19 16:40:42, Matt Menke wrote: > On ...
9 years, 7 months ago (2011-05-19 16:55:46 UTC) #6
mmenke
Thanks for all the great feedback. http://codereview.chromium.org/7038012/diff/15025/chrome/browser/prerender/prerender_contents.cc File chrome/browser/prerender/prerender_contents.cc (right): http://codereview.chromium.org/7038012/diff/15025/chrome/browser/prerender/prerender_contents.cc#newcode321 chrome/browser/prerender/prerender_contents.cc:321: if (render_view_host_ || ...
9 years, 7 months ago (2011-05-19 17:09:23 UTC) #7
mmenke
http://codereview.chromium.org/7038012/diff/17012/chrome/browser/prerender/prerender_tracker.cc File chrome/browser/prerender/prerender_tracker.cc (right): http://codereview.chromium.org/7038012/diff/17012/chrome/browser/prerender/prerender_tracker.cc#newcode32 chrome/browser/prerender/prerender_tracker.cc:32: FinalStatus final_status; On 2011/05/19 16:55:47, dominic wrote: > On ...
9 years, 7 months ago (2011-05-19 17:19:10 UTC) #8
dominich
LGTM You still need jam@ to look over the ResourceDispatcherHost though. http://codereview.chromium.org/7038012/diff/18014/chrome/browser/prerender/prerender_tracker.cc File chrome/browser/prerender/prerender_tracker.cc (right): ...
9 years, 7 months ago (2011-05-19 17:20:21 UTC) #9
jam
On 2011/05/19 15:04:57, Matt Menke wrote: > John: Please review the src/content changes. I know ...
9 years, 7 months ago (2011-05-19 17:24:35 UTC) #10
dominich
On 2011/05/19 17:24:35, John Abd-El-Malek wrote: > On 2011/05/19 15:04:57, Matt Menke wrote: > > ...
9 years, 7 months ago (2011-05-19 17:26:49 UTC) #11
jam
On Thu, May 19, 2011 at 10:26 AM, <dominich@chromium.org> wrote: > On 2011/05/19 17:24:35, John ...
9 years, 7 months ago (2011-05-19 17:29:56 UTC) #12
dominich
On 2011/05/19 17:29:56, John Abd-El-Malek wrote: > On Thu, May 19, 2011 at 10:26 AM, ...
9 years, 7 months ago (2011-05-19 17:33:50 UTC) #13
jam
On Thu, May 19, 2011 at 10:33 AM, <dominich@chromium.org> wrote: > On 2011/05/19 17:29:56, John ...
9 years, 7 months ago (2011-05-19 17:36:39 UTC) #14
dominich
On 2011/05/19 17:36:39, John Abd-El-Malek wrote: > On Thu, May 19, 2011 at 10:33 AM, ...
9 years, 7 months ago (2011-05-19 17:38:54 UTC) #15
mmenke
http://codereview.chromium.org/7038012/diff/18014/chrome/browser/prerender/prerender_tracker.h File chrome/browser/prerender/prerender_tracker.h (right): http://codereview.chromium.org/7038012/diff/18014/chrome/browser/prerender/prerender_tracker.h#newcode60 chrome/browser/prerender/prerender_tracker.h:60: bool IsPrerenderingOnIOThread(int child_id, int route_id); On 2011/05/19 17:20:21, dominic ...
9 years, 7 months ago (2011-05-19 17:39:18 UTC) #16
jam
On Thu, May 19, 2011 at 10:38 AM, <dominich@chromium.org> wrote: > On 2011/05/19 17:36:39, John ...
9 years, 7 months ago (2011-05-19 17:41:44 UTC) #17
commit-bot: I haz the power
Can't apply patch for file content/browser/DEPS. patching file content/browser/DEPS Hunk #1 FAILED at 62. 1 ...
9 years, 7 months ago (2011-05-20 14:55:04 UTC) #18
cbentzel
LGTM This was already landed, but a few small comments. I'll use this for the ...
9 years, 7 months ago (2011-05-23 12:08:14 UTC) #19
dominich
On 2011/05/23 12:08:14, cbentzel wrote: > LGTM > > This was already landed, but a ...
9 years, 7 months ago (2011-05-23 15:33:39 UTC) #20
mmenke
On 2011/05/23 15:33:39, dominic wrote: > On 2011/05/23 12:08:14, cbentzel wrote: > > LGTM > ...
9 years, 7 months ago (2011-05-23 15:37:45 UTC) #21
dominich.google
9 years, 7 months ago (2011-05-23 15:39:46 UTC) #22
On Mon, May 23, 2011 at 8:37 AM, <mmenke@chromium.org> wrote:

> On 2011/05/23 15:33:39, dominic wrote:
>
>> On 2011/05/23 12:08:14, cbentzel wrote:
>> > LGTM
>> >
>> > This was already landed, but a few small comments. I'll use this for the
>> SSL
>> > Client Auth cancellation, and possibly as an approach for HTTP auth.
>> >
>> >
>>
>
>
>
http://codereview.chromium.org/7038012/diff/25001/chrome/browser/prerender/pr...
>
>> > File chrome/browser/prerender/prerender_tracker.cc (right):
>> >
>> >
>>
>
>
>
http://codereview.chromium.org/7038012/diff/25001/chrome/browser/prerender/pr...
>
>> > chrome/browser/prerender/prerender_tracker.cc:143: FinalStatus
>> > PrerenderTracker::SetFinalStatus(int child_id, int route_id,
>> > I think it would be clearer if this signature changed to
>> >
>> > bool PrerenderTracker::SetFinalStatus(int child_id, int route_id,
>>
> FinalStatus
>
>> > desired_final_status, FinalStatus* actual_final_status)
>> >
>> > it would also be more symmetric with GetFinalStatus
>> >
>> > false would be returned if the status was already set.
>> >
>> >
>>
>
>
>
http://codereview.chromium.org/7038012/diff/25001/chrome/browser/prerender/pr...
>
>> > File chrome/browser/prerender/prerender_tracker.h (right):
>> >
>> >
>>
>
>
>
http://codereview.chromium.org/7038012/diff/25001/chrome/browser/prerender/pr...
>
>> > chrome/browser/prerender/prerender_tracker.h:68: protected:
>> > It looks like there is no need for the protected section - no
>> inheritance is
>> > done.
>>
>
>  I'm touching this code so I can make these changes as part of that change
>> if
>>
> you
>
>> want.
>>
>
> I'm happy to do it myself - already have a CL running through the trybots
> (http://codereview.chromium.org/7060012/).  I don't think it'll conflict
> with
> your changes, however, if incorporating it into your CL makes life easier
> on
> you, just say so.
>
>
>
Go ahead. Thanks.

Powered by Google App Engine
This is Rietveld 408576698