scriptData.sourceLoadedFuture.initializeRunning(new SourceLoadOperation(script, sourceID));
final ScriptPopulateMode populateModeSaved = populateMode;
AsyncFuture.Callback<Boolean> callback;
SyncCallback syncCallback;
if (populateModeSaved == null) {
callback = new AsyncFuture.Callback<Boolean>() {
@Override
public void done(Boolean res) {
tabImpl.getTabListener().getDebugEventListener().scriptLoaded(script);
}
};
syncCallback = null;
} else {
populateModeSaved.anotherSourceToWait();
callback = new AsyncFuture.Callback<Boolean>() {
@Override
public void done(Boolean res) {
populateModeSaved.sourceLoaded(res);
}
};
syncCallback = new SyncCallback() {
@Override
public void callbackDone(RuntimeException e) {
populateModeSaved.sourceLoadedSync(e);
}
};