diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module
index 8bcac2c..5bd745c 100644
--- a/core/modules/comment/comment.module
+++ b/core/modules/comment/comment.module
@@ -257,6 +257,8 @@ function comment_node_view_alter(array &$build, EntityInterface $node, EntityVie
  *
  * @return array
  *   An array as expected by drupal_render().
+ * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
+ *   Use entity_view() instead.
  */
 function comment_view(CommentInterface $comment, $view_mode = 'full', $langcode = NULL) {
   return entity_view($comment, $view_mode, $langcode);
@@ -278,6 +280,8 @@ function comment_view(CommentInterface $comment, $view_mode = 'full', $langcode
  *   An array in the format expected by drupal_render().
  *
  * @see drupal_render()
+ * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
+ *   Use entity_view() instead.
  */
 function comment_view_multiple($comments, $view_mode = 'full', $langcode = NULL) {
   return entity_view_multiple($comments, $view_mode, $langcode);
@@ -578,7 +582,7 @@ function comment_preview(CommentInterface $comment, FormStateInterface $form_sta
     $comment->setCreatedTime($created_time);
     $comment->changed->value = REQUEST_TIME;
     $comment->in_preview = TRUE;
-    $comment_build = comment_view($comment);
+    $comment_build = entity_view($comment, 'full');
     $comment_build['#weight'] = -100;
 
     $preview_build['comment_preview'] = $comment_build;
@@ -588,7 +592,7 @@ function comment_preview(CommentInterface $comment, FormStateInterface $form_sta
     $build = array();
     $parent = $comment->getParentComment();
     if ($parent && $parent->isPublished()) {
-      $build = comment_view($parent);
+      $build = entity_view($parent, 'full');
     }
   }
   else {
diff --git a/core/modules/comment/src/Entity/Comment.php b/core/modules/comment/src/Entity/Comment.php
index bd3fbfc..ce8d043 100644
--- a/core/modules/comment/src/Entity/Comment.php
+++ b/core/modules/comment/src/Entity/Comment.php
@@ -81,7 +81,7 @@ public function preSave(EntityStorageInterface $storage) {
     }
     if ($this->isNew()) {
       // Add the comment to database. This next section builds the thread field.
-      // Also see the documentation for comment_view().
+      // @see \Drupal\comment\CommentViewBuilder::buildComponents().
       $thread = $this->getThread();
       if (empty($thread)) {
         if ($this->threadLock) {
diff --git a/core/modules/comment/src/Plugin/Action/UnpublishByKeywordComment.php b/core/modules/comment/src/Plugin/Action/UnpublishByKeywordComment.php
index 6b70450..1a595dc 100644
--- a/core/modules/comment/src/Plugin/Action/UnpublishByKeywordComment.php
+++ b/core/modules/comment/src/Plugin/Action/UnpublishByKeywordComment.php
@@ -9,8 +9,12 @@
 
 use Drupal\Component\Utility\Tags;
 use Drupal\Core\Action\ConfigurableActionBase;
+use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
+use Drupal\Core\Render\RendererInterface;
 use Drupal\Core\Session\AccountInterface;
+use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
  * Unpublishes a comment containing certain keywords.
@@ -21,14 +25,56 @@
  *   type = "comment"
  * )
  */
-class UnpublishByKeywordComment extends ConfigurableActionBase {
+class UnpublishByKeywordComment extends ConfigurableActionBase implements ContainerFactoryPluginInterface {
+
+  /**
+   * The entity manager.
+   *
+   * @var \Drupal\Core\Entity\EntityManagerInterface
+   */
+  protected $entityManager;
+
+  /**
+   * The renderer.
+   *
+   * @var \Drupal\Core\Render\RendererInterface
+   */
+  protected $renderer;
+
+  /**
+   * Constructs a UnpublishByKeywordComment object.
+   *
+   * @param array $configuration
+   *   A configuration array containing information about the plugin instance.
+   * @param string $plugin_id
+   *   The plugin ID for the plugin instance.
+   * @param mixed $plugin_definition
+   *   The plugin implementation definition.
+   * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
+   *   The entity manager.
+   * @param \Drupal\Core\Render\RendererInterface $renderer
+   *   The renderer.
+   */
+  public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityManagerInterface $entity_manager, RendererInterface $renderer) {
+    parent::__construct($configuration, $plugin_id, $plugin_definition);
+
+    $this->entityManager = $entity_manager;
+    $this->renderer = $renderer;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
+    return new static($configuration, $plugin_id, $plugin_definition, $container->get('entity.manager'), $container->get('renderer'));
+  }
 
   /**
    * {@inheritdoc}
    */
   public function execute($comment = NULL) {
-    $build = comment_view($comment);
-    $text = \Drupal::service('renderer')->renderPlain($build);
+    $build = $this->entityManager->getViewBuilder('comment')->view($comment);
+    $text = $this->renderer->renderPlain($build);
     foreach ($this->configuration['keywords'] as $keyword) {
       if (strpos($text, $keyword) !== FALSE) {
         $comment->setPublished(FALSE);
diff --git a/core/modules/comment/src/Plugin/views/row/Rss.php b/core/modules/comment/src/Plugin/views/row/Rss.php
index 85eacaa..03d8204 100644
--- a/core/modules/comment/src/Plugin/views/row/Rss.php
+++ b/core/modules/comment/src/Plugin/views/row/Rss.php
@@ -106,7 +106,7 @@ public function render($row) {
 
     // The comment gets built and modules add to or modify
     // $comment->rss_elements and $comment->rss_namespaces.
-    $build = comment_view($comment, 'rss');
+    $build = $this->entityManager->getViewBuilder('comment')->view($comment, 'rss');
     unset($build['#theme']);
 
     if (!empty($comment->rss_namespaces)) {
