Closed Bug 733233 Opened 12 years ago Closed 12 years ago

Create getTabForWindow helper function

Categories

(Firefox for Android Graveyard :: General, defect)

ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 13

People

(Reporter: Margaret, Assigned: Margaret)

References

Details

Attachments

(1 file)

Attached patch patchSplinter Review
When working on bug 711624, I wanted a getTabForWindow function, but I noticed we didn't have one. Then I noticed that in a bunch of places we are calling getBrowserForWindow followed by getTabForBrowser to achieve the same effect. However, if you look at the implementation of these methods, that feels really silly, since getTabForBrowser is basically just doing exactly what getBrowserForWindow just did. I know we probably don't ever have enough tabs for this to really affect performance, but this seems simpler.

My one concern is that we have really crappy test coverage, so we'll have to look at this patch closely to make sure I didn't make any mistakes. I tried to be really careful to make sure the browsers from the getBrowserForWindow calls weren't being used for anything else.
Attachment #603121 - Flags: review?(wjohnston)
Blocks: 711624
Comment on attachment 603121 [details] [diff] [review]
patch

Review of attachment 603121 [details] [diff] [review]:
-----------------------------------------------------------------

This looks fine to me. Minor refactoring for something we're reusing all over the place.
Attachment #603121 - Flags: review?(wjohnston) → review+
Assignee: nobody → margaret.leibovic
https://hg.mozilla.org/mozilla-central/rev/a21a8c92b848
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 13
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: