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

Issue 753609 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Last visit > 30 days ago
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Unify the fragment handling in OfflinePageModelQuery for original/final urls.

Project Member Reported by romax@chromium.org, Aug 9 2017

Issue description

During the refactoring of OfflinePageModelImpl, the GetPagesByURLs will be refactored to use OfflinePageModelQuery for the purpose of unifying APIs. However the behavior included some cases that need to be treated with separate codepath: the |original_url| will be compared but only *without* stripping the fragments from the URL, while the |final_url| can be controlled to strip the fragments before looking for matches.

The refactoring didn't resolve the issue. So the CountMatchingUrls in offline_page_model_query.cc takes the |strip_frament| as always false from OfflinePageModelQuery::Matches when it's trying to get |original_url_count|.

This should be re-investigated and should be unified in API usage, probably original URLs can be matched with controllable |strip_fragment|.
 

Comment 1 by romax@chromium.org, Aug 9 2017

Summary: Unify the fragment handling in OfflinePageModelQuery for original/final urls. (was: Unify the query by URLs in OfflinePageModelQuery.)
I believe this difference in equality comparison of the original versus final URL is indeed an error. One example where this should* cause a failure:

https://crbug.com/753609#c1
redirects to
https://bugs.chromium.org/p/chromium/issues/detail?id=753609#c1

If the 1st URL above should be offlined a future load attempt of https://crbug.com/753609 would *not* find and load that offline page.

When fixing this issue the OnGetPagesByURLDone method in offline_page_utils.cc should also be updated. In fact, all occurrences of OfflinePageUtils::EqualsIgnoringFragment should be investigated to make sure there's no other places that are also affected.

*: I haven't tested it but looking at OnGetPagesByURLDone in offline_page_utils.cc it seems to be the case.

Sign in to add a comment