Confusing name: NavigationDelegate.LoadRequest.isRedirect
Categories
(GeckoView :: General, enhancement, P2)
Tracking
(firefox66 wontfix, firefox67 wontfix, firefox68 fixed)
People
(Reporter: sebastian, Assigned: mbrubeck)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 1 obsolete file)
NavigationDelegate.LoadRequest.isRedirect
: I was expecting this to be a boolean indicating whether the request is a redirect (e.g. HTTP 302) and I couldn't understand how some code in Focus could work the way it worked. Then I noticed the javadoc:
/**
* True if and only if the request was triggered by user interaction.
*/
public final boolean isRedirect;
With that I could understand the code in Focus. So I assume isRedirect
is actually doing what the javadoc says and not about redirects at all?
Updated•5 years ago
|
Assignee | ||
Comment 1•5 years ago
|
||
Bug 1487542 removed the isUserTriggered
flag and added isRedirect
, but I accidentally left that old comment in place.
If you request a URL "http://foo" and this returns a redirect to "http://bar", then onLoadRequest
will be called twice:
- First, with
uri = "http://foo"
andisRedirect = false
- Second with
uri = "http://bar"
andisRedirect = true
The source of the confusion is probably that isRedirect
is set to true for requests that are the result of a redirect rather than ones that cause a redirect. I'll fix the javadoc to explain this.
Assignee | ||
Comment 2•5 years ago
|
||
Focus should have replaced isUserTriggered
with !isRedirect
. It looks like they used the opposite value isRedirect
. If the behavior ended up correct anyways, maybe it's because the code doesn't care about the order of the requests, but only that one of the pair is set to true
...
Assignee | ||
Comment 3•5 years ago
|
||
Updated•5 years ago
|
Pushed by mbrubeck@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9145204dc6e5 Fix outdated javadoc comment for LoadRequest.isRedirect. r=geckoview-reviewers,esawin
Comment 5•5 years ago
|
||
bugherder |
Assignee | ||
Comment 6•5 years ago
|
||
Updated•5 years ago
|
Description
•