Bug 993427 - Make getVisualData non-blocking

I don't think we should create more inner functions like this, would prefer to see it moved out.