Commit cd411a77 authored by Mugdha Lakhani's avatar Mugdha Lakhani Committed by Commit Bot

[WebLayer] Skip capturing page text while prerendering.

If a page is being prerendered, we don't need to capture its text for
the translate agent. This adds a check and skips page text capture.

Bug: 1096088
Change-Id: I566495f377bd26d7cdc4f45c3b40c52fd76379eb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2352820
Commit-Queue: Mugdha Lakhani <nator@chromium.org>
Reviewed-by: default avatarBo <boliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#798105}
parent 888a0b92
......@@ -104,6 +104,10 @@ void WebLayerRenderFrameObserver::CapturePageText() {
if (document_loader && document_loader->HasUnreachableURL())
return;
// Don't index/capture pages that are being prerendered.
if (prerender::PrerenderHelper::IsPrerendering(render_frame()))
return;
// Don't capture contents unless there is a translate agent to consume them.
if (!translate_agent_)
return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment