Opened 5 years ago

Closed 5 years ago

#2264 closed change (fixed)

Remove deprecated logic from Utils.runAsync() on Firefox

Reported by: sebastian Assignee: sebastian
Priority: Unknown Milestone: Adblock-Plus-2.6.10-for-Firefox
Module: Adblock-Plus-for-Firefox Keywords:
Cc: trev Blocked By:
Blocking: #2265 Platform: Unknown
Ready: no Confidential: no
Tester: Verified working: no
Review URL(s):

http://codereview.adblockplus.org/5166222576451584

Description

Background

Utils.runAsync() is used to run a callback asynchronously. When that function were introduced there was neither Function.bind() nor arrow functions. So Utils.runAsync() optionally takes the context and arguments the callback is called with. However, this isn't necessary anymore, since the calling code can just bind the function passed in. Moreover, it's no longer necessary to wrap the callback in an nsIRunnable.

What to change

Simplify the implementation of Utils.runAsync(), dropping support for specifying this and arguments passed to the callback, and passing the callback drirectly to Services.tm.currentThread.dispatch(). And adapt code using Uitls.runAsync() binding the callback there.

Change History (5)

comment:1 Changed 5 years ago by sebastian

  • Cc trev added

@trev: I already have a patch but it's up to you to set Ready and Priority.

comment:2 Changed 5 years ago by sebastian

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing
  • Summary changed from Simplify Utils.runAsync() on Firefox to Remove deprecated logic from Utils.runAsync()

comment:3 Changed 5 years ago by sebastian

  • Summary changed from Remove deprecated logic from Utils.runAsync() to Remove deprecated logic from Utils.runAsync() on Firefox

comment:4 Changed 5 years ago by sebastian

  • Blocking 2265 added

comment:5 Changed 5 years ago by sebastian

  • Milestone set to Adblock-Plus-for-Firefox-next
  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.