New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 655708 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

Offline Page Cache: allow MHTML file save to be successful even if frames are missing

Project Member Reported by carlosk@chromium.org, Oct 13 2016

Issue description

Dynamic pages can create or destroy frames during its loading and this might cause an MHTML save operation to fail.

For the specific case of Offline Page Cache, having the most accurate representation of a page is less important that having a minimally relevant version of it. So, for our use case we should not consider missing frames a fail condition. Other use cases should be left unchanged.
 
Another fail case that is related and should be considered is when one of the involved render processes "is gone" (crashed, closed, etc).

Specifically on Android this should condition will be a total failure as we mostly (always?) have a single render process around. But on other platforms, especially with the advent of Out Of Process Iframes, it might be the case that even if one renderer is not around anymore, saving the page without its contents might still be useful.

Comment 2 by dim...@chromium.org, Oct 19 2016

Labels: -Pri-3 Pri-2
Owner: carlosk@chromium.org
Status: Assigned (was: Available)
Project Member

Comment 3 by bugdroid1@chromium.org, Nov 29 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/29da4fe0a2b453e474e6cd530332a2ed02f70576

commit 29da4fe0a2b453e474e6cd530332a2ed02f70576
Author: carlosk <carlosk@chromium.org>
Date: Tue Nov 29 00:01:29 2016

Fail when saving page as MHTML provides information about the cause.

This change adds more detailed information to tracing and UMA histograms about
the reason why a MHTML save operation has failed. This will help us understand
why some specific pages consistently fail and better handle these situations.

It introduces a new enum, MhtmlSaveStatus, that lists all tracked causes. Part
of the reasons are tracked by the browser and the others by the render process
but the reporting is centralized in the former. A few tests from
MHTMLGenerationTest were also changed to verify the MHTML failures they test for
are correctly reported.

BUG= 645686 , 655723 ,655708
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation

Review-Url: https://codereview.chromium.org/2519273002
Cr-Commit-Position: refs/heads/master@{#434783}

[modify] https://crrev.com/29da4fe0a2b453e474e6cd530332a2ed02f70576/content/browser/download/mhtml_generation_browsertest.cc
[modify] https://crrev.com/29da4fe0a2b453e474e6cd530332a2ed02f70576/content/browser/download/mhtml_generation_manager.cc
[modify] https://crrev.com/29da4fe0a2b453e474e6cd530332a2ed02f70576/content/browser/download/mhtml_generation_manager.h
[modify] https://crrev.com/29da4fe0a2b453e474e6cd530332a2ed02f70576/content/browser/frame_host/render_frame_host_impl.cc
[modify] https://crrev.com/29da4fe0a2b453e474e6cd530332a2ed02f70576/content/browser/frame_host/render_frame_host_impl.h
[modify] https://crrev.com/29da4fe0a2b453e474e6cd530332a2ed02f70576/content/common/BUILD.gn
[modify] https://crrev.com/29da4fe0a2b453e474e6cd530332a2ed02f70576/content/common/content_param_traits_macros.h
[add] https://crrev.com/29da4fe0a2b453e474e6cd530332a2ed02f70576/content/common/download/mhtml_save_status.cc
[add] https://crrev.com/29da4fe0a2b453e474e6cd530332a2ed02f70576/content/common/download/mhtml_save_status.h
[modify] https://crrev.com/29da4fe0a2b453e474e6cd530332a2ed02f70576/content/common/frame_messages.h
[modify] https://crrev.com/29da4fe0a2b453e474e6cd530332a2ed02f70576/content/renderer/render_frame_impl.cc
[modify] https://crrev.com/29da4fe0a2b453e474e6cd530332a2ed02f70576/content/renderer/render_frame_impl.h
[modify] https://crrev.com/29da4fe0a2b453e474e6cd530332a2ed02f70576/tools/metrics/histograms/histograms.xml

Blocking: 655723
Cc: petewil@chromium.org
As discussed with petewil@, making this change would also allow us to save even more broken pages than we are already capable. So this must be followed by tests that verify we are actually capable of saving "good enough" pages even when iframes are missing.

This effort could be incorporated on the efforts we are already making to create a page quality testing and evaluation system so that these are continuously and broadly verified.
Blockedon: 672292

Comment 7 by chili@chromium.org, Feb 17 2017

Labels: Hotlist-Fixit
Fixit update: this is a good one for fixit but only after  issue 672292  is resolved (which is conveniently also a fixit one).
Blockedon: -672292
In the context of  issue 672292  the generation and writing of the MHTML footer has already been moved to the browser process. It hasn't yet been marked as fixed because it also encompasses the MHTML header code.

As having the footer code moved already unblocks this issue I'removing the dependency to that one.

The work needed here is:
- Add new configuration parameter to MHTML generation to allow clients to set the saving to ignore missing frames and/or destroyed render processes.
- Detect these situations in MHTMLGenerationManager and act accordingly to the generation parameters set by either skipping missing frames/renderers or failing the operation.
- Add new tests to MHTMLGenerationTest to verify this works as intended.
Blocking: -655723

Sign in to add a comment