adblockplus/adblockplus — pull request #3 by Yoric (2014-05-13 20:42:45+00:00)
Title: Track issue 475: Use off main thread decoding

Tentative fix for https://issues.adblockplus.org/ticket/475#ticket

**This code is not tested**. I merely wanted to start discussion on whether this is the right strategy. That and I couldn't find a test suite.

The patch rewrites `IO.readFromFile` as follows:
- use the version of `OS.File.read` available since Gecko 29 (iirc) that can read and decode an entire file off the main thread;
- made the use of `Task.jsm` more idiomatic;
- split walking through lines of a string to its own method.