diff --git a/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php
index a98bf57..6fed6f7 100644
--- a/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php
+++ b/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Core\EventSubscriber;
 
+use Drupal\Core\Routing\RedirectDestinationInterface;
 use Drupal\Core\Url;
 use Drupal\Core\Utility\Error;
 use Psr\Log\LoggerInterface;
@@ -35,16 +36,26 @@ class DefaultExceptionHtmlSubscriber extends HttpExceptionSubscriberBase {
   protected $logger;
 
   /**
+   * The redirect destination service.
+   *
+   * @var \Drupal\Core\Routing\RedirectDestinationInterface
+   */
+  protected $redirectDestination;
+
+  /**
    * Constructs a new DefaultExceptionHtmlSubscriber.
    *
    * @param \Symfony\Component\HttpKernel\HttpKernelInterface $http_kernel
    *   The HTTP kernel.
    * @param \Psr\Log\LoggerInterface $logger
    *   The logger service.
+   * @param \Drupal\Core\Routing\RedirectDestinationInterface $redirect_destination
+   *   The redirect destination service.
    */
-  public function __construct(HttpKernelInterface $http_kernel, LoggerInterface $logger) {
+  public function __construct(HttpKernelInterface $http_kernel, LoggerInterface $logger, RedirectDestinationInterface $redirect_destination) {
     $this->httpKernel = $http_kernel;
     $this->logger = $logger;
+    $this->redirectDestination = $redirect_destination;
   }
 
   /**
@@ -104,10 +115,10 @@ protected function makeSubrequest(GetResponseForExceptionEvent $event, $url, $st
 
     if ($url != $request->getBasePath() . '/' && $url != $current_url) {
       if ($request->getMethod() === 'POST') {
-        $sub_request = Request::create($url, 'POST', $this->drupalGetDestination() + ['_exception_statuscode' => $status_code] + $request->request->all(), $request->cookies->all(), [], $request->server->all());
+        $sub_request = Request::create($url, 'POST', $this->redirectDestination->getAsArrays() + ['_exception_statuscode' => $status_code] + $request->request->all(), $request->cookies->all(), [], $request->server->all());
       }
       else {
-        $sub_request = Request::create($url, 'GET', $request->query->all() + $this->drupalGetDestination() + ['_exception_statuscode' => $status_code], $request->cookies->all(), [], $request->server->all());
+        $sub_request = Request::create($url, 'GET', $request->query->all() + $this->redirectDestination->getAsArray() + ['_exception_statuscode' => $status_code], $request->cookies->all(), [], $request->server->all());
       }
 
       try {
@@ -133,11 +144,4 @@ protected function makeSubrequest(GetResponseForExceptionEvent $event, $url, $st
     }
   }
 
-  /**
-   * Wraps drupal_get_destination().
-   */
-  protected function drupalGetDestination() {
-    return drupal_get_destination();
-  }
-
 }
diff --git a/core/lib/Drupal/Core/Render/Element/SystemCompactLink.php b/core/lib/Drupal/Core/Render/Element/SystemCompactLink.php
index c561b38..7d0adb7 100644
--- a/core/lib/Drupal/Core/Render/Element/SystemCompactLink.php
+++ b/core/lib/Drupal/Core/Render/Element/SystemCompactLink.php
@@ -63,7 +63,7 @@ public static function preRenderCompactLink($element) {
       $element['#url'] = BaseUrl::fromRoute('system.admin_compact_page', array('mode' => 'off'));
       $element['#options'] = array(
         'attributes' => array('title' => t('Expand layout to include descriptions.')),
-        'query' => drupal_get_destination(),
+        'query' => \Drupal::service('redirect.destination')->getAsArray(),
       );
     }
     else {
@@ -71,7 +71,7 @@ public static function preRenderCompactLink($element) {
       $element['#url'] = BaseUrl::fromRoute('system.admin_compact_page', array('mode' => 'on'));
       $element['#options'] = array(
         'attributes' => array('title' => t('Compress layout by hiding descriptions.')),
-        'query' => drupal_get_destination(),
+        'query' => \Drupal::service('redirect.destination')->getAsArray(),
       );
     }
 
diff --git a/core/modules/book/src/Form/BookAdminEditForm.php b/core/modules/book/src/Form/BookAdminEditForm.php
index 29fad42..0939476 100644
--- a/core/modules/book/src/Form/BookAdminEditForm.php
+++ b/core/modules/book/src/Form/BookAdminEditForm.php
@@ -13,6 +13,7 @@
 use Drupal\Core\Entity\EntityStorageInterface;
 use Drupal\Core\Form\FormBase;
 use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Routing\RedirectDestinationInterface;
 use Drupal\Core\Render\Element;
 use Drupal\Core\Url;
 use Drupal\node\NodeInterface;
@@ -38,16 +39,26 @@ class BookAdminEditForm extends FormBase {
   protected $bookManager;
 
   /**
+   * The redirect destination service.
+   *
+   * @var \Drupal\Core\Routing\RedirectDestinationInterface
+   */
+  protected $redirectDestination;
+
+  /**
    * Constructs a new BookAdminEditForm.
    *
    * @param \Drupal\Core\Entity\EntityStorageInterface $node_storage
    *   The custom block storage.
    * @param \Drupal\book\BookManagerInterface $book_manager
    *   The book manager.
+   * @param \Drupal\Core\Routing\RedirectDestinationInterface $redirect_destination
+   *   The redirect destination service.
    */
-  public function __construct(EntityStorageInterface $node_storage, BookManagerInterface $book_manager) {
+  public function __construct(EntityStorageInterface $node_storage, BookManagerInterface $book_manager, RedirectDestinationInterface $redirect_destination) {
     $this->nodeStorage = $node_storage;
     $this->bookManager = $book_manager;
+    $this->redirectDestination = $redirect_destination;
   }
 
   /**
@@ -206,7 +217,7 @@ protected function bookAdminTableTree(array $tree, array &$form) {
     $delta = ($count < 30) ? 15 : intval($count / 2) + 1;
 
     $access = \Drupal::currentUser()->hasPermission('administer nodes');
-    $destination = drupal_get_destination();
+    $destination = $this->redirectDestination->getAsArray();
 
     foreach ($tree as $data) {
       $nid = $data['link']['nid'];
diff --git a/core/modules/comment/src/Form/CommentAdminOverview.php b/core/modules/comment/src/Form/CommentAdminOverview.php
index c241841..cef1748 100644
--- a/core/modules/comment/src/Form/CommentAdminOverview.php
+++ b/core/modules/comment/src/Form/CommentAdminOverview.php
@@ -15,6 +15,7 @@
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Form\FormBase;
 use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Routing\RedirectDestinationInterface;
 use Drupal\Core\Url;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -52,6 +53,13 @@ class CommentAdminOverview extends FormBase {
   protected $moduleHandler;
 
   /**
+   * The redirect destination service.
+   *
+   * @var \Drupal\Core\Routing\RedirectDestinationInterface
+   */
+  protected $redirectDestination;
+
+  /**
    * Creates a CommentAdminOverview form.
    *
    * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
@@ -62,12 +70,15 @@ class CommentAdminOverview extends FormBase {
    *   The date formatter service.
    * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
    *   The module handler.
+   * @param \Drupal\Core\Routing\RedirectDestinationInterface $redirect_destination
+   *   The redirect destination service.
    */
-  public function __construct(EntityManagerInterface $entity_manager, CommentStorageInterface $comment_storage, DateFormatter $date_formatter, ModuleHandlerInterface $module_handler) {
+  public function __construct(EntityManagerInterface $entity_manager, CommentStorageInterface $comment_storage, DateFormatter $date_formatter, ModuleHandlerInterface $module_handler, RedirectDestinationInterface $redirect_destination) {
     $this->entityManager = $entity_manager;
     $this->commentStorage = $comment_storage;
     $this->dateFormatter = $date_formatter;
     $this->moduleHandler = $module_handler;
+    $this->redirectDestination = $redirect_destination;
   }
 
   /**
@@ -167,7 +178,7 @@ public function buildForm(array $form, FormStateInterface $form_state, $type = '
 
     // Build a table listing the appropriate comments.
     $options = array();
-    $destination = drupal_get_destination();
+    $destination = $this->redirectDestination->getAsArray();
 
     $commented_entity_ids = array();
     $commented_entities = array();
diff --git a/core/modules/comment/src/Plugin/views/field/LinkApprove.php b/core/modules/comment/src/Plugin/views/field/LinkApprove.php
index b249a74..5d152f2 100644
--- a/core/modules/comment/src/Plugin/views/field/LinkApprove.php
+++ b/core/modules/comment/src/Plugin/views/field/LinkApprove.php
@@ -53,7 +53,7 @@ protected function renderLink($data, ResultRow $values) {
 
     $this->options['alter']['make_link'] = TRUE;
     $this->options['alter']['url'] = Url::fromRoute('comment.approve', ['comment' => $comment->id()]);
-    $this->options['alter']['query'] = drupal_get_destination() + array('token' => \Drupal::csrfToken()->get($this->options['alter']['url']->toString()));
+    $this->options['alter']['query'] = \Drupal::service('redirect.destination')->getAsArray() + array('token' => \Drupal::csrfToken()->get($this->options['alter']['url']->toString()));
 
     return $text;
   }
diff --git a/core/modules/comment/src/Plugin/views/field/LinkDelete.php b/core/modules/comment/src/Plugin/views/field/LinkDelete.php
index b36c223..c504e65 100644
--- a/core/modules/comment/src/Plugin/views/field/LinkDelete.php
+++ b/core/modules/comment/src/Plugin/views/field/LinkDelete.php
@@ -44,7 +44,7 @@ protected function renderLink($data, ResultRow $values) {
 
     $this->options['alter']['make_link'] = TRUE;
     $this->options['alter']['url'] = $comment->urlInfo('delete-form');
-    $this->options['alter']['query'] = drupal_get_destination();
+    $this->options['alter']['query'] = \Drupal::service('redirect.destination')->getAsArray();
 
     return $text;
   }
diff --git a/core/modules/comment/src/Plugin/views/field/LinkEdit.php b/core/modules/comment/src/Plugin/views/field/LinkEdit.php
index 316c272..6d411a3 100644
--- a/core/modules/comment/src/Plugin/views/field/LinkEdit.php
+++ b/core/modules/comment/src/Plugin/views/field/LinkEdit.php
@@ -60,7 +60,7 @@ protected function renderLink($data, ResultRow $values) {
     unset($this->options['alter']['fragment']);
 
     if (!empty($this->options['destination'])) {
-      $this->options['alter']['query'] = drupal_get_destination();
+      $this->options['alter']['query'] = \Drupal::service('redirect.destination')->getAsArray();
     }
 
     $this->options['alter']['url'] = $comment->urlInfo('edit-form');
diff --git a/core/modules/content_translation/content_translation.module b/core/modules/content_translation/content_translation.module
index 8f5e8fd..b0777a5 100644
--- a/core/modules/content_translation/content_translation.module
+++ b/core/modules/content_translation/content_translation.module
@@ -336,7 +336,7 @@ function content_translation_form_field_ui_field_edit_form_alter(array &$form, F
   // Provide helpful pointers for administrators.
   if (\Drupal::currentUser()->hasPermission('administer content translation') &&  !$bundle_is_translatable) {
     $toggle_url = \Drupal::url('language.content_settings_page', array(), array(
-      'query' => drupal_get_destination(),
+      'query' => \Drupal::service('redirect.destination')->getAsArray(),
     ));
     $form['field']['translatable']['#description'] = t('To configure translation for this field, <a href="@language-settings-url">enable language support</a> for this type.', array(
       '@language-settings-url' => $toggle_url,
diff --git a/core/modules/contextual/src/Plugin/views/field/ContextualLinks.php b/core/modules/contextual/src/Plugin/views/field/ContextualLinks.php
index dc20868..5a71c70 100644
--- a/core/modules/contextual/src/Plugin/views/field/ContextualLinks.php
+++ b/core/modules/contextual/src/Plugin/views/field/ContextualLinks.php
@@ -119,7 +119,7 @@ public function render(ResultRow $values) {
           'title' => $title,
         );
         if (!empty($this->options['destination'])) {
-          $links[$field]['query'] = drupal_get_destination();
+          $links[$field]['query'] = \Drupal::service('redirect.destination')->getAsArray();
         }
       }
     }
diff --git a/core/modules/field_ui/src/Form/FieldEditForm.php b/core/modules/field_ui/src/Form/FieldEditForm.php
index 9abf3d5..c860191 100644
--- a/core/modules/field_ui/src/Form/FieldEditForm.php
+++ b/core/modules/field_ui/src/Form/FieldEditForm.php
@@ -12,6 +12,7 @@
 use Drupal\Core\Form\FormBase;
 use Drupal\Component\Utility\String;
 use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Routing\RedirectDestinationInterface;
 use Drupal\field\FieldConfigInterface;
 use Drupal\field_ui\FieldUI;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -38,13 +39,23 @@ class FieldEditForm extends FormBase {
   protected $entityManager;
 
   /**
+   * The redirect destination service.
+   *
+   * @var \Drupal\Core\Routing\RedirectDestinationInterface
+   */
+  protected $redirectDestination;
+
+  /**
    * Constructs a new field form.
    *
    * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
    *   The entity manager.
+   * @param \Drupal\Core\Routing\RedirectDestinationInterface $redirect_destination
+   *   The redirect destination service.
    */
-  public function __construct(EntityManagerInterface $entity_manager) {
+  public function __construct(EntityManagerInterface $entity_manager, RedirectDestinationInterface $redirect_destination) {
     $this->entityManager = $entity_manager;
+    $this->redirectDestination = $redirect_destination;
   }
 
   /**
@@ -219,7 +230,7 @@ public function delete(array &$form, FormStateInterface $form_state) {
     $destination = array();
     $request = $this->getRequest();
     if ($request->query->has('destination')) {
-      $destination = drupal_get_destination();
+      $destination = $this->redirectDestination->getAsArray();
       $request->query->remove('destination');
     }
     $entity_type = $this->entityManager->getDefinition($this->field->entity_type);
diff --git a/core/modules/field_ui/src/Form/FieldStorageAddForm.php b/core/modules/field_ui/src/Form/FieldStorageAddForm.php
index 1c95aa6..10b88a3 100644
--- a/core/modules/field_ui/src/Form/FieldStorageAddForm.php
+++ b/core/modules/field_ui/src/Form/FieldStorageAddForm.php
@@ -13,6 +13,7 @@
 use Drupal\Core\Field\FieldTypePluginManagerInterface;
 use Drupal\Core\Form\FormBase;
 use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Routing\RedirectDestinationInterface;
 use Drupal\field\Entity\FieldStorageConfig;
 use Drupal\field\FieldStorageConfigInterface;
 use Drupal\field_ui\FieldUI;
@@ -66,6 +67,13 @@ class FieldStorageAddForm extends FormBase {
   protected $configFactory;
 
   /**
+   * The redirect destination service.
+   *
+   * @var \Drupal\Core\Routing\RedirectDestinationInterface
+   */
+  protected $redirectDestination;
+
+  /**
    * Constructs a new FieldStorageAddForm object.
    *
    * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
@@ -76,12 +84,15 @@ class FieldStorageAddForm extends FormBase {
    *   The configuration factory.
    * @param \Drupal\Core\Entity\Query\QueryFactory $query_factory
    *   The entity query factory.
+   * @param \Drupal\Core\Routing\RedirectDestinationInterface $redirect_destination
+   *   The redirect destination service.
    */
-  public function __construct(EntityManagerInterface $entity_manager, FieldTypePluginManagerInterface $field_type_plugin_manager, QueryFactory $query_factory, ConfigFactoryInterface $config_factory) {
+  public function __construct(EntityManagerInterface $entity_manager, FieldTypePluginManagerInterface $field_type_plugin_manager, QueryFactory $query_factory, ConfigFactoryInterface $config_factory, RedirectDestinationInterface $redirect_destination) {
     $this->entityManager = $entity_manager;
     $this->fieldTypePluginManager = $field_type_plugin_manager;
     $this->queryFactory = $query_factory;
     $this->configFactory = $config_factory;
+    $this->redirectDestination = $redirect_destination;
   }
 
   /**
@@ -382,7 +393,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
     }
 
     if ($destinations) {
-      $destination = drupal_get_destination();
+      $destination = $this->redirectDestination->getAsArray();
       $destinations[] = $destination['destination'];
       $form_state->setRedirectUrl(FieldUI::getNextDestination($destinations, $form_state));
     }
diff --git a/core/modules/forum/src/Controller/ForumController.php b/core/modules/forum/src/Controller/ForumController.php
index 18d7325..0f1568d 100644
--- a/core/modules/forum/src/Controller/ForumController.php
+++ b/core/modules/forum/src/Controller/ForumController.php
@@ -290,7 +290,7 @@ protected function buildActionLinks($vid, TermInterface $forum_term = NULL) {
    * Wraps drupal_get_destination().
    */
   protected function getDestination() {
-    return drupal_get_destination();
+    return \Drupal::service('redirect.destination')->getAsArray();
   }
 
 }
diff --git a/core/modules/locale/locale.pages.inc b/core/modules/locale/locale.pages.inc
index 596df97..80cfd2a 100644
--- a/core/modules/locale/locale.pages.inc
+++ b/core/modules/locale/locale.pages.inc
@@ -121,5 +121,5 @@ function template_preprocess_locale_translation_last_check(array &$variables) {
   $last = $variables['last'];
   $variables['last_checked'] = ($last != NULL);
   $variables['time'] = \Drupal::service('date.formatter')->formatInterval(REQUEST_TIME - $last);
-  $variables['link'] = \Drupal::l(t('Check manually'), new Url('locale.check_translation', array(), array('query' => drupal_get_destination())));
+  $variables['link'] = \Drupal::l(t('Check manually'), new Url('locale.check_translation', array(), array('query' => \Drupal::service('redirect.destination')->getAsArray())));
 }
diff --git a/core/modules/menu_ui/src/MenuForm.php b/core/modules/menu_ui/src/MenuForm.php
index fd38c02..fe23d3e 100644
--- a/core/modules/menu_ui/src/MenuForm.php
+++ b/core/modules/menu_ui/src/MenuForm.php
@@ -383,7 +383,7 @@ protected function buildOverviewTreeForm($tree, $delta) {
         if ($edit_route) {
           $operations['edit']['url'] = $edit_route;
           // Bring the user back to the menu overview.
-          $operations['edit']['query'] = drupal_get_destination();
+          $operations['edit']['query'] = \Drupal::service('redirect.destination')->getAsArray();
         }
         else {
           // Fall back to the standard edit link.
@@ -400,7 +400,7 @@ protected function buildOverviewTreeForm($tree, $delta) {
         }
         elseif ($delete_link = $link->getDeleteRoute()) {
           $operations['delete']['url'] = $delete_link;
-          $operations['delete']['query'] = drupal_get_destination();
+          $operations['delete']['query'] = \Drupal::service('redirect.destination')->getAsArray();
           $operations['delete']['title'] = $this->t('Delete');
         }
         if ($link->isTranslatable()) {
diff --git a/core/modules/node/src/NodeListBuilder.php b/core/modules/node/src/NodeListBuilder.php
index f2011c0..7acc1a9 100644
--- a/core/modules/node/src/NodeListBuilder.php
+++ b/core/modules/node/src/NodeListBuilder.php
@@ -128,7 +128,7 @@ public function buildRow(EntityInterface $entity) {
   protected function getDefaultOperations(EntityInterface $entity) {
     $operations = parent::getDefaultOperations($entity);
 
-    $destination = drupal_get_destination();
+    $destination = \Drupal::service('redirect.destination')->getAsArray();
     foreach ($operations as $key => $operation) {
       $operations[$key]['query'] = $destination;
     }
diff --git a/core/modules/node/src/Plugin/views/field/LinkDelete.php b/core/modules/node/src/Plugin/views/field/LinkDelete.php
index 6bc5156..cc4582e 100644
--- a/core/modules/node/src/Plugin/views/field/LinkDelete.php
+++ b/core/modules/node/src/Plugin/views/field/LinkDelete.php
@@ -38,7 +38,7 @@ protected function renderLink($node, ResultRow $values) {
 
     $this->options['alter']['make_link'] = TRUE;
     $this->options['alter']['url'] = $node->urlInfo('delete-form');
-    $this->options['alter']['query'] = drupal_get_destination();
+    $this->options['alter']['query'] = \Drupal::service('redirect.destination')->getAsArray();
 
     $text = !empty($this->options['text']) ? $this->options['text'] : $this->t('Delete');
     return $text;
diff --git a/core/modules/node/src/Plugin/views/field/LinkEdit.php b/core/modules/node/src/Plugin/views/field/LinkEdit.php
index eb8b974..750cd53 100644
--- a/core/modules/node/src/Plugin/views/field/LinkEdit.php
+++ b/core/modules/node/src/Plugin/views/field/LinkEdit.php
@@ -39,7 +39,7 @@ protected function renderLink($node, ResultRow $values) {
 
     $this->options['alter']['make_link'] = TRUE;
     $this->options['alter']['url'] = $node->urlInfo('edit-form');
-    $this->options['alter']['query'] = drupal_get_destination();
+    $this->options['alter']['query'] = \Drupal::service('redirect.destination')->getAsArray();
 
     $text = !empty($this->options['text']) ? $this->options['text'] : $this->t('Edit');
     return $text;
diff --git a/core/modules/node/src/Plugin/views/field/RevisionLink.php b/core/modules/node/src/Plugin/views/field/RevisionLink.php
index b510e50..d2b6f68 100644
--- a/core/modules/node/src/Plugin/views/field/RevisionLink.php
+++ b/core/modules/node/src/Plugin/views/field/RevisionLink.php
@@ -66,7 +66,7 @@ protected function renderLink($data, ResultRow $values) {
 
     $this->options['alter']['make_link'] = TRUE;
     $this->options['alter']['url'] = $url;
-    $this->options['alter']['query'] = drupal_get_destination();
+    $this->options['alter']['query'] = \Drupal::service('redirect.destination')->getAsArray();
 
     return !empty($this->options['text']) ? $this->options['text'] : $this->t('View');
   }
diff --git a/core/modules/node/src/Plugin/views/field/RevisionLinkDelete.php b/core/modules/node/src/Plugin/views/field/RevisionLinkDelete.php
index 1d5a14b..2dc352c 100644
--- a/core/modules/node/src/Plugin/views/field/RevisionLinkDelete.php
+++ b/core/modules/node/src/Plugin/views/field/RevisionLinkDelete.php
@@ -52,7 +52,7 @@ protected function renderLink($data, ResultRow $values) {
 
     $this->options['alter']['make_link'] = TRUE;
     $this->options['alter']['url'] = Url::fromRoute('node.revision_delete_confirm', ['node' => $node->id(), 'node_revision' => $vid]);
-    $this->options['alter']['query'] = drupal_get_destination();
+    $this->options['alter']['query'] = \Drupal::service('redirect.destination')->getAsArray();
 
     return !empty($this->options['text']) ? $this->options['text'] : $this->t('Delete');
   }
diff --git a/core/modules/node/src/Plugin/views/field/RevisionLinkRevert.php b/core/modules/node/src/Plugin/views/field/RevisionLinkRevert.php
index 17db8a8..d3ada26 100644
--- a/core/modules/node/src/Plugin/views/field/RevisionLinkRevert.php
+++ b/core/modules/node/src/Plugin/views/field/RevisionLinkRevert.php
@@ -52,7 +52,7 @@ protected function renderLink($data, ResultRow $values) {
 
     $this->options['alter']['make_link'] = TRUE;
     $this->options['alter']['url'] = Url::fromRoute('node.revision_revert_confirm', ['node' => $node->id(), 'node_revision' => $vid]);
-    $this->options['alter']['query'] = drupal_get_destination();
+    $this->options['alter']['query'] = \Drupal::service('redirect.destination')->getAsArray();
 
     return !empty($this->options['text']) ? $this->options['text'] : $this->t('Revert');
   }
diff --git a/core/modules/path/src/Controller/PathController.php b/core/modules/path/src/Controller/PathController.php
index f21c6b7..8a87023 100644
--- a/core/modules/path/src/Controller/PathController.php
+++ b/core/modules/path/src/Controller/PathController.php
@@ -83,7 +83,7 @@ public function adminOverview(Request $request) {
     $header[] = $this->t('Operations');
 
     $rows = array();
-    $destination = drupal_get_destination();
+    $destination = \Drupal::service('redirect.destination')->getAsArray();
     foreach ($this->aliasStorage->getAliasesForAdminListing($header, $keys) as $data) {
       $row = array();
       // @todo Should Path module store leading slashes? See
diff --git a/core/modules/path/src/Form/EditForm.php b/core/modules/path/src/Form/EditForm.php
index 95d5e20..801889c 100644
--- a/core/modules/path/src/Form/EditForm.php
+++ b/core/modules/path/src/Form/EditForm.php
@@ -58,7 +58,7 @@ public function deleteSubmit(array &$form, FormStateInterface $form_state) {
     ));
 
     if ($this->getRequest()->query->has('destination')) {
-      $url->setOption('query', drupal_get_destination());
+      $url->setOption('query', \Drupal::service('redirect.destination')->getAsArray());
       $this->getRequest()->query->remove('destination');
     }
 
diff --git a/core/modules/shortcut/shortcut.module b/core/modules/shortcut/shortcut.module
index 1414e0f..ccda635 100644
--- a/core/modules/shortcut/shortcut.module
+++ b/core/modules/shortcut/shortcut.module
@@ -313,7 +313,7 @@ function shortcut_preprocess_page(&$variables) {
       'link' => $link,
       'name' => $variables['title'],
     );
-    $query += drupal_get_destination();
+    $query += \Drupal::service('redirect.destination')->getAsArray();
 
     $shortcut_set = shortcut_current_displayed_set();
 
diff --git a/core/modules/system/src/Plugin/views/field/BulkForm.php b/core/modules/system/src/Plugin/views/field/BulkForm.php
index f4a2545..616b9aa 100644
--- a/core/modules/system/src/Plugin/views/field/BulkForm.php
+++ b/core/modules/system/src/Plugin/views/field/BulkForm.php
@@ -284,7 +284,7 @@ public function viewsFormSubmit(&$form, FormStateInterface $form_state) {
       $operation_definition = $action->getPluginDefinition();
       if (!empty($operation_definition['confirm_form_route_name'])) {
         $options = array(
-          'query' => drupal_get_destination(),
+          'query' => \Drupal::service('redirect.destination')->getAsArray(),
         );
         $form_state->setRedirect($operation_definition['confirm_form_route_name'], array(), $options);
       }
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index cf175ca..78b3aa4 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -726,7 +726,7 @@ function system_user_login(UserInterface $account) {
   $config = \Drupal::config('system.date');
   // If the user has a NULL time zone, notify them to set a time zone.
   if (!$account->getTimezone() && $config->get('timezone.user.configurable') && $config->get('timezone.user.warn')) {
-    drupal_set_message(t('Configure your <a href="@user-edit">account time zone setting</a>.', array('@user-edit' => $account->url('edit-form', array('query' => drupal_get_destination(), 'fragment' => 'edit-timezone')))));
+    drupal_set_message(t('Configure your <a href="@user-edit">account time zone setting</a>.', array('@user-edit' => $account->url('edit-form', array('query' => \Drupal::service('redirect.destination')->getAsArray(), 'fragment' => 'edit-timezone')))));
   }
 }
 
diff --git a/core/modules/system/tests/modules/common_test/src/Controller/CommonTestController.php b/core/modules/system/tests/modules/common_test/src/Controller/CommonTestController.php
index cf82dba..6f7cb17 100644
--- a/core/modules/system/tests/modules/common_test/src/Controller/CommonTestController.php
+++ b/core/modules/system/tests/modules/common_test/src/Controller/CommonTestController.php
@@ -89,7 +89,7 @@ public function jsAndCssQuerystring() {
    *   parameter.
    */
   public function destination() {
-    $destination = drupal_get_destination();
+    $destination = \Drupal::service('redirect.destination')->getAsArray();
     $output = "The destination: " . String::checkPlain($destination['destination']);
 
     return new Response($output);
diff --git a/core/modules/taxonomy/src/Form/OverviewTerms.php b/core/modules/taxonomy/src/Form/OverviewTerms.php
index 9e7e391..5fe6343 100644
--- a/core/modules/taxonomy/src/Form/OverviewTerms.php
+++ b/core/modules/taxonomy/src/Form/OverviewTerms.php
@@ -200,7 +200,7 @@ public function buildForm(array $form, FormStateInterface $form_state, Vocabular
     }
 
     $errors = $form_state->getErrors();
-    $destination = drupal_get_destination();
+    $destination = \Drupal::service('redirect.destination')->getAsArray();
     $row_position = 0;
     // Build the actual form.
     $form['terms'] = array(
diff --git a/core/modules/taxonomy/src/Plugin/views/field/LinkEdit.php b/core/modules/taxonomy/src/Plugin/views/field/LinkEdit.php
index 306c02c..70465d2 100644
--- a/core/modules/taxonomy/src/Plugin/views/field/LinkEdit.php
+++ b/core/modules/taxonomy/src/Plugin/views/field/LinkEdit.php
@@ -78,7 +78,7 @@ public function render(ResultRow $values) {
       ));
       if ($term->access('update')) {
         $text = !empty($this->options['text']) ? $this->options['text'] : $this->t('Edit');
-        return \Drupal::l($text, new Url('entity.taxonomy.edit_form', ['taxonomy_term' => $tid], array('query' => drupal_get_destination())));
+        return \Drupal::l($text, new Url('entity.taxonomy.edit_form', ['taxonomy_term' => $tid], array('query' => \Drupal::service('redirect.destination')->getAsArray())));
       }
     }
   }
diff --git a/core/modules/update/update.module b/core/modules/update/update.module
index 6f4403d..01e0f6f 100644
--- a/core/modules/update/update.module
+++ b/core/modules/update/update.module
@@ -290,7 +290,7 @@ function update_storage_clear_submit($form, FormStateInterface $form_state) {
  * Returns a warning message when there is no data about available updates.
  */
 function _update_no_data() {
-  $destination = drupal_get_destination();
+  $destination = \Drupal::service('redirect.destination')->getAsArray();
   return t('No update information available. <a href="@run_cron">Run cron</a> or <a href="@check_manually">check manually</a>.', array(
     '@run_cron' => \Drupal::url('system.run_cron', [], ['query' => $destination]),
     '@check_manually' => \Drupal::url('update.manual_status', [], ['query' => $destination]),
@@ -590,7 +590,7 @@ function _update_project_status_sort($a, $b) {
  */
 function template_preprocess_update_last_check(&$variables) {
   $variables['time'] = \Drupal::service('date.formatter')->formatInterval(REQUEST_TIME - $variables['last']);
-  $variables['link'] = \Drupal::l(t('Check manually'), new Url('update.manual_status', array(), array('query' => drupal_get_destination())));
+  $variables['link'] = \Drupal::l(t('Check manually'), new Url('update.manual_status', array(), array('query' => \Drupal::service('redirect.destination')->getAsArray())));
 }
 
 /**
diff --git a/core/modules/user/src/Plugin/Block/UserLoginBlock.php b/core/modules/user/src/Plugin/Block/UserLoginBlock.php
index 8fc92f0..f1b0149 100644
--- a/core/modules/user/src/Plugin/Block/UserLoginBlock.php
+++ b/core/modules/user/src/Plugin/Block/UserLoginBlock.php
@@ -87,7 +87,7 @@ public function build() {
     unset($form['pass']['#description']);
     $form['name']['#size'] = 15;
     $form['pass']['#size'] = 15;
-    $form['#action'] = $this->url('<current>', [], ['query' => drupal_get_destination(), 'external' => FALSE]);
+    $form['#action'] = $this->url('<current>', [], ['query' => \Drupal::service('redirect.destination')->getAsArray(), 'external' => FALSE]);
     // Build action links.
     $items = array();
     if (\Drupal::config('user.settings')->get('register') != USER_REGISTER_ADMINISTRATORS_ONLY) {
diff --git a/core/modules/user/src/Plugin/views/field/LinkCancel.php b/core/modules/user/src/Plugin/views/field/LinkCancel.php
index abdbec7..c63e00e 100644
--- a/core/modules/user/src/Plugin/views/field/LinkCancel.php
+++ b/core/modules/user/src/Plugin/views/field/LinkCancel.php
@@ -29,7 +29,7 @@ protected function renderLink(EntityInterface $entity, ResultRow $values) {
       $text = !empty($this->options['text']) ? $this->options['text'] : $this->t('Cancel account');
 
       $this->options['alter']['url'] = $entity->urlInfo('cancel-form');
-      $this->options['alter']['query'] = drupal_get_destination();
+      $this->options['alter']['query'] = \Drupal::service('redirect.destination')->getAsArray();
 
       return $text;
     }
diff --git a/core/modules/user/src/Plugin/views/field/LinkEdit.php b/core/modules/user/src/Plugin/views/field/LinkEdit.php
index bb288631..e0fbf60 100644
--- a/core/modules/user/src/Plugin/views/field/LinkEdit.php
+++ b/core/modules/user/src/Plugin/views/field/LinkEdit.php
@@ -28,7 +28,7 @@ protected function renderLink(EntityInterface $entity, ResultRow $values) {
 
       $text = !empty($this->options['text']) ? $this->options['text'] : $this->t('Edit');
 
-      $this->options['alter']['url'] = $entity->urlInfo('edit-form', ['query' => ['destination' => drupal_get_destination()]]);
+      $this->options['alter']['url'] = $entity->urlInfo('edit-form', ['query' => ['destination' => \Drupal::service('redirect.destination')->getAsArray()]]);
 
       return $text;
     }
diff --git a/core/modules/user/src/UserListBuilder.php b/core/modules/user/src/UserListBuilder.php
index 667ba4f..b6d9090 100644
--- a/core/modules/user/src/UserListBuilder.php
+++ b/core/modules/user/src/UserListBuilder.php
@@ -152,7 +152,7 @@ public function buildRow(EntityInterface $entity) {
   public function getOperations(EntityInterface $entity) {
     $operations = parent::getOperations($entity);
     if (isset($operations['edit'])) {
-      $destination = drupal_get_destination();
+      $destination = \Drupal::service('redirect.destination')->getAsArray();
       $operations['edit']['query'] = $destination;
     }
     return $operations;
diff --git a/core/modules/user/user.api.php b/core/modules/user/user.api.php
index 928a56a..eb5d277 100644
--- a/core/modules/user/user.api.php
+++ b/core/modules/user/user.api.php
@@ -136,7 +136,7 @@ function hook_user_login($account) {
   $config = \Drupal::config('system.date');
   // If the user has a NULL time zone, notify them to set a time zone.
   if (!$account->getTimezone() && $config->get('timezone.user.configurable') && $config->get('timezone.user.warn')) {
-    drupal_set_message(t('Configure your <a href="@user-edit">account time zone setting</a>.', array('@user-edit' => $account->url('edit-form', array('query' => drupal_get_destination(), 'fragment' => 'edit-timezone')))));
+    drupal_set_message(t('Configure your <a href="@user-edit">account time zone setting</a>.', array('@user-edit' => $account->url('edit-form', array('query' => \Drupal::service('redirect.destination')->getAsArray(), 'fragment' => 'edit-timezone')))));
   }
 }
 
diff --git a/core/modules/views/src/Plugin/views/field/EntityOperations.php b/core/modules/views/src/Plugin/views/field/EntityOperations.php
index 3b9128c..b609e16 100644
--- a/core/modules/views/src/Plugin/views/field/EntityOperations.php
+++ b/core/modules/views/src/Plugin/views/field/EntityOperations.php
@@ -102,7 +102,7 @@ public function render(ResultRow $values) {
         if (!isset($operation['query'])) {
           $operation['query'] = array();
         }
-        $operation['query'] += drupal_get_destination();
+        $operation['query'] += \Drupal::service('redirect.destination')->getAsArray();
       }
     }
     $build = array(
diff --git a/core/modules/views/src/Plugin/views/field/Links.php b/core/modules/views/src/Plugin/views/field/Links.php
index 2302778..d54d566 100644
--- a/core/modules/views/src/Plugin/views/field/Links.php
+++ b/core/modules/views/src/Plugin/views/field/Links.php
@@ -89,7 +89,7 @@ protected function getLinks() {
         'title' => $title,
       );
       if (!empty($this->options['destination'])) {
-        $links[$field]['query'] = drupal_get_destination();
+        $links[$field]['query'] = \Drupal::service('redirect.destination')->getAsArray();
       }
     }
 
diff --git a/core/modules/views/src/Tests/Plugin/views/field/EntityOperationsUnitTest.php b/core/modules/views/src/Tests/Plugin/views/field/EntityOperationsUnitTest.php
index 8b32482..cb89575 100644
--- a/core/modules/views/src/Tests/Plugin/views/field/EntityOperationsUnitTest.php
+++ b/core/modules/views/src/Tests/Plugin/views/field/EntityOperationsUnitTest.php
@@ -108,7 +108,7 @@ public function testRenderWithDestination() {
       '#type' => 'operations',
       '#links' => $operations
     );
-    $expected_build['#links']['foo']['query'] = drupal_get_destination();
+    $expected_build['#links']['foo']['query'] = \Drupal::service('redirect.destination')->getAsArray();
     $build = $this->plugin->render($result);
     $this->assertSame($expected_build, $build);
   }
