Closed Bug 1196476 Opened 10 years ago Closed 10 years ago

Replace ProgressTracker::FirstObserverIs() with a simpler mechanism

Categories

(Firefox :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 43
Tracking Status
firefox43 --- fixed

People

(Reporter: seth, Assigned: seth)

References

Details

Attachments

(1 file)

In bug 1194912 we'll start storing ProgressTracker's observer list as a hash table, which means there won't be a clearly defined notion of which observer is first, because hash tables aren't ordered. Unfortunately, we rely upon this information, because we use ProgressTracker::FirstObserverIs() to ensure that only the first imgRequestProxy for a given image can adjust the image's network priority. In this bug, we'll get rid of FirstObserverIs() and replace it with a simpler mechanism that will live directly in imgRequest.
Here's the patch. We basically just store a raw pointer to the first observer on imgRequest. We only store this pointer for the purposes of comparison with other pointers, so it's OK that it's raw. It could happen that the first observer could get destroyed and another imgRequestProxy for the same image could get allocated at the same location, so this mechanism might fail sometimes, but this doesn't seem any more dangerous than the current method, since if we destroy the first proxy for the image now, another proxy will effectively randomly become the "first" proxy.
Attachment #8650154 - Flags: review?(tnikkel)
Attachment #8650154 - Flags: review?(tnikkel) → review+
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 43
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: