Closed Bug 904333 Opened 11 years ago Closed 11 years ago

Add forEachRequest method to DOMRequestIpcHelper

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla26

People

(Reporter: kanru, Assigned: kanru)

References

Details

Attachments

(1 file, 1 obsolete file)

In MozKeyboard.js we need to invalidate all PromiseResolvers in the destroy() method. Currently we iterate through this._requests. It looks ugly and breaks the encapsulation.
Assignee: nobody → kchen
Status: NEW → ASSIGNED
Attachment #789367 - Flags: review?(fabrice)
Comment on attachment 789367 [details] [diff] [review]
0001-Bug-904333-Add-forEach-Request-PromiseResolver-metho.patch

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

r=me with comment addressed

::: dom/base/DOMRequestHelper.jsm
@@ +226,5 @@
> +      if (self.getPromiseResolver(k) instanceof self._window.PromiseResolver) {
> +        aCallback(k);
> +      }
> +    });
> +  },

you can do forEach(function(k){....}, this) and get rid of |self| in both methods.
Attachment #789367 - Attachment is obsolete: true
Attachment #789367 - Flags: review?(fabrice)
Attachment #789994 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/9c81d7bd3981
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: