Change record status: 
Project: 
Introduced in branch: 
8.x
Description: 

Instead of calling file_download to serve a downloaded file you should use the file download controller Drupal\system\FileDownloadController, which itself gets the module handler Drupal::moduleHandler() injected.
Before

<?php
return file_download('temporary', 'config.tar.gz');
?>

Now
<?php
use Drupal\system\FileDownloadController;
$this->fileDownloadController = new FileDownloadController($module_handler);
$request = new Request(array('file' => 'config.tar.gz'));
return
$this->fileDownloadController->download($request, 'temporary');
?>
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done