cc: Fork OutputSurface into CompositorFrameSink.

After this, OutputSurface is only used for the display
compositor (ie cc::Display and friends). And the
CompositorFrameSink API is used for the layer tree
compositor (ie LayerTreeHost and friends).

OutputSurfaceClient is also forked to an identical
CompositorFrameSinkClient.

For now the two are identical, after this they can diverge
and we can delete things on each that doesn't apply anymore.

Broad renamings are:
SynchronousCompositorOutputSurface -> SynchronousCompositorFrameSink
blimp::DelegatedOutputSurface -> BlimpCompositorFrameSink
BlimpOutputSurfaceClient -> BlimpCompositorFrameSinkProxy
BlimpOutputSurface -> BlimpCompositorFrameSinkProxyClient
SurfaceDisplayOutputSurface -> DirectCompositorFrameSink
TestDelegatingOutputSurface -> TestCompositorFrameSink
CompositorOutputSurface -> RendererCompositorFrameSink
mus::OutputSurface -> mus::CompositorFrameSink

TBR=piman
BUG=606056
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel

Review-Url: https://codereview.chromium.org/2337913003
Cr-Commit-Position: refs/heads/master@{#418754}
diff --git a/content/renderer/BUILD.gn b/content/renderer/BUILD.gn
index 3d4e9a9..26dfbdc 100644
--- a/content/renderer/BUILD.gn
+++ b/content/renderer/BUILD.gn
@@ -42,8 +42,8 @@
     "android/renderer_date_time_picker.h",
     "android/synchronous_compositor_filter.cc",
     "android/synchronous_compositor_filter.h",
-    "android/synchronous_compositor_output_surface.cc",
-    "android/synchronous_compositor_output_surface.h",
+    "android/synchronous_compositor_frame_sink.cc",
+    "android/synchronous_compositor_frame_sink.h",
     "android/synchronous_compositor_proxy.cc",
     "android/synchronous_compositor_proxy.h",
     "android/synchronous_compositor_registry.h",
@@ -133,8 +133,6 @@
     "gpu/compositor_external_begin_frame_source.h",
     "gpu/compositor_forwarding_message_filter.cc",
     "gpu/compositor_forwarding_message_filter.h",
-    "gpu/compositor_output_surface.cc",
-    "gpu/compositor_output_surface.h",
     "gpu/frame_swap_message_queue.cc",
     "gpu/frame_swap_message_queue.h",
     "gpu/gpu_benchmarking_extension.cc",
@@ -144,6 +142,8 @@
     "gpu/render_widget_compositor.cc",
     "gpu/render_widget_compositor.h",
     "gpu/render_widget_compositor_delegate.h",
+    "gpu/renderer_compositor_frame_sink.cc",
+    "gpu/renderer_compositor_frame_sink.h",
     "gpu/stream_texture_host_android.cc",
     "gpu/stream_texture_host_android.h",
     "history_controller.cc",
diff --git a/content/renderer/android/synchronous_compositor_filter.cc b/content/renderer/android/synchronous_compositor_filter.cc
index dc96477..8206c242 100644
--- a/content/renderer/android/synchronous_compositor_filter.cc
+++ b/content/renderer/android/synchronous_compositor_filter.cc
@@ -131,24 +131,27 @@
     DCHECK(entry_pair.second);
     int routing_id = entry_pair.first;
     CreateSynchronousCompositorProxy(routing_id, entry_pair.second);
-    auto output_surface_entry = output_surface_map_.find(routing_id);
-    if (output_surface_entry != output_surface_map_.end()) {
-      SetProxyOutputSurface(routing_id, output_surface_entry->second);
+    auto compositor_frame_sink_entry =
+        compositor_frame_sink_map_.find(routing_id);
+    if (compositor_frame_sink_entry != compositor_frame_sink_map_.end()) {
+      SetProxyCompositorFrameSink(routing_id,
+                                  compositor_frame_sink_entry->second);
     }
   }
 }
 
-void SynchronousCompositorFilter::RegisterOutputSurface(
+void SynchronousCompositorFilter::RegisterCompositorFrameSink(
     int routing_id,
-    SynchronousCompositorOutputSurface* output_surface) {
+    SynchronousCompositorFrameSink* compositor_frame_sink) {
   DCHECK(compositor_task_runner_->BelongsToCurrentThread());
-  DCHECK(output_surface);
+  DCHECK(compositor_frame_sink);
   SynchronousCompositorProxy* proxy = FindProxy(routing_id);
   if (proxy) {
-    proxy->SetOutputSurface(output_surface);
+    proxy->SetCompositorFrameSink(compositor_frame_sink);
   } else {
-    DCHECK(output_surface_map_.find(routing_id) == output_surface_map_.end());
-    output_surface_map_[routing_id] = output_surface;
+    DCHECK(compositor_frame_sink_map_.find(routing_id) ==
+           compositor_frame_sink_map_.end());
+    compositor_frame_sink_map_[routing_id] = compositor_frame_sink;
   }
 }
 
@@ -164,18 +167,18 @@
   }
 }
 
-void SynchronousCompositorFilter::UnregisterOutputSurface(
+void SynchronousCompositorFilter::UnregisterCompositorFrameSink(
     int routing_id,
-    SynchronousCompositorOutputSurface* output_surface) {
+    SynchronousCompositorFrameSink* compositor_frame_sink) {
   DCHECK(compositor_task_runner_->BelongsToCurrentThread());
-  DCHECK(output_surface);
+  DCHECK(compositor_frame_sink);
   SynchronousCompositorProxy* proxy = FindProxy(routing_id);
   if (proxy) {
-    proxy->SetOutputSurface(nullptr);
+    proxy->SetCompositorFrameSink(nullptr);
   }
-  auto entry = output_surface_map_.find(routing_id);
-  if (entry != output_surface_map_.end())
-    output_surface_map_.erase(entry);
+  auto entry = compositor_frame_sink_map_.find(routing_id);
+  if (entry != compositor_frame_sink_map_.end())
+    compositor_frame_sink_map_.erase(entry);
 }
 
 void SynchronousCompositorFilter::CreateSynchronousCompositorProxy(
@@ -188,13 +191,13 @@
   sync_compositor_map_.add(routing_id, std::move(proxy));
 }
 
-void SynchronousCompositorFilter::SetProxyOutputSurface(
+void SynchronousCompositorFilter::SetProxyCompositorFrameSink(
     int routing_id,
-    SynchronousCompositorOutputSurface* output_surface) {
-  DCHECK(output_surface);
+    SynchronousCompositorFrameSink* compositor_frame_sink) {
+  DCHECK(compositor_frame_sink);
   SynchronousCompositorProxy* proxy = FindProxy(routing_id);
   DCHECK(proxy);
-  proxy->SetOutputSurface(output_surface);
+  proxy->SetCompositorFrameSink(compositor_frame_sink);
 }
 
 void SynchronousCompositorFilter::DidAddSynchronousHandlerProxy(
@@ -205,9 +208,9 @@
   if (filter_ready_) {
     CreateSynchronousCompositorProxy(routing_id,
                                      synchronous_input_handler_proxy);
-    auto entry = output_surface_map_.find(routing_id);
-    if (entry != output_surface_map_.end())
-      SetProxyOutputSurface(routing_id, entry->second);
+    auto entry = compositor_frame_sink_map_.find(routing_id);
+    if (entry != compositor_frame_sink_map_.end())
+      SetProxyCompositorFrameSink(routing_id, entry->second);
   } else {
     auto*& mapped_synchronous_input_handler_proxy =
         synchronous_input_handler_proxy_map_[routing_id];
diff --git a/content/renderer/android/synchronous_compositor_filter.h b/content/renderer/android/synchronous_compositor_filter.h
index b60d531..ae8797f8 100644
--- a/content/renderer/android/synchronous_compositor_filter.h
+++ b/content/renderer/android/synchronous_compositor_filter.h
@@ -48,12 +48,12 @@
   bool Send(IPC::Message* message) override;
 
   // SynchronousCompositorRegistry overrides.
-  void RegisterOutputSurface(
+  void RegisterCompositorFrameSink(
       int routing_id,
-      SynchronousCompositorOutputSurface* output_surface) override;
-  void UnregisterOutputSurface(
+      SynchronousCompositorFrameSink* compositor_frame_sink) override;
+  void UnregisterCompositorFrameSink(
       int routing_id,
-      SynchronousCompositorOutputSurface* output_surface) override;
+      SynchronousCompositorFrameSink* compositor_frame_sink) override;
 
   // SynchronousInputHandlerProxyClient overrides.
   void DidAddSynchronousHandlerProxy(
@@ -74,9 +74,9 @@
   void CreateSynchronousCompositorProxy(
       int routing_id,
       ui::SynchronousInputHandlerProxy* synchronous_input_handler_proxy);
-  void SetProxyOutputSurface(
+  void SetProxyCompositorFrameSink(
       int routing_id,
-      SynchronousCompositorOutputSurface* output_surface);
+      SynchronousCompositorFrameSink* compositor_frame_sink);
   void UnregisterObjects(int routing_id);
   void RemoveEntryIfNeeded(int routing_id);
   SynchronousCompositorProxy* FindProxy(int routing_id);
@@ -99,14 +99,14 @@
   bool filter_ready_;
   using SynchronousInputHandlerProxyMap =
       base::hash_map<int, ui::SynchronousInputHandlerProxy*>;
-  using OutputSurfaceMap =
-      base::hash_map<int, SynchronousCompositorOutputSurface*>;
+  using CompositorFrameSinkMap =
+      base::hash_map<int, SynchronousCompositorFrameSink*>;
 
   // This is only used before FilterReadyOnCompositorThread.
   SynchronousInputHandlerProxyMap synchronous_input_handler_proxy_map_;
 
   // This is only used if input_handler_proxy has not been registered.
-  OutputSurfaceMap output_surface_map_;
+  CompositorFrameSinkMap compositor_frame_sink_map_;
 
   DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorFilter);
 };
diff --git a/content/renderer/android/synchronous_compositor_output_surface.cc b/content/renderer/android/synchronous_compositor_frame_sink.cc
similarity index 78%
rename from content/renderer/android/synchronous_compositor_output_surface.cc
rename to content/renderer/android/synchronous_compositor_frame_sink.cc
index c6289fe..2e980ad2 100644
--- a/content/renderer/android/synchronous_compositor_output_surface.cc
+++ b/content/renderer/android/synchronous_compositor_frame_sink.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/renderer/android/synchronous_compositor_output_surface.h"
+#include "content/renderer/android/synchronous_compositor_frame_sink.h"
 
 #include <vector>
 
@@ -14,8 +14,9 @@
 #include "base/single_thread_task_runner.h"
 #include "base/threading/thread_task_runner_handle.h"
 #include "cc/output/compositor_frame.h"
+#include "cc/output/compositor_frame_sink_client.h"
 #include "cc/output/context_provider.h"
-#include "cc/output/output_surface_client.h"
+#include "cc/output/output_surface.h"
 #include "cc/output/renderer_settings.h"
 #include "cc/output/software_output_device.h"
 #include "cc/output/texture_mailbox_deleter.h"
@@ -70,7 +71,7 @@
 
 }  // namespace
 
-class SynchronousCompositorOutputSurface::SoftwareOutputSurface
+class SynchronousCompositorFrameSink::SoftwareOutputSurface
     : public cc::OutputSurface {
  public:
   SoftwareOutputSurface(std::unique_ptr<SoftwareDevice> software_device)
@@ -91,19 +92,19 @@
   }
 };
 
-SynchronousCompositorOutputSurface::SynchronousCompositorOutputSurface(
+SynchronousCompositorFrameSink::SynchronousCompositorFrameSink(
     scoped_refptr<cc::ContextProvider> context_provider,
     scoped_refptr<cc::ContextProvider> worker_context_provider,
     int routing_id,
-    uint32_t output_surface_id,
+    uint32_t compositor_frame_sink_id,
     std::unique_ptr<cc::BeginFrameSource> begin_frame_source,
     SynchronousCompositorRegistry* registry,
     scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue)
-    : cc::OutputSurface(std::move(context_provider),
-                        std::move(worker_context_provider),
-                        nullptr),
+    : cc::CompositorFrameSink(std::move(context_provider),
+                              std::move(worker_context_provider),
+                              nullptr),
       routing_id_(routing_id),
-      output_surface_id_(output_surface_id),
+      compositor_frame_sink_id_(compositor_frame_sink_id),
       registry_(registry),
       sender_(RenderThreadImpl::current()->sync_compositor_message_filter()),
       memory_policy_(0u),
@@ -122,21 +123,20 @@
       gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE;
 }
 
-SynchronousCompositorOutputSurface::~SynchronousCompositorOutputSurface() =
-    default;
+SynchronousCompositorFrameSink::~SynchronousCompositorFrameSink() = default;
 
-void SynchronousCompositorOutputSurface::SetSyncClient(
-    SynchronousCompositorOutputSurfaceClient* compositor) {
+void SynchronousCompositorFrameSink::SetSyncClient(
+    SynchronousCompositorFrameSinkClient* compositor) {
   DCHECK(CalledOnValidThread());
   sync_client_ = compositor;
   if (sync_client_)
-    Send(new SyncCompositorHostMsg_OutputSurfaceCreated(routing_id_));
+    Send(new SyncCompositorHostMsg_CompositorFrameSinkCreated(routing_id_));
 }
 
-bool SynchronousCompositorOutputSurface::OnMessageReceived(
+bool SynchronousCompositorFrameSink::OnMessageReceived(
     const IPC::Message& message) {
   bool handled = true;
-  IPC_BEGIN_MESSAGE_MAP(SynchronousCompositorOutputSurface, message)
+  IPC_BEGIN_MESSAGE_MAP(SynchronousCompositorFrameSink, message)
     IPC_MESSAGE_HANDLER(SyncCompositorMsg_SetMemoryPolicy, SetMemoryPolicy)
     IPC_MESSAGE_HANDLER(SyncCompositorMsg_ReclaimResources, OnReclaimResources)
     IPC_MESSAGE_UNHANDLED(handled = false)
@@ -144,19 +144,19 @@
   return handled;
 }
 
-bool SynchronousCompositorOutputSurface::BindToClient(
-    cc::OutputSurfaceClient* surface_client) {
+bool SynchronousCompositorFrameSink::BindToClient(
+    cc::CompositorFrameSinkClient* sink_client) {
   DCHECK(CalledOnValidThread());
-  if (!cc::OutputSurface::BindToClient(surface_client))
+  if (!cc::CompositorFrameSink::BindToClient(sink_client))
     return false;
 
   DCHECK(begin_frame_source_);
   client_->SetBeginFrameSource(begin_frame_source_.get());
   client_->SetMemoryPolicy(memory_policy_);
   client_->SetTreeActivationCallback(
-      base::Bind(&SynchronousCompositorOutputSurface::DidActivatePendingTree,
+      base::Bind(&SynchronousCompositorFrameSink::DidActivatePendingTree,
                  base::Unretained(this)));
-  registry_->RegisterOutputSurface(routing_id_, this);
+  registry_->RegisterCompositorFrameSink(routing_id_, this);
   registered_ = true;
 
   surface_manager_->RegisterSurfaceClientId(surface_id_allocator_->client_id());
@@ -165,10 +165,10 @@
 
   cc::RendererSettings software_renderer_settings;
 
-  std::unique_ptr<SoftwareOutputSurface> output_surface(
+  std::unique_ptr<SoftwareOutputSurface> compositor_frame_sink(
       new SoftwareOutputSurface(
           base::MakeUnique<SoftwareDevice>(&current_sw_canvas_)));
-  software_output_surface_ = output_surface.get();
+  software_compositor_frame_sink_ = compositor_frame_sink.get();
 
   // The shared_bitmap_manager and gpu_memory_buffer_manager here are null as
   // this Display is only used for resourcesless software draws, where no
@@ -177,7 +177,7 @@
   display_.reset(new cc::Display(
       nullptr /* shared_bitmap_manager */,
       nullptr /* gpu_memory_buffer_manager */, software_renderer_settings,
-      nullptr /* begin_frame_source */, std::move(output_surface),
+      nullptr /* begin_frame_source */, std::move(compositor_frame_sink),
       nullptr /* scheduler */, nullptr /* texture_mailbox_deleter */));
   display_->Initialize(&display_client_, surface_manager_.get(),
                        surface_id_allocator_->client_id());
@@ -185,13 +185,13 @@
   return true;
 }
 
-void SynchronousCompositorOutputSurface::DetachFromClient() {
+void SynchronousCompositorFrameSink::DetachFromClient() {
   DCHECK(CalledOnValidThread());
   client_->SetBeginFrameSource(nullptr);
   // Destroy the begin frame source on the same thread it was bound on.
   begin_frame_source_ = nullptr;
   if (registered_)
-    registry_->UnregisterOutputSurface(routing_id_, this);
+    registry_->UnregisterCompositorFrameSink(routing_id_, this);
   client_->SetTreeActivationCallback(base::Closure());
   if (!delegated_surface_id_.is_null())
     surface_factory_->Destroy(delegated_surface_id_);
@@ -199,27 +199,25 @@
       surface_id_allocator_->client_id());
   surface_manager_->InvalidateSurfaceClientId(
       surface_id_allocator_->client_id());
-  software_output_surface_ = nullptr;
+  software_compositor_frame_sink_ = nullptr;
   display_ = nullptr;
   surface_factory_ = nullptr;
   surface_id_allocator_ = nullptr;
   surface_manager_ = nullptr;
-  cc::OutputSurface::DetachFromClient();
+  cc::CompositorFrameSink::DetachFromClient();
   CancelFallbackTick();
 }
 
-void SynchronousCompositorOutputSurface::Reshape(
-    const gfx::Size& size,
-    float scale_factor,
-    const gfx::ColorSpace& color_space,
-    bool has_alpha) {
+void SynchronousCompositorFrameSink::Reshape(const gfx::Size& size,
+                                             float scale_factor,
+                                             const gfx::ColorSpace& color_space,
+                                             bool has_alpha) {
   // Intentional no-op: surface size is controlled by the embedder.
 }
 
 static void NoOpDrawCallback() {}
 
-void SynchronousCompositorOutputSurface::SwapBuffers(
-    cc::CompositorFrame frame) {
+void SynchronousCompositorFrameSink::SwapBuffers(cc::CompositorFrame frame) {
   DCHECK(CalledOnValidThread());
   DCHECK(sync_client_);
 
@@ -259,20 +257,19 @@
     swap_frame = std::move(frame);
   }
 
-  sync_client_->SwapBuffers(output_surface_id_, std::move(swap_frame));
+  sync_client_->SwapBuffers(compositor_frame_sink_id_, std::move(swap_frame));
   DeliverMessages();
   did_swap_ = true;
 }
 
-void SynchronousCompositorOutputSurface::CancelFallbackTick() {
+void SynchronousCompositorFrameSink::CancelFallbackTick() {
   fallback_tick_.Cancel();
   fallback_tick_pending_ = false;
 }
 
-void SynchronousCompositorOutputSurface::FallbackTickFired() {
+void SynchronousCompositorFrameSink::FallbackTickFired() {
   DCHECK(CalledOnValidThread());
-  TRACE_EVENT0("renderer",
-               "SynchronousCompositorOutputSurface::FallbackTickFired");
+  TRACE_EVENT0("renderer", "SynchronousCompositorFrameSink::FallbackTickFired");
   base::AutoReset<bool> in_fallback_tick(&fallback_tick_running_, true);
   SkBitmap bitmap;
   bitmap.allocN32Pixels(1, 1);
@@ -282,14 +279,14 @@
   DemandDrawSw(&canvas);
 }
 
-void SynchronousCompositorOutputSurface::Invalidate() {
+void SynchronousCompositorFrameSink::Invalidate() {
   DCHECK(CalledOnValidThread());
   if (sync_client_)
     sync_client_->Invalidate();
 
   if (!fallback_tick_pending_) {
     fallback_tick_.Reset(
-        base::Bind(&SynchronousCompositorOutputSurface::FallbackTickFired,
+        base::Bind(&SynchronousCompositorFrameSink::FallbackTickFired,
                    base::Unretained(this)));
     base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
         FROM_HERE, fallback_tick_.callback(),
@@ -298,18 +295,18 @@
   }
 }
 
-void SynchronousCompositorOutputSurface::BindFramebuffer() {
+void SynchronousCompositorFrameSink::BindFramebuffer() {
   // This is a delegating output surface, no framebuffer/direct drawing support.
   NOTREACHED();
 }
 
-uint32_t SynchronousCompositorOutputSurface::GetFramebufferCopyTextureFormat() {
+uint32_t SynchronousCompositorFrameSink::GetFramebufferCopyTextureFormat() {
   // This is a delegating output surface, no framebuffer/direct drawing support.
   NOTREACHED();
   return 0;
 }
 
-void SynchronousCompositorOutputSurface::DemandDrawHw(
+void SynchronousCompositorFrameSink::DemandDrawHw(
     const gfx::Size& viewport_size,
     const gfx::Rect& viewport_rect_for_tile_priority,
     const gfx::Transform& transform_for_tile_priority) {
@@ -323,7 +320,7 @@
   InvokeComposite(gfx::Transform(), gfx::Rect(viewport_size));
 }
 
-void SynchronousCompositorOutputSurface::DemandDrawSw(SkCanvas* canvas) {
+void SynchronousCompositorFrameSink::DemandDrawSw(SkCanvas* canvas) {
   DCHECK(CalledOnValidThread());
   DCHECK(canvas);
   DCHECK(!current_sw_canvas_);
@@ -341,12 +338,12 @@
   base::AutoReset<bool> set_in_software_draw(&in_software_draw_, true);
   display_->SetExternalViewport(viewport);
   display_->SetExternalClip(viewport);
-  software_output_surface_->SetSurfaceSize(
+  software_compositor_frame_sink_->SetSurfaceSize(
       gfx::SkISizeToSize(canvas->getBaseLayerSize()));
   InvokeComposite(transform, viewport);
 }
 
-void SynchronousCompositorOutputSurface::InvokeComposite(
+void SynchronousCompositorFrameSink::InvokeComposite(
     const gfx::Transform& transform,
     const gfx::Rect& viewport) {
   gfx::Transform adjusted_transform = transform;
@@ -362,17 +359,17 @@
   }
 }
 
-void SynchronousCompositorOutputSurface::OnReclaimResources(
-    uint32_t output_surface_id,
+void SynchronousCompositorFrameSink::OnReclaimResources(
+    uint32_t compositor_frame_sink_id,
     const cc::ReturnedResourceArray& resources) {
   // Ignore message if it's a stale one coming from a different output surface
   // (e.g. after a lost context).
-  if (output_surface_id != output_surface_id_)
+  if (compositor_frame_sink_id != compositor_frame_sink_id_)
     return;
   client_->ReclaimResources(resources);
 }
 
-void SynchronousCompositorOutputSurface::SetMemoryPolicy(size_t bytes_limit) {
+void SynchronousCompositorFrameSink::SetMemoryPolicy(size_t bytes_limit) {
   DCHECK(CalledOnValidThread());
   bool became_zero = memory_policy_.bytes_limit_when_visible && !bytes_limit;
   bool became_non_zero =
@@ -394,14 +391,14 @@
   }
 }
 
-void SynchronousCompositorOutputSurface::DidActivatePendingTree() {
+void SynchronousCompositorFrameSink::DidActivatePendingTree() {
   DCHECK(CalledOnValidThread());
   if (sync_client_)
     sync_client_->DidActivatePendingTree();
   DeliverMessages();
 }
 
-void SynchronousCompositorOutputSurface::DeliverMessages() {
+void SynchronousCompositorFrameSink::DeliverMessages() {
   std::vector<std::unique_ptr<IPC::Message>> messages;
   std::unique_ptr<FrameSwapMessageQueue::SendMessageScope> send_message_scope =
       frame_swap_message_queue_->AcquireSendMessageScope();
@@ -411,22 +408,22 @@
   }
 }
 
-bool SynchronousCompositorOutputSurface::Send(IPC::Message* message) {
+bool SynchronousCompositorFrameSink::Send(IPC::Message* message) {
   DCHECK(CalledOnValidThread());
   return sender_->Send(message);
 }
 
-bool SynchronousCompositorOutputSurface::CalledOnValidThread() const {
+bool SynchronousCompositorFrameSink::CalledOnValidThread() const {
   return thread_checker_.CalledOnValidThread();
 }
 
-void SynchronousCompositorOutputSurface::ReturnResources(
+void SynchronousCompositorFrameSink::ReturnResources(
     const cc::ReturnedResourceArray& resources) {
   DCHECK(resources.empty());
   client_->ReclaimResources(resources);
 }
 
-void SynchronousCompositorOutputSurface::SetBeginFrameSource(
+void SynchronousCompositorFrameSink::SetBeginFrameSource(
     cc::BeginFrameSource* begin_frame_source) {
   // Software output is synchronous and doesn't use a BeginFrameSource.
   NOTREACHED();
diff --git a/content/renderer/android/synchronous_compositor_output_surface.h b/content/renderer/android/synchronous_compositor_frame_sink.h
similarity index 79%
rename from content/renderer/android/synchronous_compositor_output_surface.h
rename to content/renderer/android/synchronous_compositor_frame_sink.h
index b488d287..7a9b47f 100644
--- a/content/renderer/android/synchronous_compositor_output_surface.h
+++ b/content/renderer/android/synchronous_compositor_frame_sink.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE_H_
-#define CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE_H_
+#ifndef CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_FRAME_SINK_H_
+#define CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_FRAME_SINK_H_
 
 #include <stddef.h>
 
@@ -16,8 +16,8 @@
 #include "base/memory/ref_counted.h"
 #include "base/threading/thread_checker.h"
 #include "cc/output/compositor_frame.h"
+#include "cc/output/compositor_frame_sink.h"
 #include "cc/output/managed_memory_policy.h"
-#include "cc/output/output_surface.h"
 #include "cc/surfaces/display_client.h"
 #include "cc/surfaces/surface_factory_client.h"
 #include "ipc/ipc_message.h"
@@ -43,44 +43,44 @@
 class SynchronousCompositorRegistry;
 class WebGraphicsContext3DCommandBufferImpl;
 
-class SynchronousCompositorOutputSurfaceClient {
+class SynchronousCompositorFrameSinkClient {
  public:
   virtual void DidActivatePendingTree() = 0;
   virtual void Invalidate() = 0;
-  virtual void SwapBuffers(uint32_t output_surface_id,
+  virtual void SwapBuffers(uint32_t compositor_frame_sink_id,
                            cc::CompositorFrame frame) = 0;
 
  protected:
-  virtual ~SynchronousCompositorOutputSurfaceClient() {}
+  virtual ~SynchronousCompositorFrameSinkClient() {}
 };
 
 // Specialization of the output surface that adapts it to implement the
 // content::SynchronousCompositor public API. This class effects an "inversion
 // of control" - enabling drawing to be  orchestrated by the embedding
 // layer, instead of driven by the compositor internals - hence it holds two
-// 'client' pointers (|client_| in the OutputSurface baseclass and
+// 'client' pointers (|client_| in the CompositorFrameSink baseclass and
 // |delegate_|) which represent the consumers of the two roles in plays.
 // This class can be created only on the main thread, but then becomes pinned
 // to a fixed thread when BindToClient is called.
-class SynchronousCompositorOutputSurface
-    : NON_EXPORTED_BASE(public cc::OutputSurface),
+class SynchronousCompositorFrameSink
+    : NON_EXPORTED_BASE(public cc::CompositorFrameSink),
       public cc::SurfaceFactoryClient {
  public:
-  SynchronousCompositorOutputSurface(
+  SynchronousCompositorFrameSink(
       scoped_refptr<cc::ContextProvider> context_provider,
       scoped_refptr<cc::ContextProvider> worker_context_provider,
       int routing_id,
-      uint32_t output_surface_id,
+      uint32_t compositor_frame_sink_id,
       std::unique_ptr<cc::BeginFrameSource> begin_frame_source,
       SynchronousCompositorRegistry* registry,
       scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue);
-  ~SynchronousCompositorOutputSurface() override;
+  ~SynchronousCompositorFrameSink() override;
 
-  void SetSyncClient(SynchronousCompositorOutputSurfaceClient* compositor);
+  void SetSyncClient(SynchronousCompositorFrameSinkClient* compositor);
   bool OnMessageReceived(const IPC::Message& message);
 
-  // OutputSurface.
-  bool BindToClient(cc::OutputSurfaceClient* surface_client) override;
+  // cc::CompositorFrameSink implementation.
+  bool BindToClient(cc::CompositorFrameSinkClient* sink_client) override;
   void DetachFromClient() override;
   void Reshape(const gfx::Size& size,
                float scale_factor,
@@ -116,17 +116,17 @@
 
   // IPC handlers.
   void SetMemoryPolicy(size_t bytes_limit);
-  void OnReclaimResources(uint32_t output_surface_id,
+  void OnReclaimResources(uint32_t compositor_frame_sink_id,
                           const cc::ReturnedResourceArray& resources);
 
   const int routing_id_;
-  const uint32_t output_surface_id_;
+  const uint32_t compositor_frame_sink_id_;
   SynchronousCompositorRegistry* const registry_;  // Not owned.
-  IPC::Sender* const sender_;  // Not owned.
+  IPC::Sender* const sender_;                      // Not owned.
   bool registered_ = false;
 
   // Not owned.
-  SynchronousCompositorOutputSurfaceClient* sync_client_ = nullptr;
+  SynchronousCompositorFrameSinkClient* sync_client_ = nullptr;
 
   // Only valid (non-NULL) during a DemandDrawSw() call.
   SkCanvas* current_sw_canvas_ = nullptr;
@@ -159,14 +159,14 @@
   // Uses surface_manager_.
   std::unique_ptr<cc::Display> display_;
   // Owned by |display_|.
-  SoftwareOutputSurface* software_output_surface_ = nullptr;
+  SoftwareOutputSurface* software_compositor_frame_sink_ = nullptr;
   std::unique_ptr<cc::BeginFrameSource> begin_frame_source_;
 
   base::ThreadChecker thread_checker_;
 
-  DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorOutputSurface);
+  DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorFrameSink);
 };
 
 }  // namespace content
 
-#endif  // CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE_H_
+#endif  // CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_FRAME_SINK_H_
diff --git a/content/renderer/android/synchronous_compositor_proxy.cc b/content/renderer/android/synchronous_compositor_proxy.cc
index cc30844..99eeeeb 100644
--- a/content/renderer/android/synchronous_compositor_proxy.cc
+++ b/content/renderer/android/synchronous_compositor_proxy.cc
@@ -31,7 +31,7 @@
       use_in_process_zero_copy_software_draw_(
           base::CommandLine::ForCurrentProcess()->HasSwitch(
               switches::kSingleProcess)),
-      output_surface_(nullptr),
+      compositor_frame_sink_(nullptr),
       inside_receive_(false),
       hardware_draw_reply_(nullptr),
       software_draw_reply_(nullptr),
@@ -48,21 +48,21 @@
 }
 
 SynchronousCompositorProxy::~SynchronousCompositorProxy() {
-  // The OutputSurface is destroyed/removed by the compositor before shutting
-  // down everything.
-  DCHECK_EQ(output_surface_, nullptr);
+  // The CompositorFrameSink is destroyed/removed by the compositor before
+  // shutting down everything.
+  DCHECK_EQ(compositor_frame_sink_, nullptr);
   input_handler_proxy_->SetOnlySynchronouslyAnimateRootFlings(nullptr);
 }
 
-void SynchronousCompositorProxy::SetOutputSurface(
-    SynchronousCompositorOutputSurface* output_surface) {
-  DCHECK_NE(output_surface_, output_surface);
-  if (output_surface_) {
-    output_surface_->SetSyncClient(nullptr);
+void SynchronousCompositorProxy::SetCompositorFrameSink(
+    SynchronousCompositorFrameSink* compositor_frame_sink) {
+  DCHECK_NE(compositor_frame_sink_, compositor_frame_sink);
+  if (compositor_frame_sink_) {
+    compositor_frame_sink_->SetSyncClient(nullptr);
   }
-  output_surface_ = output_surface;
-  if (output_surface_) {
-    output_surface_->SetSyncClient(this);
+  compositor_frame_sink_ = compositor_frame_sink;
+  if (compositor_frame_sink_) {
+    compositor_frame_sink_->SetSyncClient(this);
   }
 }
 
@@ -129,7 +129,8 @@
 
 void SynchronousCompositorProxy::OnMessageReceived(
     const IPC::Message& message) {
-  if (output_surface_ && output_surface_->OnMessageReceived(message))
+  if (compositor_frame_sink_ &&
+      compositor_frame_sink_->OnMessageReceived(message))
     return;
 
   IPC_BEGIN_MESSAGE_MAP(SynchronousCompositorProxy, message)
@@ -168,19 +169,19 @@
   DCHECK(!inside_receive_);
   inside_receive_ = true;
 
-  if (output_surface_) {
+  if (compositor_frame_sink_) {
     if (!reply_message) {
       base::AutoReset<bool> scoped_hardware_draw_reply_async(
           &hardware_draw_reply_async_, true);
-      output_surface_->DemandDrawHw(params.viewport_size,
-                                    params.viewport_rect_for_tile_priority,
-                                    params.transform_for_tile_priority);
+      compositor_frame_sink_->DemandDrawHw(
+          params.viewport_size, params.viewport_rect_for_tile_priority,
+          params.transform_for_tile_priority);
     } else {
       base::AutoReset<IPC::Message*> scoped_hardware_draw_reply(
           &hardware_draw_reply_, reply_message);
-      output_surface_->DemandDrawHw(params.viewport_size,
-                                    params.viewport_rect_for_tile_priority,
-                                    params.transform_for_tile_priority);
+      compositor_frame_sink_->DemandDrawHw(
+          params.viewport_size, params.viewport_rect_for_tile_priority,
+          params.transform_for_tile_priority);
     }
   }
 
@@ -195,38 +196,40 @@
   }
 }
 
-void SynchronousCompositorProxy::SwapBuffersHwAsync(uint32_t output_surface_id,
-                                                    cc::CompositorFrame frame) {
+void SynchronousCompositorProxy::SwapBuffersHwAsync(
+    uint32_t compositor_frame_sink_id,
+    cc::CompositorFrame frame) {
   DCHECK(inside_receive_);
   DCHECK(hardware_draw_reply_async_);
-  SendDemandDrawHwReplyAsync(std::move(frame), output_surface_id);
+  SendDemandDrawHwReplyAsync(std::move(frame), compositor_frame_sink_id);
   inside_receive_ = false;
 }
 
-void SynchronousCompositorProxy::SwapBuffersHw(uint32_t output_surface_id,
-                                               cc::CompositorFrame frame) {
+void SynchronousCompositorProxy::SwapBuffersHw(
+    uint32_t compositor_frame_sink_id,
+    cc::CompositorFrame frame) {
   DCHECK(inside_receive_);
   DCHECK(hardware_draw_reply_);
-  SendDemandDrawHwReply(std::move(frame), output_surface_id,
+  SendDemandDrawHwReply(std::move(frame), compositor_frame_sink_id,
                         hardware_draw_reply_);
   inside_receive_ = false;
 }
 
 void SynchronousCompositorProxy::SendDemandDrawHwReplyAsync(
     cc::CompositorFrame frame,
-    uint32_t output_surface_id) {
-  Send(new SyncCompositorHostMsg_ReturnFrame(routing_id_, output_surface_id,
-                                             frame));
+    uint32_t compositor_frame_sink_id) {
+  Send(new SyncCompositorHostMsg_ReturnFrame(routing_id_,
+                                             compositor_frame_sink_id, frame));
 }
 
 void SynchronousCompositorProxy::SendDemandDrawHwReply(
     cc::CompositorFrame frame,
-    uint32_t output_surface_id,
+    uint32_t compositor_frame_sink_id,
     IPC::Message* reply_message) {
   SyncCompositorCommonRendererParams common_renderer_params;
   PopulateCommonParams(&common_renderer_params);
   SyncCompositorMsg_DemandDrawHw::WriteReplyParams(
-      reply_message, common_renderer_params, output_surface_id, frame);
+      reply_message, common_renderer_params, compositor_frame_sink_id, frame);
   Send(reply_message);
 }
 
@@ -261,7 +264,7 @@
 
 void SynchronousCompositorProxy::ZeroSharedMemory() {
   // It is possible for this to get called twice, eg. if draw is called before
-  // the OutputSurface is ready. Just ignore duplicated calls rather than
+  // the CompositorFrameSink is ready. Just ignore duplicated calls rather than
   // inventing a complicated system to avoid it.
   if (software_draw_shm_->zeroed)
     return;
@@ -275,13 +278,13 @@
     IPC::Message* reply_message) {
   DCHECK(!inside_receive_);
   inside_receive_ = true;
-  if (output_surface_) {
+  if (compositor_frame_sink_) {
     base::AutoReset<IPC::Message*> scoped_software_draw_reply(
         &software_draw_reply_, reply_message);
     SkCanvas* sk_canvas_for_draw = SynchronousCompositorGetSkCanvas();
     if (use_in_process_zero_copy_software_draw_) {
       DCHECK(sk_canvas_for_draw);
-      output_surface_->DemandDrawSw(sk_canvas_for_draw);
+      compositor_frame_sink_->DemandDrawSw(sk_canvas_for_draw);
     } else {
       DCHECK(!sk_canvas_for_draw);
       DoDemandDrawSw(params);
@@ -296,7 +299,7 @@
 
 void SynchronousCompositorProxy::DoDemandDrawSw(
     const SyncCompositorDemandDrawSwParams& params) {
-  DCHECK(output_surface_);
+  DCHECK(compositor_frame_sink_);
   DCHECK(software_draw_shm_->zeroed);
   software_draw_shm_->zeroed = false;
 
@@ -313,7 +316,7 @@
   canvas.setMatrix(params.transform.matrix());
   canvas.setClipRegion(SkRegion(gfx::RectToSkIRect(params.clip)));
 
-  output_surface_->DemandDrawSw(&canvas);
+  compositor_frame_sink_->DemandDrawSw(&canvas);
 }
 
 void SynchronousCompositorProxy::SwapBuffersSw(cc::CompositorFrame frame) {
@@ -334,7 +337,7 @@
   Send(reply_message);
 }
 
-void SynchronousCompositorProxy::SwapBuffers(uint32_t output_surface_id,
+void SynchronousCompositorProxy::SwapBuffers(uint32_t compositor_frame_sink_id,
                                              cc::CompositorFrame frame) {
   // Verify that exactly one of these is true.
   DCHECK(hardware_draw_reply_async_ || hardware_draw_reply_ ||
@@ -343,9 +346,9 @@
            (hardware_draw_reply_ && hardware_draw_reply_async_) ||
            (software_draw_reply_ && hardware_draw_reply_async_)));
   if (hardware_draw_reply_async_) {
-    SwapBuffersHwAsync(output_surface_id, std::move(frame));
+    SwapBuffersHwAsync(compositor_frame_sink_id, std::move(frame));
   } else if (hardware_draw_reply_) {
-    SwapBuffersHw(output_surface_id, std::move(frame));
+    SwapBuffersHw(compositor_frame_sink_id, std::move(frame));
   } else if (software_draw_reply_) {
     SwapBuffersSw(std::move(frame));
   }
diff --git a/content/renderer/android/synchronous_compositor_proxy.h b/content/renderer/android/synchronous_compositor_proxy.h
index 07a651e..5f25789 100644
--- a/content/renderer/android/synchronous_compositor_proxy.h
+++ b/content/renderer/android/synchronous_compositor_proxy.h
@@ -10,7 +10,7 @@
 
 #include "base/macros.h"
 #include "content/common/input/input_event_ack_state.h"
-#include "content/renderer/android/synchronous_compositor_output_surface.h"
+#include "content/renderer/android/synchronous_compositor_frame_sink.h"
 #include "ui/events/blink/synchronous_input_handler_proxy.h"
 #include "ui/gfx/geometry/scroll_offset.h"
 #include "ui/gfx/geometry/size_f.h"
@@ -32,15 +32,14 @@
 
 namespace content {
 
-class SynchronousCompositorOutputSurface;
+class SynchronousCompositorFrameSink;
 struct SyncCompositorCommonRendererParams;
 struct SyncCompositorDemandDrawHwParams;
 struct SyncCompositorDemandDrawSwParams;
 struct SyncCompositorSetSharedMemoryParams;
 
-class SynchronousCompositorProxy
-    : public ui::SynchronousInputHandler,
-      public SynchronousCompositorOutputSurfaceClient {
+class SynchronousCompositorProxy : public ui::SynchronousInputHandler,
+                                   public SynchronousCompositorFrameSinkClient {
  public:
   SynchronousCompositorProxy(
       int routing_id,
@@ -57,13 +56,14 @@
                             float min_page_scale_factor,
                             float max_page_scale_factor) override;
 
-  // SynchronousCompositorOutputSurfaceClient overrides.
+  // SynchronousCompositorFrameSinkClient overrides.
   void DidActivatePendingTree() override;
   void Invalidate() override;
-  void SwapBuffers(uint32_t output_surface_id,
+  void SwapBuffers(uint32_t compositor_frame_sink_id,
                    cc::CompositorFrame frame) override;
 
-  void SetOutputSurface(SynchronousCompositorOutputSurface* output_surface);
+  void SetCompositorFrameSink(
+      SynchronousCompositorFrameSink* compositor_frame_sink);
   void OnMessageReceived(const IPC::Message& message);
   bool Send(IPC::Message* message);
   void PopulateCommonParams(SyncCompositorCommonRendererParams* params) const;
@@ -89,14 +89,15 @@
       SyncCompositorCommonRendererParams* common_renderer_params);
   void SetScroll(const gfx::ScrollOffset& total_scroll_offset);
 
-  void SwapBuffersHwAsync(uint32_t output_surface_id,
+  void SwapBuffersHwAsync(uint32_t compositor_frame_sink_id,
                           cc::CompositorFrame frame);
-  void SwapBuffersHw(uint32_t output_surface_id, cc::CompositorFrame frame);
+  void SwapBuffersHw(uint32_t compositor_frame_sink_id,
+                     cc::CompositorFrame frame);
   void SendDemandDrawHwReply(cc::CompositorFrame frame,
-                             uint32_t output_surface_id,
+                             uint32_t compositor_frame_sink_id,
                              IPC::Message* reply_message);
   void SendDemandDrawHwReplyAsync(cc::CompositorFrame frame,
-                                  uint32_t output_surface_id);
+                                  uint32_t compositor_frame_sink_id);
   void DoDemandDrawSw(const SyncCompositorDemandDrawSwParams& params);
   void SwapBuffersSw(cc::CompositorFrame frame);
   void SendDemandDrawSwReply(bool success,
@@ -110,7 +111,7 @@
   IPC::Sender* const sender_;
   ui::SynchronousInputHandlerProxy* const input_handler_proxy_;
   const bool use_in_process_zero_copy_software_draw_;
-  SynchronousCompositorOutputSurface* output_surface_;
+  SynchronousCompositorFrameSink* compositor_frame_sink_;
   bool inside_receive_;
   IPC::Message* hardware_draw_reply_;
   IPC::Message* software_draw_reply_;
diff --git a/content/renderer/android/synchronous_compositor_registry.h b/content/renderer/android/synchronous_compositor_registry.h
index 11ba68bd..52995bc 100644
--- a/content/renderer/android/synchronous_compositor_registry.h
+++ b/content/renderer/android/synchronous_compositor_registry.h
@@ -7,17 +7,16 @@
 
 
 namespace content {
-
-class SynchronousCompositorOutputSurface;
+class SynchronousCompositorFrameSink;
 
 class SynchronousCompositorRegistry {
  public:
-  virtual void RegisterOutputSurface(
+  virtual void RegisterCompositorFrameSink(
       int routing_id,
-      SynchronousCompositorOutputSurface* output_surface) = 0;
-  virtual void UnregisterOutputSurface(
+      SynchronousCompositorFrameSink* compositor_frame_sink) = 0;
+  virtual void UnregisterCompositorFrameSink(
       int routing_id,
-      SynchronousCompositorOutputSurface* output_surface) = 0;
+      SynchronousCompositorFrameSink* compositor_frame_sink) = 0;
 
  protected:
   virtual ~SynchronousCompositorRegistry() {}
diff --git a/content/renderer/gpu/compositor_output_surface.h b/content/renderer/gpu/compositor_output_surface.h
deleted file mode 100644
index d7f8da26..0000000
--- a/content/renderer/gpu/compositor_output_surface.h
+++ /dev/null
@@ -1,108 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CONTENT_RENDERER_GPU_COMPOSITOR_OUTPUT_SURFACE_H_
-#define CONTENT_RENDERER_GPU_COMPOSITOR_OUTPUT_SURFACE_H_
-
-#include <stdint.h>
-
-#include <memory>
-
-#include "base/compiler_specific.h"
-#include "base/macros.h"
-#include "base/memory/ref_counted.h"
-#include "base/memory/weak_ptr.h"
-#include "base/threading/non_thread_safe.h"
-#include "base/threading/platform_thread.h"
-#include "base/time/time.h"
-#include "build/build_config.h"
-#include "cc/output/begin_frame_args.h"
-#include "cc/output/output_surface.h"
-#include "cc/scheduler/begin_frame_source.h"
-#include "content/renderer/gpu/compositor_forwarding_message_filter.h"
-#include "ipc/ipc_sync_message_filter.h"
-
-namespace IPC {
-class Message;
-}
-
-namespace cc {
-class CompositorFrame;
-class CompositorFrameAck;
-class ContextProvider;
-}
-
-namespace content {
-class FrameSwapMessageQueue;
-
-// This class can be created only on the main thread, but then becomes pinned
-// to a fixed thread when BindToClient is called.
-class CompositorOutputSurface
-    : NON_EXPORTED_BASE(public cc::OutputSurface),
-      NON_EXPORTED_BASE(public base::NonThreadSafe) {
- public:
-  CompositorOutputSurface(
-      int32_t routing_id,
-      uint32_t output_surface_id,
-      std::unique_ptr<cc::BeginFrameSource> begin_frame_source,
-      scoped_refptr<cc::ContextProvider> context_provider,
-      scoped_refptr<cc::ContextProvider> worker_context_provider,
-      scoped_refptr<FrameSwapMessageQueue> swap_frame_message_queue);
-  CompositorOutputSurface(
-      int32_t routing_id,
-      uint32_t output_surface_id,
-      std::unique_ptr<cc::BeginFrameSource> begin_frame_source,
-      scoped_refptr<cc::VulkanContextProvider> vulkan_context_provider,
-      scoped_refptr<FrameSwapMessageQueue> swap_frame_message_queue);
-  ~CompositorOutputSurface() override;
-
-  // cc::OutputSurface implementation.
-  bool BindToClient(cc::OutputSurfaceClient* client) override;
-  void DetachFromClient() override;
-  void SwapBuffers(cc::CompositorFrame frame) override;
-  void BindFramebuffer() override;
-  uint32_t GetFramebufferCopyTextureFormat() override;
-
- protected:
-  uint32_t output_surface_id_;
-
- private:
-  class CompositorOutputSurfaceProxy :
-      public base::RefCountedThreadSafe<CompositorOutputSurfaceProxy> {
-   public:
-    explicit CompositorOutputSurfaceProxy(
-        CompositorOutputSurface* output_surface)
-        : output_surface_(output_surface) {}
-    void ClearOutputSurface() { output_surface_ = NULL; }
-    void OnMessageReceived(const IPC::Message& message) {
-      if (output_surface_)
-        output_surface_->OnMessageReceived(message);
-    }
-
-   private:
-    friend class base::RefCountedThreadSafe<CompositorOutputSurfaceProxy>;
-    ~CompositorOutputSurfaceProxy() {}
-    CompositorOutputSurface* output_surface_;
-
-    DISALLOW_COPY_AND_ASSIGN(CompositorOutputSurfaceProxy);
-  };
-
-  void OnMessageReceived(const IPC::Message& message);
-  void OnReclaimCompositorResources(uint32_t output_surface_id,
-                                    bool is_swap_ack,
-                                    const cc::ReturnedResourceArray& resources);
-  bool Send(IPC::Message* message);
-
-  scoped_refptr<CompositorForwardingMessageFilter> output_surface_filter_;
-  CompositorForwardingMessageFilter::Handler output_surface_filter_handler_;
-  scoped_refptr<CompositorOutputSurfaceProxy> output_surface_proxy_;
-  scoped_refptr<IPC::SyncMessageFilter> message_sender_;
-  scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue_;
-  std::unique_ptr<cc::BeginFrameSource> begin_frame_source_;
-  int routing_id_;
-};
-
-}  // namespace content
-
-#endif  // CONTENT_RENDERER_GPU_COMPOSITOR_OUTPUT_SURFACE_H_
diff --git a/content/renderer/gpu/render_widget_compositor.cc b/content/renderer/gpu/render_widget_compositor.cc
index 10b9ed5..8f5c7320 100644
--- a/content/renderer/gpu/render_widget_compositor.cc
+++ b/content/renderer/gpu/render_widget_compositor.cc
@@ -242,7 +242,7 @@
   params.main_task_runner =
       compositor_deps_->GetCompositorMainThreadTaskRunner();
   params.animation_host = cc::AnimationHost::CreateMainInstance();
-  DCHECK(settings.use_output_surface_begin_frame_source);
+  DCHECK(settings.use_compositor_frame_sink_begin_frame_source);
 
   if (cmd->HasSwitch(switches::kUseRemoteCompositing)) {
     DCHECK(!threaded_);
@@ -1026,42 +1026,44 @@
                                  top_controls_delta);
 }
 
-void RenderWidgetCompositor::RequestNewOutputSurface() {
+void RenderWidgetCompositor::RequestNewCompositorFrameSink() {
   // If the host is closing, then no more compositing is possible.  This
   // prevents shutdown races between handling the close message and
-  // the CreateOutputSurface task.
+  // the CreateCompositorFrameSink task.
   if (delegate_->IsClosing())
     return;
 
-  bool fallback =
-      num_failed_recreate_attempts_ >= OUTPUT_SURFACE_RETRIES_BEFORE_FALLBACK;
-  std::unique_ptr<cc::OutputSurface> surface(
-      delegate_->CreateOutputSurface(fallback));
+  bool fallback = num_failed_recreate_attempts_ >=
+                  COMPOSITOR_FRAME_SINK_RETRIES_BEFORE_FALLBACK;
+  std::unique_ptr<cc::CompositorFrameSink> surface(
+      delegate_->CreateCompositorFrameSink(fallback));
 
   if (!surface) {
-    DidFailToInitializeOutputSurface();
+    DidFailToInitializeCompositorFrameSink();
     return;
   }
 
   DCHECK_EQ(surface->capabilities().max_frames_pending, 1);
 
-  layer_tree_host_->SetOutputSurface(std::move(surface));
+  layer_tree_host_->SetCompositorFrameSink(std::move(surface));
 }
 
-void RenderWidgetCompositor::DidInitializeOutputSurface() {
+void RenderWidgetCompositor::DidInitializeCompositorFrameSink() {
   num_failed_recreate_attempts_ = 0;
 }
 
-void RenderWidgetCompositor::DidFailToInitializeOutputSurface() {
+void RenderWidgetCompositor::DidFailToInitializeCompositorFrameSink() {
   ++num_failed_recreate_attempts_;
   // Tolerate a certain number of recreation failures to work around races
   // in the output-surface-lost machinery.
-  LOG_IF(FATAL, (num_failed_recreate_attempts_ >= MAX_OUTPUT_SURFACE_RETRIES))
-      << "Failed to create a fallback OutputSurface.";
+  LOG_IF(FATAL,
+         (num_failed_recreate_attempts_ >= MAX_COMPOSITOR_FRAME_SINK_RETRIES))
+      << "Failed to create a fallback CompositorFrameSink.";
 
   base::ThreadTaskRunnerHandle::Get()->PostTask(
-      FROM_HERE, base::Bind(&RenderWidgetCompositor::RequestNewOutputSurface,
-                            weak_factory_.GetWeakPtr()));
+      FROM_HERE,
+      base::Bind(&RenderWidgetCompositor::RequestNewCompositorFrameSink,
+                 weak_factory_.GetWeakPtr()));
 }
 
 void RenderWidgetCompositor::WillCommit() {
diff --git a/content/renderer/gpu/render_widget_compositor.h b/content/renderer/gpu/render_widget_compositor.h
index 9edc508..6cb9f7a 100644
--- a/content/renderer/gpu/render_widget_compositor.h
+++ b/content/renderer/gpu/render_widget_compositor.h
@@ -181,9 +181,9 @@
                            const gfx::Vector2dF& elastic_overscroll_delta,
                            float page_scale,
                            float top_controls_delta) override;
-  void RequestNewOutputSurface() override;
-  void DidInitializeOutputSurface() override;
-  void DidFailToInitializeOutputSurface() override;
+  void RequestNewCompositorFrameSink() override;
+  void DidInitializeCompositorFrameSink() override;
+  void DidFailToInitializeCompositorFrameSink() override;
   void WillCommit() override;
   void DidCommit() override;
   void DidCommitAndDrawFrame() override;
@@ -200,8 +200,8 @@
   void SendCompositorProto(const cc::proto::CompositorMessage& proto) override;
 
   enum {
-    OUTPUT_SURFACE_RETRIES_BEFORE_FALLBACK = 4,
-    MAX_OUTPUT_SURFACE_RETRIES = 5,
+    COMPOSITOR_FRAME_SINK_RETRIES_BEFORE_FALLBACK = 4,
+    MAX_COMPOSITOR_FRAME_SINK_RETRIES = 5,
   };
 
  protected:
diff --git a/content/renderer/gpu/render_widget_compositor_delegate.h b/content/renderer/gpu/render_widget_compositor_delegate.h
index ad8824e..93fc8fb3 100644
--- a/content/renderer/gpu/render_widget_compositor_delegate.h
+++ b/content/renderer/gpu/render_widget_compositor_delegate.h
@@ -17,7 +17,7 @@
 namespace cc {
 class BeginFrameSource;
 class CopyOutputRequest;
-class OutputSurface;
+class CompositorFrameSink;
 class SwapPromise;
 }
 
@@ -43,8 +43,8 @@
   // Notifies that the compositor has issed a BeginMainFrame.
   virtual void BeginMainFrame(double frame_time_sec) = 0;
 
-  // Requests an OutputSurface to render into.
-  virtual std::unique_ptr<cc::OutputSurface> CreateOutputSurface(
+  // Requests a CompositorFrameSink to submit to.
+  virtual std::unique_ptr<cc::CompositorFrameSink> CreateCompositorFrameSink(
       bool fallback) = 0;
 
   // Notifies that the draw commands for a committed frame have been issued.
diff --git a/content/renderer/gpu/render_widget_compositor_unittest.cc b/content/renderer/gpu/render_widget_compositor_unittest.cc
index d09dd86..0523e77 100644
--- a/content/renderer/gpu/render_widget_compositor_unittest.cc
+++ b/content/renderer/gpu/render_widget_compositor_unittest.cc
@@ -14,9 +14,10 @@
 #include "base/threading/thread_task_runner_handle.h"
 #include "cc/output/begin_frame_args.h"
 #include "cc/output/copy_output_request.h"
+#include "cc/test/fake_compositor_frame_sink.h"
 #include "cc/test/fake_external_begin_frame_source.h"
-#include "cc/test/fake_output_surface.h"
 #include "cc/test/test_context_provider.h"
+#include "cc/test/test_web_graphics_context_3d.h"
 #include "cc/trees/layer_tree_host.h"
 #include "content/public/test/mock_render_thread.h"
 #include "content/renderer/render_widget.h"
@@ -41,7 +42,7 @@
                            float page_scale,
                            float top_controls_delta) override {}
   void BeginMainFrame(double frame_time_sec) override {}
-  std::unique_ptr<cc::OutputSurface> CreateOutputSurface(
+  std::unique_ptr<cc::CompositorFrameSink> CreateCompositorFrameSink(
       bool fallback) override {
     return nullptr;
   }
@@ -68,16 +69,16 @@
  public:
   FakeRenderWidgetCompositorDelegate() = default;
 
-  std::unique_ptr<cc::OutputSurface> CreateOutputSurface(
+  std::unique_ptr<cc::CompositorFrameSink> CreateCompositorFrameSink(
       bool fallback) override {
-    EXPECT_EQ(
-        num_requests_since_last_success_ >
-            RenderWidgetCompositor::OUTPUT_SURFACE_RETRIES_BEFORE_FALLBACK,
-        fallback);
+    EXPECT_EQ(num_requests_since_last_success_ >
+                  RenderWidgetCompositor::
+                      COMPOSITOR_FRAME_SINK_RETRIES_BEFORE_FALLBACK,
+              fallback);
     last_create_was_fallback_ = fallback;
 
     bool success = num_failures_ >= num_failures_before_success_;
-    if (!success && use_null_output_surface_)
+    if (!success && use_null_compositor_frame_sink_)
       return nullptr;
 
     auto context_provider = cc::TestContextProvider::Create();
@@ -86,9 +87,9 @@
           GL_GUILTY_CONTEXT_RESET_ARB, GL_INNOCENT_CONTEXT_RESET_ARB);
     }
 
-    // Create delegating surface so that max_pending_frames = 1.
-    return cc::FakeOutputSurface::CreateDelegating3d(
-        std::move(context_provider));
+    auto s = cc::FakeCompositorFrameSink::Create3d(std::move(context_provider));
+    EXPECT_EQ(1, s->capabilities().max_frames_pending);
+    return std::move(s);
   }
 
   void add_success() {
@@ -117,8 +118,12 @@
     return num_failures_before_success_;
   }
 
-  void set_use_null_output_surface(bool u) { use_null_output_surface_ = u; }
-  bool use_null_output_surface() const { return use_null_output_surface_; }
+  void set_use_null_compositor_frame_sink(bool u) {
+    use_null_compositor_frame_sink_ = u;
+  }
+  bool use_null_compositor_frame_sink() const {
+    return use_null_compositor_frame_sink_;
+  }
 
  private:
   int num_requests_ = 0;
@@ -128,7 +133,7 @@
   int num_fallback_successes_ = 0;
   int num_successes_ = 0;
   bool last_create_was_fallback_ = false;
-  bool use_null_output_surface_ = true;
+  bool use_null_compositor_frame_sink_ = true;
 
   DISALLOW_COPY_AND_ASSIGN(FakeRenderWidgetCompositorDelegate);
 };
@@ -139,11 +144,10 @@
 // The use null output surface parameter allows testing whether failures
 // from RenderWidget (couldn't create an output surface) vs failures from
 // the compositor (couldn't bind the output surface) are handled identically.
-class RenderWidgetCompositorOutputSurface : public RenderWidgetCompositor {
+class RenderWidgetCompositorFrameSink : public RenderWidgetCompositor {
  public:
-  RenderWidgetCompositorOutputSurface(
-      FakeRenderWidgetCompositorDelegate* delegate,
-      CompositorDependencies* compositor_deps)
+  RenderWidgetCompositorFrameSink(FakeRenderWidgetCompositorDelegate* delegate,
+                                  CompositorDependencies* compositor_deps)
       : RenderWidgetCompositor(delegate, compositor_deps),
         delegate_(delegate) {}
 
@@ -152,41 +156,41 @@
   // Force a new output surface to be created.
   void SynchronousComposite() {
     layer_tree_host()->SetVisible(false);
-    layer_tree_host()->ReleaseOutputSurface();
+    layer_tree_host()->ReleaseCompositorFrameSink();
     layer_tree_host()->SetVisible(true);
 
     base::TimeTicks some_time;
     layer_tree_host()->Composite(some_time);
   }
 
-  void RequestNewOutputSurface() override {
+  void RequestNewCompositorFrameSink() override {
     delegate_->add_request();
-    RenderWidgetCompositor::RequestNewOutputSurface();
+    RenderWidgetCompositor::RequestNewCompositorFrameSink();
   }
 
-  void DidInitializeOutputSurface() override {
+  void DidInitializeCompositorFrameSink() override {
     delegate_->add_success();
     if (delegate_->num_requests() == expected_requests_) {
       EndTest();
     } else {
-      RenderWidgetCompositor::DidInitializeOutputSurface();
+      RenderWidgetCompositor::DidInitializeCompositorFrameSink();
       // Post the synchronous composite task so that it is not called
-      // reentrantly as a part of RequestNewOutputSurface.
+      // reentrantly as a part of RequestNewCompositorFrameSink.
       base::ThreadTaskRunnerHandle::Get()->PostTask(
           FROM_HERE,
-          base::Bind(&RenderWidgetCompositorOutputSurface::SynchronousComposite,
+          base::Bind(&RenderWidgetCompositorFrameSink::SynchronousComposite,
                      base::Unretained(this)));
     }
   }
 
-  void DidFailToInitializeOutputSurface() override {
+  void DidFailToInitializeCompositorFrameSink() override {
     delegate_->add_failure();
     if (delegate_->num_requests() == expected_requests_) {
       EndTest();
       return;
     }
 
-    RenderWidgetCompositor::DidFailToInitializeOutputSurface();
+    RenderWidgetCompositor::DidFailToInitializeCompositorFrameSink();
   }
 
   void SetUp(int expected_successes, int expected_fallback_succeses) {
@@ -213,21 +217,22 @@
   int expected_fallback_successes_ = 0;
   int expected_requests_ = 0;
 
-  DISALLOW_COPY_AND_ASSIGN(RenderWidgetCompositorOutputSurface);
+  DISALLOW_COPY_AND_ASSIGN(RenderWidgetCompositorFrameSink);
 };
 
-class RenderWidgetCompositorOutputSurfaceTest : public testing::Test {
+class RenderWidgetCompositorFrameSinkTest : public testing::Test {
  public:
-  RenderWidgetCompositorOutputSurfaceTest()
+  RenderWidgetCompositorFrameSinkTest()
       : render_widget_compositor_(&compositor_delegate_, &compositor_deps_) {
     render_widget_compositor_.Initialize(1.f /* initial_device_scale_factor */);
   }
 
-  void RunTest(bool use_null_output_surface,
+  void RunTest(bool use_null_compositor_frame_sink,
                int num_failures_before_success,
                int expected_successes,
                int expected_fallback_succeses) {
-    compositor_delegate_.set_use_null_output_surface(use_null_output_surface);
+    compositor_delegate_.set_use_null_compositor_frame_sink(
+        use_null_compositor_frame_sink);
     compositor_delegate_.set_num_failures_before_success(
         num_failures_before_success);
     render_widget_compositor_.SetUp(expected_successes,
@@ -235,7 +240,7 @@
     render_widget_compositor_.setVisible(true);
     base::ThreadTaskRunnerHandle::Get()->PostTask(
         FROM_HERE,
-        base::Bind(&RenderWidgetCompositorOutputSurface::SynchronousComposite,
+        base::Bind(&RenderWidgetCompositorFrameSink::SynchronousComposite,
                    base::Unretained(&render_widget_compositor_)));
     base::RunLoop().Run();
     render_widget_compositor_.AfterTest();
@@ -246,47 +251,52 @@
   MockRenderThread render_thread_;
   FakeCompositorDependencies compositor_deps_;
   FakeRenderWidgetCompositorDelegate compositor_delegate_;
-  RenderWidgetCompositorOutputSurface render_widget_compositor_;
+  RenderWidgetCompositorFrameSink render_widget_compositor_;
 
  private:
-  DISALLOW_COPY_AND_ASSIGN(RenderWidgetCompositorOutputSurfaceTest);
+  DISALLOW_COPY_AND_ASSIGN(RenderWidgetCompositorFrameSinkTest);
 };
 
-TEST_F(RenderWidgetCompositorOutputSurfaceTest, SucceedOnce) {
+TEST_F(RenderWidgetCompositorFrameSinkTest, SucceedOnce) {
   RunTest(false, 0, 1, 0);
 }
 
-TEST_F(RenderWidgetCompositorOutputSurfaceTest, SucceedTwice) {
+TEST_F(RenderWidgetCompositorFrameSinkTest, SucceedTwice) {
   RunTest(false, 0, 2, 0);
 }
 
-TEST_F(RenderWidgetCompositorOutputSurfaceTest, FailOnceNull) {
+TEST_F(RenderWidgetCompositorFrameSinkTest, FailOnceNull) {
   static_assert(
-      RenderWidgetCompositor::OUTPUT_SURFACE_RETRIES_BEFORE_FALLBACK >= 2,
+      RenderWidgetCompositor::COMPOSITOR_FRAME_SINK_RETRIES_BEFORE_FALLBACK >=
+          2,
       "Adjust the values of this test if this fails");
   RunTest(true, 1, 1, 0);
 }
 
-TEST_F(RenderWidgetCompositorOutputSurfaceTest, FailOnceBind) {
+TEST_F(RenderWidgetCompositorFrameSinkTest, FailOnceBind) {
   static_assert(
-      RenderWidgetCompositor::OUTPUT_SURFACE_RETRIES_BEFORE_FALLBACK >= 2,
+      RenderWidgetCompositor::COMPOSITOR_FRAME_SINK_RETRIES_BEFORE_FALLBACK >=
+          2,
       "Adjust the values of this test if this fails");
   RunTest(false, 1, 1, 0);
 }
 
-TEST_F(RenderWidgetCompositorOutputSurfaceTest, FallbackSuccessNull) {
-  RunTest(true, RenderWidgetCompositor::OUTPUT_SURFACE_RETRIES_BEFORE_FALLBACK,
+TEST_F(RenderWidgetCompositorFrameSinkTest, FallbackSuccessNull) {
+  RunTest(true,
+          RenderWidgetCompositor::COMPOSITOR_FRAME_SINK_RETRIES_BEFORE_FALLBACK,
           0, 1);
 }
 
-TEST_F(RenderWidgetCompositorOutputSurfaceTest, FallbackSuccessBind) {
-  RunTest(false, RenderWidgetCompositor::OUTPUT_SURFACE_RETRIES_BEFORE_FALLBACK,
+TEST_F(RenderWidgetCompositorFrameSinkTest, FallbackSuccessBind) {
+  RunTest(false,
+          RenderWidgetCompositor::COMPOSITOR_FRAME_SINK_RETRIES_BEFORE_FALLBACK,
           0, 1);
 }
 
-TEST_F(RenderWidgetCompositorOutputSurfaceTest, FallbackSuccessNormalSuccess) {
+TEST_F(RenderWidgetCompositorFrameSinkTest, FallbackSuccessNormalSuccess) {
   // The first success is a fallback, but the next should not be a fallback.
-  RunTest(false, RenderWidgetCompositor::OUTPUT_SURFACE_RETRIES_BEFORE_FALLBACK,
+  RunTest(false,
+          RenderWidgetCompositor::COMPOSITOR_FRAME_SINK_RETRIES_BEFORE_FALLBACK,
           1, 1);
 }
 
diff --git a/content/renderer/gpu/compositor_output_surface.cc b/content/renderer/gpu/renderer_compositor_frame_sink.cc
similarity index 61%
rename from content/renderer/gpu/compositor_output_surface.cc
rename to content/renderer/gpu/renderer_compositor_frame_sink.cc
index bc5ec318..4cfbdfc 100644
--- a/content/renderer/gpu/compositor_output_surface.cc
+++ b/content/renderer/gpu/renderer_compositor_frame_sink.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/renderer/gpu/compositor_output_surface.h"
+#include "content/renderer/gpu/renderer_compositor_frame_sink.h"
 
 #include <utility>
 
@@ -12,8 +12,8 @@
 #include "base/threading/thread_task_runner_handle.h"
 #include "build/build_config.h"
 #include "cc/output/compositor_frame.h"
+#include "cc/output/compositor_frame_sink_client.h"
 #include "cc/output/managed_memory_policy.h"
-#include "cc/output/output_surface_client.h"
 #include "content/common/gpu/client/context_provider_command_buffer.h"
 #include "content/common/view_messages.h"
 #include "content/public/common/content_switches.h"
@@ -26,88 +26,87 @@
 
 namespace content {
 
-CompositorOutputSurface::CompositorOutputSurface(
+RendererCompositorFrameSink::RendererCompositorFrameSink(
     int32_t routing_id,
-    uint32_t output_surface_id,
+    uint32_t compositor_frame_sink_id,
     std::unique_ptr<cc::BeginFrameSource> begin_frame_source,
     scoped_refptr<cc::ContextProvider> context_provider,
     scoped_refptr<cc::ContextProvider> worker_context_provider,
     scoped_refptr<FrameSwapMessageQueue> swap_frame_message_queue)
-    : OutputSurface(std::move(context_provider),
-                    std::move(worker_context_provider),
-                    nullptr),
-      output_surface_id_(output_surface_id),
-      output_surface_filter_(
+    : CompositorFrameSink(std::move(context_provider),
+                          std::move(worker_context_provider),
+                          nullptr),
+      compositor_frame_sink_id_(compositor_frame_sink_id),
+      compositor_frame_sink_filter_(
           RenderThreadImpl::current()->compositor_message_filter()),
       message_sender_(RenderThreadImpl::current()->sync_message_filter()),
       frame_swap_message_queue_(swap_frame_message_queue),
       begin_frame_source_(std::move(begin_frame_source)),
       routing_id_(routing_id) {
-  DCHECK(output_surface_filter_);
+  DCHECK(compositor_frame_sink_filter_);
   DCHECK(frame_swap_message_queue_);
   DCHECK(message_sender_);
   DCHECK(begin_frame_source_);
   capabilities_.delegated_rendering = true;
 }
 
-CompositorOutputSurface::CompositorOutputSurface(
+RendererCompositorFrameSink::RendererCompositorFrameSink(
     int32_t routing_id,
-    uint32_t output_surface_id,
+    uint32_t compositor_frame_sink_id,
     std::unique_ptr<cc::BeginFrameSource> begin_frame_source,
     scoped_refptr<cc::VulkanContextProvider> vulkan_context_provider,
     scoped_refptr<FrameSwapMessageQueue> swap_frame_message_queue)
-    : OutputSurface(std::move(vulkan_context_provider)),
-      output_surface_id_(output_surface_id),
-      output_surface_filter_(
+    : CompositorFrameSink(std::move(vulkan_context_provider)),
+      compositor_frame_sink_id_(compositor_frame_sink_id),
+      compositor_frame_sink_filter_(
           RenderThreadImpl::current()->compositor_message_filter()),
       message_sender_(RenderThreadImpl::current()->sync_message_filter()),
       frame_swap_message_queue_(swap_frame_message_queue),
       begin_frame_source_(std::move(begin_frame_source)),
       routing_id_(routing_id) {
-  DCHECK(output_surface_filter_);
+  DCHECK(compositor_frame_sink_filter_);
   DCHECK(frame_swap_message_queue_);
   DCHECK(message_sender_);
   DCHECK(begin_frame_source_);
   capabilities_.delegated_rendering = true;
 }
 
-CompositorOutputSurface::~CompositorOutputSurface() = default;
+RendererCompositorFrameSink::~RendererCompositorFrameSink() = default;
 
-bool CompositorOutputSurface::BindToClient(
-    cc::OutputSurfaceClient* client) {
-  if (!cc::OutputSurface::BindToClient(client))
+bool RendererCompositorFrameSink::BindToClient(
+    cc::CompositorFrameSinkClient* client) {
+  if (!cc::CompositorFrameSink::BindToClient(client))
     return false;
 
   DCHECK(begin_frame_source_);
   client_->SetBeginFrameSource(begin_frame_source_.get());
 
-  output_surface_proxy_ = new CompositorOutputSurfaceProxy(this);
-  output_surface_filter_handler_ =
-      base::Bind(&CompositorOutputSurfaceProxy::OnMessageReceived,
-                 output_surface_proxy_);
-  output_surface_filter_->AddHandlerOnCompositorThread(
-                              routing_id_,
-                              output_surface_filter_handler_);
+  compositor_frame_sink_proxy_ = new RendererCompositorFrameSinkProxy(this);
+  compositor_frame_sink_filter_handler_ =
+      base::Bind(&RendererCompositorFrameSinkProxy::OnMessageReceived,
+                 compositor_frame_sink_proxy_);
+  compositor_frame_sink_filter_->AddHandlerOnCompositorThread(
+      routing_id_, compositor_frame_sink_filter_handler_);
   return true;
 }
 
-void CompositorOutputSurface::DetachFromClient() {
+void RendererCompositorFrameSink::DetachFromClient() {
   if (!HasClient())
     return;
   client_->SetBeginFrameSource(nullptr);
   // Destroy the begin frame source on the same thread it was bound on.
-  // The OutputSurface itself is destroyed on the main thread.
+  // The CompositorFrameSink itself is destroyed on the main thread.
   begin_frame_source_ = nullptr;
 
-  if (output_surface_proxy_) {
-    output_surface_proxy_->ClearOutputSurface();
-    output_surface_filter_->RemoveHandlerOnCompositorThread(
-        routing_id_, output_surface_filter_handler_);
+  if (compositor_frame_sink_proxy_) {
+    compositor_frame_sink_proxy_->ClearCompositorFrameSink();
+    compositor_frame_sink_filter_->RemoveHandlerOnCompositorThread(
+        routing_id_, compositor_frame_sink_filter_handler_);
   }
-  cc::OutputSurface::DetachFromClient();
+  cc::CompositorFrameSink::DetachFromClient();
 }
 
-void CompositorOutputSurface::SwapBuffers(cc::CompositorFrame frame) {
+void RendererCompositorFrameSink::SwapBuffers(cc::CompositorFrame frame) {
   {
     std::unique_ptr<FrameSwapMessageQueue::SendMessageScope>
         send_message_scope =
@@ -117,48 +116,49 @@
     frame_swap_message_queue_->DrainMessages(&messages);
     FrameSwapMessageQueue::TransferMessages(&messages,
                                             &messages_to_deliver_with_frame);
-    Send(new ViewHostMsg_SwapCompositorFrame(routing_id_, output_surface_id_,
-                                             frame,
+    Send(new ViewHostMsg_SwapCompositorFrame(routing_id_,
+                                             compositor_frame_sink_id_, frame,
                                              messages_to_deliver_with_frame));
     // ~send_message_scope.
   }
 }
 
-void CompositorOutputSurface::BindFramebuffer() {
+void RendererCompositorFrameSink::BindFramebuffer() {
   // This is a delegating output surface, no framebuffer/direct drawing support.
   NOTREACHED();
 }
 
-uint32_t CompositorOutputSurface::GetFramebufferCopyTextureFormat() {
+uint32_t RendererCompositorFrameSink::GetFramebufferCopyTextureFormat() {
   // This is a delegating output surface, no framebuffer/direct drawing support.
   NOTREACHED();
   return 0;
 }
 
-void CompositorOutputSurface::OnMessageReceived(const IPC::Message& message) {
+void RendererCompositorFrameSink::OnMessageReceived(
+    const IPC::Message& message) {
   DCHECK(client_thread_checker_.CalledOnValidThread());
   if (!HasClient())
     return;
-  IPC_BEGIN_MESSAGE_MAP(CompositorOutputSurface, message)
+  IPC_BEGIN_MESSAGE_MAP(RendererCompositorFrameSink, message)
     IPC_MESSAGE_HANDLER(ViewMsg_ReclaimCompositorResources,
                         OnReclaimCompositorResources);
   IPC_END_MESSAGE_MAP()
 }
 
-void CompositorOutputSurface::OnReclaimCompositorResources(
-    uint32_t output_surface_id,
+void RendererCompositorFrameSink::OnReclaimCompositorResources(
+    uint32_t compositor_frame_sink_id,
     bool is_swap_ack,
     const cc::ReturnedResourceArray& resources) {
   // Ignore message if it's a stale one coming from a different output surface
   // (e.g. after a lost context).
-  if (output_surface_id != output_surface_id_)
+  if (compositor_frame_sink_id != compositor_frame_sink_id_)
     return;
   client_->ReclaimResources(resources);
   if (is_swap_ack)
     client_->DidSwapBuffersComplete();
 }
 
-bool CompositorOutputSurface::Send(IPC::Message* message) {
+bool RendererCompositorFrameSink::Send(IPC::Message* message) {
   return message_sender_->Send(message);
 }
 
diff --git a/content/renderer/gpu/renderer_compositor_frame_sink.h b/content/renderer/gpu/renderer_compositor_frame_sink.h
new file mode 100644
index 0000000..b8efacc9
--- /dev/null
+++ b/content/renderer/gpu/renderer_compositor_frame_sink.h
@@ -0,0 +1,111 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_RENDERER_GPU_RENDERER_COMPOSITOR_FRAME_SINK_H_
+#define CONTENT_RENDERER_GPU_RENDERER_COMPOSITOR_FRAME_SINK_H_
+
+#include <stdint.h>
+
+#include <memory>
+
+#include "base/compiler_specific.h"
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
+#include "base/threading/non_thread_safe.h"
+#include "base/threading/platform_thread.h"
+#include "base/time/time.h"
+#include "build/build_config.h"
+#include "cc/output/begin_frame_args.h"
+#include "cc/output/compositor_frame_sink.h"
+#include "cc/scheduler/begin_frame_source.h"
+#include "content/renderer/gpu/compositor_forwarding_message_filter.h"
+#include "ipc/ipc_sync_message_filter.h"
+
+namespace IPC {
+class Message;
+}
+
+namespace cc {
+class BeginFrameSource;
+class CompositorFrame;
+class CompositorFrameAck;
+class ContextProvider;
+}
+
+namespace content {
+class FrameSwapMessageQueue;
+
+// This class can be created only on the main thread, but then becomes pinned
+// to a fixed thread when BindToClient is called.
+class RendererCompositorFrameSink
+    : NON_EXPORTED_BASE(public cc::CompositorFrameSink),
+      NON_EXPORTED_BASE(public base::NonThreadSafe) {
+ public:
+  RendererCompositorFrameSink(
+      int32_t routing_id,
+      uint32_t compositor_frame_sink_id,
+      std::unique_ptr<cc::BeginFrameSource> begin_frame_source,
+      scoped_refptr<cc::ContextProvider> context_provider,
+      scoped_refptr<cc::ContextProvider> worker_context_provider,
+      scoped_refptr<FrameSwapMessageQueue> swap_frame_message_queue);
+  RendererCompositorFrameSink(
+      int32_t routing_id,
+      uint32_t compositor_frame_sink_id,
+      std::unique_ptr<cc::BeginFrameSource> begin_frame_source,
+      scoped_refptr<cc::VulkanContextProvider> vulkan_context_provider,
+      scoped_refptr<FrameSwapMessageQueue> swap_frame_message_queue);
+  ~RendererCompositorFrameSink() override;
+
+  // cc::CompositorFrameSink implementation.
+  bool BindToClient(cc::CompositorFrameSinkClient* client) override;
+  void DetachFromClient() override;
+  void SwapBuffers(cc::CompositorFrame frame) override;
+  void BindFramebuffer() override;
+  uint32_t GetFramebufferCopyTextureFormat() override;
+
+ protected:
+  uint32_t compositor_frame_sink_id_;
+
+ private:
+  class RendererCompositorFrameSinkProxy
+      : public base::RefCountedThreadSafe<RendererCompositorFrameSinkProxy> {
+   public:
+    explicit RendererCompositorFrameSinkProxy(
+        RendererCompositorFrameSink* compositor_frame_sink)
+        : compositor_frame_sink_(compositor_frame_sink) {}
+    void ClearCompositorFrameSink() { compositor_frame_sink_ = NULL; }
+    void OnMessageReceived(const IPC::Message& message) {
+      if (compositor_frame_sink_)
+        compositor_frame_sink_->OnMessageReceived(message);
+    }
+
+   private:
+    friend class base::RefCountedThreadSafe<RendererCompositorFrameSinkProxy>;
+    ~RendererCompositorFrameSinkProxy() {}
+    RendererCompositorFrameSink* compositor_frame_sink_;
+
+    DISALLOW_COPY_AND_ASSIGN(RendererCompositorFrameSinkProxy);
+  };
+
+  void OnMessageReceived(const IPC::Message& message);
+  void OnReclaimCompositorResources(uint32_t compositor_frame_sink_id,
+                                    bool is_swap_ack,
+                                    const cc::ReturnedResourceArray& resources);
+  bool Send(IPC::Message* message);
+
+  scoped_refptr<CompositorForwardingMessageFilter>
+      compositor_frame_sink_filter_;
+  CompositorForwardingMessageFilter::Handler
+      compositor_frame_sink_filter_handler_;
+  scoped_refptr<RendererCompositorFrameSinkProxy> compositor_frame_sink_proxy_;
+  scoped_refptr<IPC::SyncMessageFilter> message_sender_;
+  scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue_;
+  std::unique_ptr<cc::BeginFrameSource> begin_frame_source_;
+  int routing_id_;
+};
+
+}  // namespace content
+
+#endif  // CONTENT_RENDERER_GPU_RENDERER_COMPOSITOR_FRAME_SINK_H_
diff --git a/content/renderer/layout_test_dependencies.h b/content/renderer/layout_test_dependencies.h
index f9f4270a..52941a5 100644
--- a/content/renderer/layout_test_dependencies.h
+++ b/content/renderer/layout_test_dependencies.h
@@ -13,7 +13,7 @@
 namespace cc {
 class ContextProvider;
 class CopyOutputRequest;
-class OutputSurface;
+class CompositorFrameSink;
 class SwapPromise;
 }
 
@@ -28,7 +28,7 @@
 // RenderThreadImpl.
 class LayoutTestDependencies {
  public:
-  virtual std::unique_ptr<cc::OutputSurface> CreateOutputSurface(
+  virtual std::unique_ptr<cc::CompositorFrameSink> CreateCompositorFrameSink(
       int32_t routing_id,
       scoped_refptr<gpu::GpuChannelHost> gpu_channel,
       scoped_refptr<cc::ContextProvider> compositor_context_provider,
diff --git a/content/renderer/mus/render_widget_mus_connection.cc b/content/renderer/mus/render_widget_mus_connection.cc
index 9392f310..8f9599b 100644
--- a/content/renderer/mus/render_widget_mus_connection.cc
+++ b/content/renderer/mus/render_widget_mus_connection.cc
@@ -11,7 +11,7 @@
 #include "content/renderer/mus/compositor_mus_connection.h"
 #include "content/renderer/render_thread_impl.h"
 #include "content/renderer/render_view_impl.h"
-#include "services/ui/public/cpp/output_surface.h"
+#include "services/ui/public/cpp/compositor_frame_sink.h"
 #include "services/ui/public/interfaces/surface.mojom.h"
 #include "services/ui/public/interfaces/window_tree.mojom.h"
 
@@ -38,13 +38,13 @@
   }
 }
 
-std::unique_ptr<cc::OutputSurface>
-RenderWidgetMusConnection::CreateOutputSurface(
+std::unique_ptr<cc::CompositorFrameSink>
+RenderWidgetMusConnection::CreateCompositorFrameSink(
     scoped_refptr<gpu::GpuChannelHost> gpu_channel_host) {
   DCHECK(thread_checker_.CalledOnValidThread());
   DCHECK(!window_surface_binding_);
 
-  std::unique_ptr<cc::OutputSurface> surface(new ui::OutputSurface(
+  std::unique_ptr<cc::CompositorFrameSink> surface(new ui::CompositorFrameSink(
       std::move(gpu_channel_host),
       ui::WindowSurface::Create(&window_surface_binding_)));
   if (compositor_mus_connection_) {
diff --git a/content/renderer/mus/render_widget_mus_connection.h b/content/renderer/mus/render_widget_mus_connection.h
index 2f52150e..80a3526 100644
--- a/content/renderer/mus/render_widget_mus_connection.h
+++ b/content/renderer/mus/render_widget_mus_connection.h
@@ -7,7 +7,7 @@
 
 #include "base/macros.h"
 #include "base/threading/thread_checker.h"
-#include "cc/output/output_surface.h"
+#include "cc/output/compositor_frame_sink.h"
 #include "content/common/content_export.h"
 #include "content/renderer/input/render_widget_input_handler_delegate.h"
 #include "content/renderer/mus/compositor_mus_connection.h"
@@ -29,7 +29,7 @@
   void Bind(mojo::InterfaceRequest<ui::mojom::WindowTreeClient> request);
 
   // Create a cc output surface.
-  std::unique_ptr<cc::OutputSurface> CreateOutputSurface(
+  std::unique_ptr<cc::CompositorFrameSink> CreateCompositorFrameSink(
       scoped_refptr<gpu::GpuChannelHost> gpu_channel_host);
 
   static RenderWidgetMusConnection* Get(int routing_id);
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index 7ba501e..957e6ac 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -39,8 +39,8 @@
 #include "cc/base/switches.h"
 #include "cc/blink/web_layer_impl.h"
 #include "cc/output/buffer_to_texture_target_map.h"
+#include "cc/output/compositor_frame_sink.h"
 #include "cc/output/copy_output_request.h"
-#include "cc/output/output_surface.h"
 #include "cc/output/vulkan_in_process_context_provider.h"
 #include "cc/raster/task_graph_runner.h"
 #include "cc/trees/layer_tree_host_common.h"
@@ -95,8 +95,8 @@
 #include "content/renderer/dom_storage/webstoragenamespace_impl.h"
 #include "content/renderer/gpu/compositor_external_begin_frame_source.h"
 #include "content/renderer/gpu/compositor_forwarding_message_filter.h"
-#include "content/renderer/gpu/compositor_output_surface.h"
 #include "content/renderer/gpu/frame_swap_message_queue.h"
+#include "content/renderer/gpu/renderer_compositor_frame_sink.h"
 #include "content/renderer/input/input_event_filter.h"
 #include "content/renderer/input/input_handler_manager.h"
 #include "content/renderer/input/main_thread_input_event_filter.h"
@@ -165,7 +165,7 @@
 #if defined(OS_ANDROID)
 #include <cpu-features.h>
 #include "content/renderer/android/synchronous_compositor_filter.h"
-#include "content/renderer/android/synchronous_compositor_output_surface.h"
+#include "content/renderer/android/synchronous_compositor_frame_sink.h"
 #include "content/renderer/media/android/renderer_demuxer_android.h"
 #include "content/renderer/media/android/stream_texture_factory.h"
 #include "media/base/android/media_codec_util.h"
@@ -243,7 +243,7 @@
 const size_t kImageCacheSingleAllocationByteLimit = 64 * 1024 * 1024;
 
 // Unique identifier for each output surface created.
-uint32_t g_next_output_surface_id = 1;
+uint32_t g_next_compositor_frame_sink_id = 1;
 
 // Keep the global RenderThreadImpl in a TLS slot so it is impossible to access
 // incorrectly from the wrong thread.
@@ -1798,8 +1798,8 @@
   return gpu_channel_;
 }
 
-std::unique_ptr<cc::OutputSurface>
-RenderThreadImpl::CreateCompositorOutputSurface(
+std::unique_ptr<cc::CompositorFrameSink>
+RenderThreadImpl::CreateCompositorFrameSink(
     bool use_software,
     int routing_id,
     scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue,
@@ -1816,19 +1816,19 @@
         RenderWidgetMusConnection::GetOrCreate(routing_id);
     scoped_refptr<gpu::GpuChannelHost> gpu_channel_host =
         EstablishGpuChannelSync();
-    return connection->CreateOutputSurface(std::move(gpu_channel_host));
+    return connection->CreateCompositorFrameSink(std::move(gpu_channel_host));
   }
 #endif
 
-  uint32_t output_surface_id = g_next_output_surface_id++;
+  uint32_t compositor_frame_sink_id = g_next_compositor_frame_sink_id++;
 
   if (command_line.HasSwitch(switches::kEnableVulkan)) {
     scoped_refptr<cc::VulkanContextProvider> vulkan_context_provider =
         cc::VulkanInProcessContextProvider::Create();
     if (vulkan_context_provider) {
       DCHECK(!layout_test_mode());
-      return base::MakeUnique<CompositorOutputSurface>(
-          routing_id, output_surface_id,
+      return base::MakeUnique<RendererCompositorFrameSink>(
+          routing_id, compositor_frame_sink_id,
           CreateExternalBeginFrameSource(routing_id),
           std::move(vulkan_context_provider),
           std::move(frame_swap_message_queue));
@@ -1852,8 +1852,8 @@
 
   if (use_software) {
     DCHECK(!layout_test_mode());
-    return base::MakeUnique<CompositorOutputSurface>(
-        routing_id, output_surface_id,
+    return base::MakeUnique<RendererCompositorFrameSink>(
+        routing_id, compositor_frame_sink_id,
         CreateExternalBeginFrameSource(routing_id), nullptr, nullptr,
         std::move(frame_swap_message_queue));
   }
@@ -1898,25 +1898,25 @@
           command_buffer_metrics::RENDER_COMPOSITOR_CONTEXT));
 
   if (layout_test_deps_) {
-    return layout_test_deps_->CreateOutputSurface(
+    return layout_test_deps_->CreateCompositorFrameSink(
         routing_id, std::move(gpu_channel_host), std::move(context_provider),
         std::move(worker_context_provider), this);
   }
 
 #if defined(OS_ANDROID)
   if (sync_compositor_message_filter_) {
-    return base::MakeUnique<SynchronousCompositorOutputSurface>(
+    return base::MakeUnique<SynchronousCompositorFrameSink>(
         std::move(context_provider), std::move(worker_context_provider),
-        routing_id, output_surface_id,
+        routing_id, compositor_frame_sink_id,
         CreateExternalBeginFrameSource(routing_id),
         sync_compositor_message_filter_.get(),
         std::move(frame_swap_message_queue));
   }
 #endif
-  return base::WrapUnique(new CompositorOutputSurface(
-      routing_id, output_surface_id, CreateExternalBeginFrameSource(routing_id),
-      std::move(context_provider), std::move(worker_context_provider),
-      std::move(frame_swap_message_queue)));
+  return base::WrapUnique(new RendererCompositorFrameSink(
+      routing_id, compositor_frame_sink_id,
+      CreateExternalBeginFrameSource(routing_id), std::move(context_provider),
+      std::move(worker_context_provider), std::move(frame_swap_message_queue)));
 }
 
 std::unique_ptr<cc::SwapPromise>
diff --git a/content/renderer/render_thread_impl.h b/content/renderer/render_thread_impl.h
index c05f90c..04013d8 100644
--- a/content/renderer/render_thread_impl.h
+++ b/content/renderer/render_thread_impl.h
@@ -66,7 +66,7 @@
 namespace cc {
 class ContextProvider;
 class ImageSerializationProcessor;
-class OutputSurface;
+class CompositorFrameSink;
 class TaskGraphRunner;
 }
 
@@ -231,7 +231,7 @@
   // time this routine returns.
   scoped_refptr<gpu::GpuChannelHost> EstablishGpuChannelSync();
 
-  std::unique_ptr<cc::OutputSurface> CreateCompositorOutputSurface(
+  std::unique_ptr<cc::CompositorFrameSink> CreateCompositorFrameSink(
       bool use_software,
       int routing_id,
       scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue,
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 125155f..05adb9f 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -23,8 +23,8 @@
 #include "base/trace_event/trace_event.h"
 #include "base/trace_event/trace_event_synthetic_delay.h"
 #include "build/build_config.h"
+#include "cc/output/compositor_frame_sink.h"
 #include "cc/output/copy_output_request.h"
-#include "cc/output/output_surface.h"
 #include "cc/scheduler/begin_frame_source.h"
 #include "content/common/content_switches_internal.h"
 #include "content/common/input/synthetic_gesture_packet.h"
@@ -747,13 +747,13 @@
   GetWebWidget()->beginFrame(frame_time_sec);
 }
 
-std::unique_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface(
-    bool fallback) {
+std::unique_ptr<cc::CompositorFrameSink>
+RenderWidget::CreateCompositorFrameSink(bool fallback) {
   DCHECK(GetWebWidget());
   // For widgets that are never visible, we don't start the compositor, so we
-  // never get a request for a cc::OutputSurface.
+  // never get a request for a cc::CompositorFrameSink.
   DCHECK(!compositor_never_visible_);
-  return RenderThreadImpl::current()->CreateCompositorOutputSurface(
+  return RenderThreadImpl::current()->CreateCompositorFrameSink(
       fallback, routing_id_, frame_swap_message_queue_,
       GetURLForGraphicsContext3D());
 }
@@ -1142,7 +1142,7 @@
   OnDeviceScaleFactorChanged();
   compositor_->SetDeviceColorSpace(screen_info_.icc_profile.GetColorSpace());
   // For background pages and certain tests, we don't want to trigger
-  // OutputSurface creation.
+  // CompositorFrameSink creation.
   if (compositor_never_visible_ || !RenderThreadImpl::current())
     compositor_->SetNeverVisible();
 
diff --git a/content/renderer/render_widget.h b/content/renderer/render_widget.h
index f8a1f4b..dc1d2c0 100644
--- a/content/renderer/render_widget.h
+++ b/content/renderer/render_widget.h
@@ -74,7 +74,7 @@
 }
 
 namespace cc {
-class OutputSurface;
+class CompositorFrameSink;
 class SwapPromise;
 }
 
@@ -216,7 +216,7 @@
                            float page_scale,
                            float top_controls_delta) override;
   void BeginMainFrame(double frame_time_sec) override;
-  std::unique_ptr<cc::OutputSurface> CreateOutputSurface(
+  std::unique_ptr<cc::CompositorFrameSink> CreateCompositorFrameSink(
       bool fallback) override;
   void DidCommitAndDrawCompositorFrame() override;
   void DidCommitCompositorFrame() override;