Closed Bug 1558145 Opened 5 years ago Closed 1 year ago

Rename `flags` to `loadFlags` in the options object argument passed by browser.loadURI consumers

Categories

(Firefox :: General, task, P5)

68 Branch
task

Tracking

()

RESOLVED DUPLICATE of bug 1558149

People

(Reporter: Gijs, Unassigned, Mentored)

References

Details

After bug 1519365 we accept both variations. We should update consumers so we can stop supporting the flags option and so it's easier to find loadFlags consumers in the tree, and there's less confusion about all the different meanings flags can have.

This is a mentored bug, but probably not the best thing for a "good first bug", because of how many places need updating. It's probably a good idea to do per-toplevel-directory patches for browser/ and toolkit/ and then a third for "everything else".

Bugbug thinks this bug is a task, but please change it back in case of error.

Type: defect → task
Priority: -- → P5

I'd like to help with this. Just give me a rundown of what must be done.

Flags: needinfo?(gijskruitbosch+bugs)

(In reply to premk from comment #2)

I'd like to help with this. Just give me a rundown of what must be done.

There's a high-level summary in comment #0. Basically, go through the codebase (probably using searchfox) for places that call the loadURI method on a browser object with an options argument that contains a flags property, and make it use a loadFlags property instead. Happy to help clarify that further if you have a specific question.

Flags: needinfo?(gijskruitbosch+bugs) → needinfo?(prem.kumar.krishnan)

So I just look for all instances of browser.loadURI method call in searchfox and replace the flags property with loadFlags ?

https://searchfox.org/mozilla-central/search?q=browser.loaduri&path=

I'm seeing other objects gbrowser that use the loadURI method with the flags property. Should I ignore those?

https://searchfox.org/mozilla-central/source/browser/base/content/browser.js#3297

Flags: needinfo?(prem.kumar.krishnan) → needinfo?(gijskruitbosch+bugs)

(In reply to premk from comment #4)

So I just look for all instances of browser.loadURI method call in searchfox and replace the flags property with loadFlags ?

We can't assume that the variable referring to the browser is called browser, so we'll probably have to look at instances of .loadURI, and then read the surrounding code to work out if we're passing an options arg with a flags property, and if this is a browser object or not.

https://searchfox.org/mozilla-central/search?q=browser.loaduri&path=

I'm seeing other objects gbrowser that use the loadURI method with the flags property. Should I ignore those?

https://searchfox.org/mozilla-central/source/browser/base/content/browser.js#3297

We'll have to look on a case-by-case basis. In this case, gBrowser is implemented in tabbrowser.js, so if you look at https://searchfox.org/mozilla-central/rev/227f5329f75bd8b16c6b146a7414598a420260cb/browser/base/content/tabbrowser.js#427-429 you'll see that this just forwards to the selected browser, so its callers will also need updating.

Assignee: nobody → prem.kumar.krishnan
Flags: needinfo?(gijskruitbosch+bugs)

(In reply to :Gijs (he/him) from comment #5)

We can't assume that the variable referring to the browser is called browser, so we'll probably have to look at instances of .loadURI, and then read the surrounding code to work out if we're passing an options arg with a flags property, and if this is a browser object or not.

Got it. Just looked it up; there are quite a few instance of the .loadURI method in the code base.

I will use Comment #12 in Bug 1519365 as a starting point and work from there.

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: prem.kumar.krishnan → nobody
Severity: normal normal → S3 S3

(In reply to :Gijs (he/him) from comment #0)

probably not the best thing for a "good first bug", because of how many places need updating. It's probably a good idea to do per-toplevel-directory patches for browser/ and toolkit/ and then a third for "everything else".
Hi, I'd like to give this one a try and I did search for all .loadURI instances on searchfox, but from what I can see there are only 4 places where an args with a flag property is being passed. However you clearly mentioned that there are a lot of places that need updating, am I doing this wrong? Or has the code been updated majorly seeing as this bug was filed 4 years ago?

Flags: needinfo?(gijskruitbosch+bugs)

The arguments get passed around a lot, which is where the other places can be found, but at this point this bug is basically equivalent to bug 1558149 so I'll mark it as a duplicate. Sorry for the confusion!

Status: NEW → RESOLVED
Closed: 1 year ago
Duplicate of bug: 1558149
Flags: needinfo?(gijskruitbosch+bugs)
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.