Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2449)

Issue 103633008: Remove calls of PrerenderTracker::TryCancelOnIOThread in SafeBrowsingResourceThrottle and instead P… (Closed)

Created:
6 years, 11 months ago by jam
Modified:
5 years, 7 months ago
Reviewers:
davidben
CC:
chromium-reviews, site-isolation-reviews_chromium.org, tburkard
Visibility:
Public.

Description

Remove calls of PrerenderTracker::TryCancelOnIOThread in SafeBrowsingResourceThrottle and instead PrerenderContents::Destroy directly on the UI thread. This is part of the work on removing calls to ResourceRequestInfo::GetAssociatedRenderView. The last callers to that method are using it to cancel prerenders if they haven't been used yet, so the checking/cancelling needs to all move to the UI thread. BUG=304341 [email protected] Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=243063

Patch Set 1 : #

Total comments: 4

Patch Set 2 : sync and add static method to PrerenderContents #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+109 lines, -109 lines) Patch
M chrome/browser/prerender/prerender_contents.h View 1 1 chunk +5 lines, -0 lines 1 comment Download
M chrome/browser/prerender/prerender_contents.cc View 1 2 chunks +13 lines, -0 lines 0 comments Download
M chrome/browser/prerender/prerender_resource_throttle.cc View 1 2 chunks +1 line, -12 lines 0 comments Download
M chrome/browser/renderer_host/safe_browsing_resource_throttle.h View 1 1 chunk +10 lines, -2 lines 0 comments Download
M chrome/browser/renderer_host/safe_browsing_resource_throttle.cc View 1 2 chunks +64 lines, -43 lines 1 comment Download
M chrome/browser/safe_browsing/client_side_detection_host.cc View 1 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/safe_browsing/client_side_detection_host_unittest.cc View 1 7 chunks +9 lines, -9 lines 0 comments Download
M chrome/browser/safe_browsing/ui_manager.h View 1 2 chunks +3 lines, -13 lines 0 comments Download
M chrome/browser/safe_browsing/ui_manager.cc View 1 2 chunks +2 lines, -28 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
jam
6 years, 11 months ago (2014-01-03 02:57:28 UTC) #1
jam
[email protected]
6 years, 11 months ago (2014-01-03 02:57:44 UTC) #2
jam
Redirecting to David
6 years, 11 months ago (2014-01-03 20:45:54 UTC) #3
davidben
LGTM, although I'm not actually very familiar with the SafeBrowsing code. https://codereview.chromium.org/103633008/diff/30005/chrome/browser/renderer_host/safe_browsing_resource_throttle.cc File chrome/browser/renderer_host/safe_browsing_resource_throttle.cc (left): ...
6 years, 11 months ago (2014-01-05 02:34:00 UTC) #4
jam
On 2014/01/05 02:34:00, David Benjamin wrote: > LGTM, although I'm not actually very familiar with ...
6 years, 11 months ago (2014-01-05 07:36:27 UTC) #5
davidben
6 years, 11 months ago (2014-01-06 04:13:54 UTC) #6
LGTM.

> I wrote the SB throttle long ago, so I was mostly looking for someone from the
> prerendering team to look at the prerendering specific change to make sure it
> was correct.

Ah, okay.

https://codereview.chromium.org/103633008/diff/340001/chrome/browser/prerende...
File chrome/browser/prerender/prerender_contents.h (right):

https://codereview.chromium.org/103633008/diff/340001/chrome/browser/prerende...
chrome/browser/prerender/prerender_contents.h:152: // prerendering. Otherwise
returns  NULL. Handles a NULL input for
Nit: extra space between 'returns' and 'NULL'.

https://codereview.chromium.org/103633008/diff/340001/chrome/browser/renderer...
File chrome/browser/renderer_host/safe_browsing_resource_throttle.cc (right):

https://codereview.chromium.org/103633008/diff/340001/chrome/browser/renderer...
chrome/browser/renderer_host/safe_browsing_resource_throttle.cc:151: if
(should_show_blocking_page)  {
[ Feel free to ignore this. It's an awfully small amount of code to bikeshedding
over, and you wrote the original one anyway. :-) ]

Hrm, I suppose this could now just be in an else block and
should_show_blocking_page removed.

I wonder if this would be clearer if the "tab is gone" case were handled by
DisplayBlockingPage (as it was before it seems) and the early-return attached to
the prerender case:

  [...]
    if (prerender_contents) {
      prerender_contents->Destroy(prerender::FINAL_STATUS_SAFE_BROWSING);
      content::BrowserThread::PostTask(
          content::BrowserThread::IO,
          FROM_HERE,
          base::Bind(resource.callback, false));
      return;
    }
  }

  ui_manager->DisplayBlockingPage(resource);

Powered by Google App Engine
This is Rietveld 408576698