- Scheduler.add(new Task() { public void perform() throws IOException, JSExn {
- callback.call(N(bytesDownloaded),
- N(is instanceof KnownLength ? ((KnownLength)is).getLength() : 0), null, null, 2);
- } });
+ callargs[0] = JSU.N(bytesDownloaded);
+ callargs[1] = JSU.N(is instanceof KnownLength.KnownLengthInputStream ?
+ ((KnownLength.KnownLengthInputStream)is).getLength() : 0);
+ try {
+ callback.run(callargs);
+ } catch (Exception e) {
+ Log.warn(ProgressWatcher.class, e);
+ }