Closed Bug 592222 Opened 14 years ago Closed 13 years ago

Create Web Console node getter shortcut functions

Categories

(DevTools :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 580618

People

(Reporter: julian.viereck, Assigned: msucan)

References

Details

(Whiteboard: [post-fx4])

This is a follow up bug for bug 583476 (see https://bugzilla.mozilla.org/show_bug.cgi?id=583476#c21).

Currently, there is no API to get an strong reference to the HUD object (= instance of HeadsUpDisplay). Instead of accessing the property `hudWeakReferences` on the HUD_SERVICE directly, there should be a `getHUDStrongReference` that takes an HUDID, throws an error if the HUDID is not defined and otherwise returns a strong reference to the HUD object.
Whiteboard: [kd4b6]
Severity: normal → blocker
Reprioritizing bugs. You can filter the mail on the word TEABAGS.
Severity: blocker → normal
Whiteboard: [kd4b6] → [kd4b7]
Blocks: devtools4b8
Assignee: nobody → ddahl
Is this bug still relevant with the current code design?
Assignee: ddahl → mihai.sucan
It is relevant, but I doubt it's necessary. What it suggests is:

instead of writing HUDService.hudWeakReferences[hudId].get() ... use a new HUDService.getHUDStrongReference(hudId) method.

Not much difference. Ultimately, I'd prefer a simple getHUD(hudId) ... which behind the scenes gets it from wherever it "wants". However, we do have naming issues in the HUDService already: we have getHeadsUpDisplay() which returns the hudBox XUL element (not the HeadsUpDisplay instance), we have getOutputNode() which returns the same hudBox element (but in reality the hudBox does have an outputNode inside the hudBox), and the list can go on.

Not sure if adding getHUDStrongReference() or getHUD() as suggested ... is really nice at the moment - might only add confusion. This should happen once we clean up more of the code, I'd say.

David, what do you think?
(In reply to comment #3)

> David, what do you think?

The title should change to "Create WebConsole node shortcuts"

And we can add it to our clean up meta bug
Summary: Add API getHUDStrongReference to HUDService → Create Web Console node getter shortcut functions
Whiteboard: [kd4b7]
Whiteboard: [post-fx4]
No longer blocks: devtools4b8
Mihai: can you close this as a dupe of the bug you worked on to implement strongRefs?
Sure!
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.