Remove surface_id from RenderWidget/RenderWidgetHost and friends

We don't need them any more.

BUG=487471

Review URL: https://codereview.chromium.org/1359163005

Cr-Commit-Position: refs/heads/master@{#350686}
diff --git a/content/browser/android/in_process/synchronous_compositor_factory_impl.cc b/content/browser/android/in_process/synchronous_compositor_factory_impl.cc
index 5d62030..7048000 100644
--- a/content/browser/android/in_process/synchronous_compositor_factory_impl.cc
+++ b/content/browser/android/in_process/synchronous_compositor_factory_impl.cc
@@ -166,10 +166,14 @@
 scoped_ptr<cc::OutputSurface>
 SynchronousCompositorFactoryImpl::CreateOutputSurface(
     int routing_id,
-    int surface_id,
     scoped_refptr<content::FrameSwapMessageQueue> frame_swap_message_queue) {
+  // TODO(piman): we still need to create a View command buffer until
+  // crbug.com/526196 is fixed. The surface_id doesn't matter, it just needs to
+  // be !0.
+  const int32 kDummySurfaceId = 1;
   scoped_refptr<cc::ContextProvider> onscreen_context =
-      CreateContextProviderForCompositor(surface_id, RENDER_COMPOSITOR_CONTEXT);
+      CreateContextProviderForCompositor(kDummySurfaceId,
+                                         RENDER_COMPOSITOR_CONTEXT);
   scoped_refptr<cc::ContextProvider> worker_context =
       GetSharedWorkerContextProvider();
   return make_scoped_ptr(new SynchronousCompositorOutputSurface(
diff --git a/content/browser/android/in_process/synchronous_compositor_factory_impl.h b/content/browser/android/in_process/synchronous_compositor_factory_impl.h
index 90d6105..b78d2c810 100644
--- a/content/browser/android/in_process/synchronous_compositor_factory_impl.h
+++ b/content/browser/android/in_process/synchronous_compositor_factory_impl.h
@@ -40,7 +40,6 @@
       override;
   scoped_ptr<cc::OutputSurface> CreateOutputSurface(
       int routing_id,
-      int surface_id,
       scoped_refptr<content::FrameSwapMessageQueue> frame_swap_message_queue)
       override;
   InputHandlerManagerClient* GetInputHandlerManagerClient() override;
diff --git a/content/browser/frame_host/frame_tree_node.cc b/content/browser/frame_host/frame_tree_node.cc
index f317b28..c44c19c 100644
--- a/content/browser/frame_host/frame_tree_node.cc
+++ b/content/browser/frame_host/frame_tree_node.cc
@@ -134,7 +134,7 @@
       render_manager_.current_host()->GetSiteInstance()->GetBrowserContext(),
       render_manager_.current_host()->GetSiteInstance(),
       render_manager_.current_host()->GetRoutingID(), frame_routing_id,
-      MSG_ROUTING_NONE, 0 /* surface_id */);
+      MSG_ROUTING_NONE);
   child->set_parent(this);
 
   // Other renderer processes in this BrowsingInstance may need to find out
diff --git a/content/browser/frame_host/interstitial_page_impl.cc b/content/browser/frame_host/interstitial_page_impl.cc
index ae3c03ea..2fe3c90 100644
--- a/content/browser/frame_host/interstitial_page_impl.cc
+++ b/content/browser/frame_host/interstitial_page_impl.cc
@@ -594,7 +594,7 @@
   // Use the RenderViewHost from our FrameTree.
   frame_tree_.root()->render_manager()->Init(
       browser_context, site_instance.get(), MSG_ROUTING_NONE, MSG_ROUTING_NONE,
-      MSG_ROUTING_NONE, 0 /* surface_id */);
+      MSG_ROUTING_NONE);
   return frame_tree_.root()->current_frame_host()->render_view_host();
 }
 
@@ -767,14 +767,12 @@
 
 void InterstitialPageImpl::CreateNewWidget(int32 render_process_id,
                                            int32 route_id,
-                                           int32 surface_id,
                                            blink::WebPopupType popup_type) {
   NOTREACHED() << "InterstitialPage does not support showing drop-downs yet.";
 }
 
 void InterstitialPageImpl::CreateNewFullscreenWidget(int32 render_process_id,
-                                                     int32 route_id,
-                                                     int32 surface_id) {
+                                                     int32 route_id) {
   NOTREACHED()
       << "InterstitialPage does not support showing full screen popups.";
 }
diff --git a/content/browser/frame_host/interstitial_page_impl.h b/content/browser/frame_host/interstitial_page_impl.h
index d484735..1dd685d 100644
--- a/content/browser/frame_host/interstitial_page_impl.h
+++ b/content/browser/frame_host/interstitial_page_impl.h
@@ -128,11 +128,9 @@
       SessionStorageNamespace* session_storage_namespace) override;
   void CreateNewWidget(int32 render_process_id,
                        int32 route_id,
-                       int32 surface_id,
                        blink::WebPopupType popup_type) override;
   void CreateNewFullscreenWidget(int32 render_process_id,
-                                 int32 route_id,
-                                 int32 surface_id) override;
+                                 int32 route_id) override;
   void ShowCreatedWindow(int route_id,
                          WindowOpenDisposition disposition,
                          const gfx::Rect& initial_rect,
diff --git a/content/browser/frame_host/render_frame_host_factory.cc b/content/browser/frame_host/render_frame_host_factory.cc
index 53edaeb..6f896ce 100644
--- a/content/browser/frame_host/render_frame_host_factory.cc
+++ b/content/browser/frame_host/render_frame_host_factory.cc
@@ -23,16 +23,15 @@
     FrameTreeNode* frame_tree_node,
     int32 routing_id,
     int32 widget_routing_id,
-    int32 surface_id,
     int flags) {
   if (factory_) {
     return factory_->CreateRenderFrameHost(
         site_instance, render_view_host, delegate, rwh_delegate, frame_tree,
-        frame_tree_node, routing_id, widget_routing_id, surface_id, flags);
+        frame_tree_node, routing_id, widget_routing_id, flags);
   }
   return make_scoped_ptr(new RenderFrameHostImpl(
       site_instance, render_view_host, delegate, rwh_delegate, frame_tree,
-      frame_tree_node, routing_id, widget_routing_id, surface_id, flags));
+      frame_tree_node, routing_id, widget_routing_id, flags));
 }
 
 // static
diff --git a/content/browser/frame_host/render_frame_host_factory.h b/content/browser/frame_host/render_frame_host_factory.h
index 14bc349..9bd123b 100644
--- a/content/browser/frame_host/render_frame_host_factory.h
+++ b/content/browser/frame_host/render_frame_host_factory.h
@@ -35,7 +35,6 @@
       FrameTreeNode* frame_tree_node,
       int32 routing_id,
       int32 widget_routing_id,
-      int32 surface_id,
       int flags);
 
   // Returns true if there is currently a globally-registered factory.
@@ -56,7 +55,6 @@
       FrameTreeNode* frame_tree_node,
       int32 routing_id,
       int32 widget_routing_id,
-      int32 surface_id,
       int flags) = 0;
 
   // Registers a factory to be called when new RenderFrameHostImpls are created.
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index d87eff2c..16e89ef 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -170,7 +170,6 @@
                                          FrameTreeNode* frame_tree_node,
                                          int32 routing_id,
                                          int32 widget_routing_id,
-                                         int32 surface_id,
                                          int flags)
     : render_view_host_(render_view_host),
       delegate_(delegate),
@@ -212,11 +211,9 @@
       &RenderFrameHostImpl::OnSwappedOut, weak_ptr_factory_.GetWeakPtr())));
 
   if (widget_routing_id != MSG_ROUTING_NONE) {
-    render_widget_host_ = new RenderWidgetHostImpl(
-        rwh_delegate, GetProcess(), widget_routing_id, surface_id, hidden);
+    render_widget_host_ = new RenderWidgetHostImpl(rwh_delegate, GetProcess(),
+                                                   widget_routing_id, hidden);
     render_widget_host_->set_owned_by_render_frame_host(true);
-  } else {
-    DCHECK_EQ(0, surface_id);
   }
 }
 
@@ -635,13 +632,11 @@
 
   if (render_widget_host_) {
     params.widget_params.routing_id = render_widget_host_->GetRoutingID();
-    params.widget_params.surface_id = render_widget_host_->surface_id();
     params.widget_params.hidden = render_widget_host_->is_hidden();
   } else {
     // MSG_ROUTING_NONE will prevent a new RenderWidget from being created in
     // the renderer process.
     params.widget_params.routing_id = MSG_ROUTING_NONE;
-    params.widget_params.surface_id = 0;
     params.widget_params.hidden = true;
   }
 
diff --git a/content/browser/frame_host/render_frame_host_impl.h b/content/browser/frame_host/render_frame_host_impl.h
index abb0576e..ec3dd507 100644
--- a/content/browser/frame_host/render_frame_host_impl.h
+++ b/content/browser/frame_host/render_frame_host_impl.h
@@ -482,7 +482,6 @@
                       FrameTreeNode* frame_tree_node,
                       int32 routing_id,
                       int32 widget_routing_id,
-                      int32 surface_id,
                       int flags);
 
  private:
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc
index e231c172..76e6843 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -25,7 +25,6 @@
 #include "content/browser/frame_host/render_frame_host_factory.h"
 #include "content/browser/frame_host/render_frame_host_impl.h"
 #include "content/browser/frame_host/render_frame_proxy_host.h"
-#include "content/browser/gpu/gpu_surface_tracker.h"
 #include "content/browser/renderer_host/render_process_host_impl.h"
 #include "content/browser/renderer_host/render_view_host_factory.h"
 #include "content/browser/renderer_host/render_view_host_impl.h"
@@ -258,8 +257,7 @@
                                   SiteInstance* site_instance,
                                   int32 view_routing_id,
                                   int32 frame_routing_id,
-                                  int32 widget_routing_id,
-                                  int32 surface_id) {
+                                  int32 widget_routing_id) {
   // Create a RenderViewHost and RenderFrameHost, once we have an instance.  It
   // is important to immediately give this SiteInstance to a RenderViewHost so
   // that the SiteInstance is ref counted.
@@ -269,7 +267,7 @@
   int flags = delegate_->IsHidden() ? CREATE_RF_HIDDEN : 0;
   SetRenderFrameHost(CreateRenderFrameHost(site_instance, view_routing_id,
                                            frame_routing_id, widget_routing_id,
-                                           surface_id, flags));
+                                           flags));
 
   // Notify the delegate of the creation of the current RenderFrameHost.
   // Do this only for subframes, as the main frame case is taken care of by
@@ -1639,7 +1637,6 @@
     int32 view_routing_id,
     int32 frame_routing_id,
     int32 widget_routing_id,
-    int32 surface_id,
     int flags) {
   if (frame_routing_id == MSG_ROUTING_NONE)
     frame_routing_id = site_instance->GetProcess()->GetNextRoutingID();
@@ -1661,7 +1658,7 @@
   return RenderFrameHostFactory::Create(
       site_instance, render_view_host, render_frame_delegate_,
       render_widget_delegate_, frame_tree, frame_tree_node_, frame_routing_id,
-      widget_routing_id, surface_id, flags);
+      widget_routing_id, flags);
 }
 
 // PlzNavigate
@@ -1755,7 +1752,6 @@
     // Create a new RenderFrameHost if we don't find an existing one.
 
     int32 widget_routing_id = MSG_ROUTING_NONE;
-    int32 surface_id = 0;
     // A RenderFrame in a different process from its parent RenderFrame
     // requires a RenderWidget for input/layout/painting.
     if (frame_tree_node_->parent() &&
@@ -1763,13 +1759,10 @@
             instance) {
       CHECK(SiteIsolationPolicy::AreCrossProcessFramesPossible());
       widget_routing_id = instance->GetProcess()->GetNextRoutingID();
-      surface_id = GpuSurfaceTracker::Get()->AddSurfaceForRenderer(
-          instance->GetProcess()->GetID(), widget_routing_id);
     }
 
-    new_render_frame_host =
-        CreateRenderFrameHost(instance, MSG_ROUTING_NONE, MSG_ROUTING_NONE,
-                              widget_routing_id, surface_id, flags);
+    new_render_frame_host = CreateRenderFrameHost(
+        instance, MSG_ROUTING_NONE, MSG_ROUTING_NONE, widget_routing_id, flags);
     RenderViewHostImpl* render_view_host =
         new_render_frame_host->render_view_host();
     int proxy_routing_id = MSG_ROUTING_NONE;
diff --git a/content/browser/frame_host/render_frame_host_manager.h b/content/browser/frame_host/render_frame_host_manager.h
index bba18ea..826718f 100644
--- a/content/browser/frame_host/render_frame_host_manager.h
+++ b/content/browser/frame_host/render_frame_host_manager.h
@@ -205,8 +205,7 @@
             SiteInstance* site_instance,
             int32 view_routing_id,
             int32 frame_routing_id,
-            int32 widget_routing_id,
-            int32 surface_id);
+            int32 widget_routing_id);
 
   // Returns the currently active RenderFrameHost.
   //
@@ -645,7 +644,6 @@
                                                         int32 view_routing_id,
                                                         int32 frame_routing_id,
                                                         int32 widget_routing_id,
-                                                        int32 surface_id,
                                                         int flags);
 
   // PlzNavigate
diff --git a/content/browser/frame_host/render_widget_host_view_child_frame_unittest.cc b/content/browser/frame_host/render_widget_host_view_child_frame_unittest.cc
index f2e76f6..495c5898 100644
--- a/content/browser/frame_host/render_widget_host_view_child_frame_unittest.cc
+++ b/content/browser/frame_host/render_widget_host_view_child_frame_unittest.cc
@@ -13,7 +13,6 @@
 #include "content/browser/compositor/test/no_transport_image_transport_factory.h"
 #include "content/browser/frame_host/cross_process_frame_connector.h"
 #include "content/browser/gpu/compositor_util.h"
-#include "content/browser/gpu/gpu_surface_tracker.h"
 #include "content/browser/renderer_host/render_widget_host_delegate.h"
 #include "content/browser/renderer_host/render_widget_host_impl.h"
 #include "content/common/view_messages.h"
@@ -90,10 +89,8 @@
     MockRenderProcessHost* process_host =
         new MockRenderProcessHost(browser_context_.get());
     int32 routing_id = process_host->GetNextRoutingID();
-    int32 surface_id = GpuSurfaceTracker::Get()->AddSurfaceForRenderer(
-        process_host->GetID(), routing_id);
-    widget_host_ = new RenderWidgetHostImpl(&delegate_, process_host,
-                                            routing_id, surface_id, false);
+    widget_host_ =
+        new RenderWidgetHostImpl(&delegate_, process_host, routing_id, false);
     view_ = new RenderWidgetHostViewChildFrame(widget_host_);
 
     test_frame_connector_ = new MockCrossProcessFrameConnector();
diff --git a/content/browser/frame_host/render_widget_host_view_guest_unittest.cc b/content/browser/frame_host/render_widget_host_view_guest_unittest.cc
index 1d29af8..d5267f24 100644
--- a/content/browser/frame_host/render_widget_host_view_guest_unittest.cc
+++ b/content/browser/frame_host/render_widget_host_view_guest_unittest.cc
@@ -14,7 +14,6 @@
 #include "content/browser/browser_plugin/browser_plugin_guest.h"
 #include "content/browser/compositor/test/no_transport_image_transport_factory.h"
 #include "content/browser/gpu/compositor_util.h"
-#include "content/browser/gpu/gpu_surface_tracker.h"
 #include "content/browser/renderer_host/render_widget_host_delegate.h"
 #include "content/browser/renderer_host/render_widget_host_impl.h"
 #include "content/common/view_messages.h"
@@ -55,10 +54,8 @@
     MockRenderProcessHost* process_host =
         new MockRenderProcessHost(browser_context_.get());
     int32 routing_id = process_host->GetNextRoutingID();
-    int32 surface_id = GpuSurfaceTracker::Get()->AddSurfaceForRenderer(
-        process_host->GetID(), routing_id);
-    widget_host_ = new RenderWidgetHostImpl(&delegate_, process_host,
-                                            routing_id, surface_id, false);
+    widget_host_ =
+        new RenderWidgetHostImpl(&delegate_, process_host, routing_id, false);
     view_ = new RenderWidgetHostViewGuest(
         widget_host_, NULL,
         (new TestRenderWidgetHostView(widget_host_))->GetWeakPtr());
@@ -185,10 +182,8 @@
         web_contents_.get(), &browser_plugin_guest_delegate_);
 
     int32 routing_id = process_host->GetNextRoutingID();
-    int32 surface_id = GpuSurfaceTracker::Get()->AddSurfaceForRenderer(
-        process_host->GetID(), routing_id);
-    widget_host_ = new RenderWidgetHostImpl(&delegate_, process_host,
-                                            routing_id, surface_id, false);
+    widget_host_ =
+        new RenderWidgetHostImpl(&delegate_, process_host, routing_id, false);
     view_ = new RenderWidgetHostViewGuest(
         widget_host_, browser_plugin_guest_,
         (new TestRenderWidgetHostView(widget_host_))->GetWeakPtr());
diff --git a/content/browser/gpu/gpu_surface_tracker.cc b/content/browser/gpu/gpu_surface_tracker.cc
index 31fcef5..721b4d5 100644
--- a/content/browser/gpu/gpu_surface_tracker.cc
+++ b/content/browser/gpu/gpu_surface_tracker.cc
@@ -25,35 +25,11 @@
   return base::Singleton<GpuSurfaceTracker>::get();
 }
 
-int GpuSurfaceTracker::AddSurfaceForRenderer(int renderer_id,
-                                             int render_widget_id) {
-  base::AutoLock lock(lock_);
-  int surface_id = next_surface_id_++;
-  surface_map_[surface_id] =
-      SurfaceInfo(renderer_id, render_widget_id, gfx::kNullAcceleratedWidget,
-                  gfx::GLSurfaceHandle());
-  return surface_id;
-}
-
-int GpuSurfaceTracker::LookupSurfaceForRenderer(int renderer_id,
-                                                int render_widget_id) {
-  base::AutoLock lock(lock_);
-  for (SurfaceMap::iterator it = surface_map_.begin(); it != surface_map_.end();
-       ++it) {
-    const SurfaceInfo& info = it->second;
-    if (info.renderer_id == renderer_id &&
-        info.render_widget_id == render_widget_id) {
-      return it->first;
-    }
-  }
-  return 0;
-}
-
 int GpuSurfaceTracker::AddSurfaceForNativeWidget(
     gfx::AcceleratedWidget widget) {
   base::AutoLock lock(lock_);
   int surface_id = next_surface_id_++;
-  surface_map_[surface_id] = SurfaceInfo(0, 0, widget, gfx::GLSurfaceHandle());
+  surface_map_[surface_id] = SurfaceInfo(widget, gfx::GLSurfaceHandle());
   return surface_id;
 }
 
@@ -99,19 +75,12 @@
 }
 
 GpuSurfaceTracker::SurfaceInfo::SurfaceInfo()
-   : renderer_id(0),
-     render_widget_id(0),
-     native_widget(gfx::kNullAcceleratedWidget) { }
+    : native_widget(gfx::kNullAcceleratedWidget) {}
 
 GpuSurfaceTracker::SurfaceInfo::SurfaceInfo(
-    int renderer_id,
-    int render_widget_id,
     const gfx::AcceleratedWidget& native_widget,
     const gfx::GLSurfaceHandle& handle)
-    : renderer_id(renderer_id),
-      render_widget_id(render_widget_id),
-      native_widget(native_widget),
-      handle(handle) {}
+    : native_widget(native_widget), handle(handle) {}
 
 GpuSurfaceTracker::SurfaceInfo::~SurfaceInfo() { }
 
diff --git a/content/browser/gpu/gpu_surface_tracker.h b/content/browser/gpu/gpu_surface_tracker.h
index 6d66255..01f16d6 100644
--- a/content/browser/gpu/gpu_surface_tracker.h
+++ b/content/browser/gpu/gpu_surface_tracker.h
@@ -36,16 +36,6 @@
   // Gets the global instance of the surface tracker.
   static GpuSurfaceTracker* Get() { return GetInstance(); }
 
-  // Adds a surface for a given RenderWidgetHost. |renderer_id| is the renderer
-  // process ID, |render_widget_id| is the RenderWidgetHost route id within that
-  // renderer. Returns the surface ID.
-  int AddSurfaceForRenderer(int renderer_id, int render_widget_id);
-
-  // Looks up a surface for a given RenderWidgetHost. Returns the surface
-  // ID, or 0 if not found.
-  // Note: This is an O(N) lookup.
-  int LookupSurfaceForRenderer(int renderer_id, int render_widget_id);
-
   // Adds a surface for a native widget. Returns the surface ID.
   int AddSurfaceForNativeWidget(gfx::AcceleratedWidget widget);
 
@@ -70,13 +60,9 @@
  private:
   struct SurfaceInfo {
     SurfaceInfo();
-    SurfaceInfo(int renderer_id,
-                int render_widget_id,
-                const gfx::AcceleratedWidget& native_widget,
+    SurfaceInfo(const gfx::AcceleratedWidget& native_widget,
                 const gfx::GLSurfaceHandle& handle);
     ~SurfaceInfo();
-    int renderer_id;
-    int render_widget_id;
     gfx::AcceleratedWidget native_widget;
     gfx::GLSurfaceHandle handle;
   };
diff --git a/content/browser/media/capture/web_contents_video_capture_device_unittest.cc b/content/browser/media/capture/web_contents_video_capture_device_unittest.cc
index d0c7a88..ec80ea0 100644
--- a/content/browser/media/capture/web_contents_video_capture_device_unittest.cc
+++ b/content/browser/media/capture/web_contents_video_capture_device_unittest.cc
@@ -248,7 +248,6 @@
                             RenderViewHostDelegate* delegate,
                             RenderWidgetHostDelegate* widget_delegate,
                             int32 routing_id,
-                            int32 surface_id,
                             int32 main_frame_routing_id,
                             bool swapped_out,
                             CaptureTestSourceController* controller)
@@ -256,7 +255,6 @@
                            delegate,
                            widget_delegate,
                            routing_id,
-                           surface_id,
                            main_frame_routing_id,
                            swapped_out),
         controller_(controller) {
@@ -313,12 +311,11 @@
       RenderViewHostDelegate* delegate,
       RenderWidgetHostDelegate* widget_delegate,
       int32 routing_id,
-      int32 surface_id,
       int32 main_frame_routing_id,
       bool swapped_out) override {
-    return new CaptureTestRenderViewHost(
-        instance, delegate, widget_delegate, routing_id, surface_id,
-        main_frame_routing_id, swapped_out, controller_);
+    return new CaptureTestRenderViewHost(instance, delegate, widget_delegate,
+                                         routing_id, main_frame_routing_id,
+                                         swapped_out, controller_);
   }
  private:
   CaptureTestSourceController* controller_;
diff --git a/content/browser/renderer_host/media/video_capture_device_client.cc b/content/browser/renderer_host/media/video_capture_device_client.cc
index 8e8d0296..fe7c623 100644
--- a/content/browser/renderer_host/media/video_capture_device_client.cc
+++ b/content/browser/renderer_host/media/video_capture_device_client.cc
@@ -42,8 +42,7 @@
 #if !defined(OS_ANDROID)
 // Modelled after GpuProcessTransportFactory::CreateContextCommon().
 scoped_ptr<content::WebGraphicsContext3DCommandBufferImpl> CreateContextCommon(
-    scoped_refptr<content::GpuChannelHost> gpu_channel_host,
-    int surface_id) {
+    scoped_refptr<content::GpuChannelHost> gpu_channel_host) {
   if (!content::GpuDataManagerImpl::GetInstance()->
         CanUseGpuBrowserCompositor()) {
     DLOG(ERROR) << "No accelerated graphics found. Check chrome://gpu";
@@ -61,15 +60,11 @@
     return scoped_ptr<content::WebGraphicsContext3DCommandBufferImpl>();
   }
   GURL url("chrome://gpu/GpuProcessTransportFactory::CreateCaptureContext");
-  return make_scoped_ptr(
-      new WebGraphicsContext3DCommandBufferImpl(
-          surface_id,
-          url,
-          gpu_channel_host.get(),
-          attrs,
-          true  /* lose_context_when_out_of_memory */,
-          content::WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits(),
-          NULL));
+  return make_scoped_ptr(new WebGraphicsContext3DCommandBufferImpl(
+      0, url, gpu_channel_host.get(), attrs,
+      true /* lose_context_when_out_of_memory */,
+      content::WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits(),
+      NULL));
 }
 
 // Modelled after
@@ -85,7 +80,7 @@
       content::BrowserGpuChannelHostFactory::instance()->
           EstablishGpuChannelSync(cause));
   DCHECK(gpu_channel_host);
-  return CreateContextCommon(gpu_channel_host, 0);
+  return CreateContextCommon(gpu_channel_host);
 }
 #endif
 
diff --git a/content/browser/renderer_host/render_message_filter.cc b/content/browser/renderer_host/render_message_filter.cc
index a054579..d598288 100644
--- a/content/browser/renderer_host/render_message_filter.cc
+++ b/content/browser/renderer_host/render_message_filter.cc
@@ -229,7 +229,6 @@
     const ViewHostMsg_CreateWindow_Params& params,
     int* route_id,
     int* main_frame_route_id,
-    int* surface_id,
     int64* cloned_session_storage_namespace_id) {
   bool no_javascript_access;
 
@@ -254,7 +253,6 @@
   if (!can_create_window) {
     *route_id = MSG_ROUTING_NONE;
     *main_frame_route_id = MSG_ROUTING_NONE;
-    *surface_id = 0;
     *cloned_session_storage_namespace_id = 0;
     return;
   }
@@ -270,23 +268,18 @@
                                          PeerHandle(),
                                          route_id,
                                          main_frame_route_id,
-                                         surface_id,
                                          cloned_namespace.get());
 }
 
 void RenderMessageFilter::OnCreateWidget(int opener_id,
                                          blink::WebPopupType popup_type,
-                                         int* route_id,
-                                         int* surface_id) {
-  render_widget_helper_->CreateNewWidget(
-      opener_id, popup_type, route_id, surface_id);
+                                         int* route_id) {
+  render_widget_helper_->CreateNewWidget(opener_id, popup_type, route_id);
 }
 
 void RenderMessageFilter::OnCreateFullscreenWidget(int opener_id,
-                                                   int* route_id,
-                                                   int* surface_id) {
-  render_widget_helper_->CreateNewFullscreenWidget(
-      opener_id, route_id, surface_id);
+                                                   int* route_id) {
+  render_widget_helper_->CreateNewFullscreenWidget(opener_id, route_id);
 }
 
 void RenderMessageFilter::OnGetProcessMemorySizes(size_t* private_bytes,
diff --git a/content/browser/renderer_host/render_message_filter.h b/content/browser/renderer_host/render_message_filter.h
index 9836d05..d27b013c 100644
--- a/content/browser/renderer_host/render_message_filter.h
+++ b/content/browser/renderer_host/render_message_filter.h
@@ -125,15 +125,11 @@
   void OnCreateWindow(const ViewHostMsg_CreateWindow_Params& params,
                       int* route_id,
                       int* main_frame_route_id,
-                      int* surface_id,
                       int64* cloned_session_storage_namespace_id);
   void OnCreateWidget(int opener_id,
                       blink::WebPopupType popup_type,
-                      int* route_id,
-                      int* surface_id);
-  void OnCreateFullscreenWidget(int opener_id,
-                                int* route_id,
-                                int* surface_id);
+                      int* route_id);
+  void OnCreateFullscreenWidget(int opener_id, int* route_id);
 
 #if defined(OS_MACOSX)
   // Messages for OOP font loading.
diff --git a/content/browser/renderer_host/render_view_host_delegate.h b/content/browser/renderer_host/render_view_host_delegate.h
index 904598d3..9a45159 100644
--- a/content/browser/renderer_host/render_view_host_delegate.h
+++ b/content/browser/renderer_host/render_view_host_delegate.h
@@ -227,13 +227,11 @@
   // is (select, autofill...).
   virtual void CreateNewWidget(int32 render_process_id,
                                int32 route_id,
-                               int32 surface_id,
                                blink::WebPopupType popup_type) {}
 
   // Creates a full screen RenderWidget. Similar to above.
   virtual void CreateNewFullscreenWidget(int32 render_process_id,
-                                         int32 route_id,
-                                         int32 surface_id) {}
+                                         int32 route_id) {}
 
   // Show a previously created page with the specified disposition and bounds.
   // The window is identified by the route_id passed to CreateNewWindow.
diff --git a/content/browser/renderer_host/render_view_host_factory.cc b/content/browser/renderer_host/render_view_host_factory.cc
index bfa5c98..2e166c4e 100644
--- a/content/browser/renderer_host/render_view_host_factory.cc
+++ b/content/browser/renderer_host/render_view_host_factory.cc
@@ -5,7 +5,6 @@
 #include "content/browser/renderer_host/render_view_host_factory.h"
 
 #include "base/logging.h"
-#include "content/browser/gpu/gpu_surface_tracker.h"
 #include "content/browser/renderer_host/render_view_host_impl.h"
 
 namespace content {
@@ -22,7 +21,6 @@
     int32 main_frame_routing_id,
     bool swapped_out,
     bool hidden) {
-  int32 surface_id;
   // RenderViewHost creation can be either browser-driven (by the user opening a
   // new tab) or renderer-driven (by script calling window.open, etc).
   //
@@ -30,27 +28,22 @@
   // this is signified by passing MSG_ROUTING_NONE for |routing_id|.
   if (routing_id == MSG_ROUTING_NONE) {
     routing_id = instance->GetProcess()->GetNextRoutingID();
-    // No surface has yet been created for the RVH.
-    surface_id = GpuSurfaceTracker::Get()->AddSurfaceForRenderer(
-        instance->GetProcess()->GetID(), routing_id);
   } else {
     // Otherwise, in the renderer-driven case, the routing ID of the view is
     // already set. This is due to the fact that a sync render->browser IPC is
     // involved. In order to quickly reply to the sync IPC, the routing IDs are
     // assigned as early as possible. The IO thread immediately sends a reply to
     // the sync IPC, while deferring the creation of the actual Host objects to
-    // the UI thread. In this case, a surface already exists for the RVH.
-    surface_id = GpuSurfaceTracker::Get()->LookupSurfaceForRenderer(
-        instance->GetProcess()->GetID(), routing_id);
+    // the UI thread.
   }
   if (factory_) {
     return factory_->CreateRenderViewHost(instance, delegate, widget_delegate,
-                                          routing_id, surface_id,
-                                          main_frame_routing_id, swapped_out);
+                                          routing_id, main_frame_routing_id,
+                                          swapped_out);
   }
   return new RenderViewHostImpl(instance, delegate, widget_delegate, routing_id,
-                                surface_id, main_frame_routing_id, swapped_out,
-                                hidden, true /* has_initialized_audio_host */);
+                                main_frame_routing_id, swapped_out, hidden,
+                                true /* has_initialized_audio_host */);
 }
 
 // static
diff --git a/content/browser/renderer_host/render_view_host_factory.h b/content/browser/renderer_host/render_view_host_factory.h
index b1c243c..be2aae5 100644
--- a/content/browser/renderer_host/render_view_host_factory.h
+++ b/content/browser/renderer_host/render_view_host_factory.h
@@ -48,7 +48,6 @@
       RenderViewHostDelegate* delegate,
       RenderWidgetHostDelegate* widget_delegate,
       int32 routing_id,
-      int32 surface_id,
       int32 main_frame_routing_id,
       bool swapped_out) = 0;
 
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
index d6e0956..328f1e6d2 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -199,7 +199,6 @@
     RenderViewHostDelegate* delegate,
     RenderWidgetHostDelegate* widget_delegate,
     int32 routing_id,
-    int32 surface_id,
     int32 main_frame_routing_id,
     bool swapped_out,
     bool hidden,
@@ -207,7 +206,6 @@
     : RenderWidgetHostImpl(widget_delegate,
                            instance->GetProcess(),
                            routing_id,
-                           surface_id,
                            hidden),
       frames_ref_count_(0),
       delegate_(delegate),
@@ -312,7 +310,6 @@
   params.web_preferences = GetWebkitPreferences();
   params.view_id = GetRoutingID();
   params.main_frame_routing_id = main_frame_routing_id_;
-  params.surface_id = surface_id();
   params.session_storage_namespace_id =
       delegate_->GetSessionStorageNamespace(instance_.get())->id();
   // Ensure the RenderView sets its opener correctly.
@@ -992,16 +989,12 @@
 }
 
 void RenderViewHostImpl::CreateNewWidget(int32 route_id,
-                                         int32 surface_id,
                                          blink::WebPopupType popup_type) {
-  delegate_->CreateNewWidget(GetProcess()->GetID(), route_id, surface_id,
-                             popup_type);
+  delegate_->CreateNewWidget(GetProcess()->GetID(), route_id, popup_type);
 }
 
-void RenderViewHostImpl::CreateNewFullscreenWidget(int32 route_id,
-                                                   int32 surface_id) {
-  delegate_->CreateNewFullscreenWidget(GetProcess()->GetID(), route_id,
-                                       surface_id);
+void RenderViewHostImpl::CreateNewFullscreenWidget(int32 route_id) {
+  delegate_->CreateNewFullscreenWidget(GetProcess()->GetID(), route_id);
 }
 
 void RenderViewHostImpl::OnShowView(int route_id,
diff --git a/content/browser/renderer_host/render_view_host_impl.h b/content/browser/renderer_host/render_view_host_impl.h
index e45f07d..2a9f31e6 100644
--- a/content/browser/renderer_host/render_view_host_impl.h
+++ b/content/browser/renderer_host/render_view_host_impl.h
@@ -115,7 +115,6 @@
                      RenderViewHostDelegate* delegate,
                      RenderWidgetHostDelegate* widget_delegate,
                      int32 routing_id,
-                     int32 surface_id,
                      int32 main_frame_routing_id,
                      bool swapped_out,
                      bool hidden,
@@ -306,11 +305,10 @@
   // Creates a new RenderWidget with the given route id.  |popup_type| indicates
   // if this widget is a popup and what kind of popup it is (select, autofill).
   void CreateNewWidget(int32 route_id,
-                       int32 surface_id,
                        blink::WebPopupType popup_type);
 
   // Creates a full screen RenderWidget.
-  void CreateNewFullscreenWidget(int32 route_id, int32 surface_id);
+  void CreateNewFullscreenWidget(int32 route_id);
 
   void set_main_frame_routing_id(int routing_id) {
     main_frame_routing_id_ = routing_id;
diff --git a/content/browser/renderer_host/render_view_host_unittest.cc b/content/browser/renderer_host/render_view_host_unittest.cc
index 78e428b4..00b7b3d 100644
--- a/content/browser/renderer_host/render_view_host_unittest.cc
+++ b/content/browser/renderer_host/render_view_host_unittest.cc
@@ -6,7 +6,6 @@
 #include "base/strings/utf_string_conversions.h"
 #include "content/browser/child_process_security_policy_impl.h"
 #include "content/browser/frame_host/render_frame_host_impl.h"
-#include "content/browser/gpu/gpu_surface_tracker.h"
 #include "content/browser/renderer_host/render_message_filter.h"
 #include "content/browser/renderer_host/render_view_host_delegate_view.h"
 #include "content/browser/renderer_host/render_widget_helper.h"
@@ -76,9 +75,7 @@
 // Create a full screen popup RenderWidgetHost and View.
 TEST_F(RenderViewHostTest, CreateFullscreenWidget) {
   int32 routing_id = process()->GetNextRoutingID();
-  int32 surface_id = GpuSurfaceTracker::Get()->AddSurfaceForRenderer(
-      process()->GetID(), routing_id);
-  test_rvh()->CreateNewFullscreenWidget(routing_id, surface_id);
+  test_rvh()->CreateNewFullscreenWidget(routing_id);
 }
 
 // Ensure we do not grant bindings to a process shared with unprivileged views.
diff --git a/content/browser/renderer_host/render_widget_helper.cc b/content/browser/renderer_host/render_widget_helper.cc
index 51f5e3ab..0aad52a6d 100644
--- a/content/browser/renderer_host/render_widget_helper.cc
+++ b/content/browser/renderer_host/render_widget_helper.cc
@@ -11,8 +11,6 @@
 #include "base/threading/thread.h"
 #include "base/threading/thread_restrictions.h"
 #include "content/browser/dom_storage/session_storage_namespace_impl.h"
-#include "content/browser/gpu/gpu_process_host_ui_shim.h"
-#include "content/browser/gpu/gpu_surface_tracker.h"
 #include "content/browser/loader/resource_dispatcher_host_impl.h"
 #include "content/browser/renderer_host/render_process_host_impl.h"
 #include "content/browser/renderer_host/render_view_host_impl.h"
@@ -106,7 +104,6 @@
     base::ProcessHandle render_process,
     int* route_id,
     int* main_frame_route_id,
-    int* surface_id,
     SessionStorageNamespace* session_storage_namespace) {
   if (params.opener_suppressed || no_javascript_access) {
     // If the opener is supppressed or script access is disallowed, we should
@@ -116,12 +113,9 @@
     // in OnCreateWindowOnUI, using the params provided here.
     *route_id = MSG_ROUTING_NONE;
     *main_frame_route_id = MSG_ROUTING_NONE;
-    *surface_id = 0;
   } else {
     *route_id = GetNextRoutingID();
     *main_frame_route_id = GetNextRoutingID();
-    *surface_id = GpuSurfaceTracker::Get()->AddSurfaceForRenderer(
-        render_process_id_, *route_id);
     // Block resource requests until the view is created, since the HWND might
     // be needed if a response ends up creating a plugin.
     resource_dispatcher_host_->BlockRequestsForRoute(
@@ -156,46 +150,37 @@
 
 void RenderWidgetHelper::CreateNewWidget(int opener_id,
                                          blink::WebPopupType popup_type,
-                                         int* route_id,
-                                         int* surface_id) {
+                                         int* route_id) {
   *route_id = GetNextRoutingID();
-  *surface_id = GpuSurfaceTracker::Get()->AddSurfaceForRenderer(
-      render_process_id_, *route_id);
-  BrowserThread::PostTask(
-      BrowserThread::UI, FROM_HERE,
-      base::Bind(&RenderWidgetHelper::OnCreateWidgetOnUI, this, opener_id,
-                 *route_id, *surface_id, popup_type));
+  BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
+                          base::Bind(&RenderWidgetHelper::OnCreateWidgetOnUI,
+                                     this, opener_id, *route_id, popup_type));
 }
 
 void RenderWidgetHelper::CreateNewFullscreenWidget(int opener_id,
-                                                   int* route_id,
-                                                   int* surface_id) {
+                                                   int* route_id) {
   *route_id = GetNextRoutingID();
-  *surface_id = GpuSurfaceTracker::Get()->AddSurfaceForRenderer(
-      render_process_id_, *route_id);
   BrowserThread::PostTask(
       BrowserThread::UI, FROM_HERE,
       base::Bind(&RenderWidgetHelper::OnCreateFullscreenWidgetOnUI, this,
-                 opener_id, *route_id, *surface_id));
+                 opener_id, *route_id));
 }
 
 void RenderWidgetHelper::OnCreateWidgetOnUI(int32 opener_id,
                                             int32 route_id,
-                                            int32 surface_id,
                                             blink::WebPopupType popup_type) {
   RenderViewHostImpl* host = RenderViewHostImpl::FromID(
       render_process_id_, opener_id);
   if (host)
-    host->CreateNewWidget(route_id, surface_id, popup_type);
+    host->CreateNewWidget(route_id, popup_type);
 }
 
 void RenderWidgetHelper::OnCreateFullscreenWidgetOnUI(int32 opener_id,
-                                                      int32 route_id,
-                                                      int32 surface_id) {
+                                                      int32 route_id) {
   RenderViewHostImpl* host = RenderViewHostImpl::FromID(
       render_process_id_, opener_id);
   if (host)
-    host->CreateNewFullscreenWidget(route_id, surface_id);
+    host->CreateNewFullscreenWidget(route_id);
 }
 
 }  // namespace content
diff --git a/content/browser/renderer_host/render_widget_helper.h b/content/browser/renderer_host/render_widget_helper.h
index 7f4ad7e..18576a41 100644
--- a/content/browser/renderer_host/render_widget_helper.h
+++ b/content/browser/renderer_host/render_widget_helper.h
@@ -105,13 +105,11 @@
       base::ProcessHandle render_process,
       int* route_id,
       int* main_frame_route_id,
-      int* surface_id,
       SessionStorageNamespace* session_storage_namespace);
   void CreateNewWidget(int opener_id,
                        blink::WebPopupType popup_type,
-                       int* route_id,
-                       int* surface_id);
-  void CreateNewFullscreenWidget(int opener_id, int* route_id, int* surface_id);
+                       int* route_id);
+  void CreateNewFullscreenWidget(int opener_id, int* route_id);
 
  private:
   friend class base::RefCountedThreadSafe<RenderWidgetHelper>;
@@ -133,13 +131,10 @@
   // Called on the UI thread to finish creating a widget.
   void OnCreateWidgetOnUI(int32 opener_id,
                           int32 route_id,
-                          int32 surface_id,
                           blink::WebPopupType popup_type);
 
   // Called on the UI thread to create a fullscreen widget.
-  void OnCreateFullscreenWidgetOnUI(int32 opener_id,
-                                    int32 route_id,
-                                    int32 surface_id);
+  void OnCreateFullscreenWidgetOnUI(int32 opener_id, int32 route_id);
 
   // Called on the IO thread to resume a paused navigation in the network
   // stack without transferring it to a new renderer process.
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 2b95d12..cdf11c83 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -30,9 +30,6 @@
 #include "content/browser/bad_message.h"
 #include "content/browser/browser_plugin/browser_plugin_guest.h"
 #include "content/browser/gpu/compositor_util.h"
-#include "content/browser/gpu/gpu_process_host.h"
-#include "content/browser/gpu/gpu_process_host_ui_shim.h"
-#include "content/browser/gpu/gpu_surface_tracker.h"
 #include "content/browser/renderer_host/dip_util.h"
 #include "content/browser/renderer_host/frame_metadata_util.h"
 #include "content/browser/renderer_host/input/input_router_config_helper.h"
@@ -146,7 +143,6 @@
 RenderWidgetHostImpl::RenderWidgetHostImpl(RenderWidgetHostDelegate* delegate,
                                            RenderProcessHost* process,
                                            int32_t routing_id,
-                                           int32_t surface_id,
                                            bool hidden)
     : view_(NULL),
       hung_renderer_delay_(
@@ -157,7 +153,6 @@
       delegate_(delegate),
       process_(process),
       routing_id_(routing_id),
-      surface_id_(surface_id),
       is_loading_(false),
       is_hidden_(hidden),
       repaint_ack_pending_(false),
@@ -183,8 +178,6 @@
       weak_factory_(this) {
   CHECK(delegate_);
   CHECK_NE(MSG_ROUTING_NONE, routing_id_);
-  DCHECK_EQ(surface_id_, GpuSurfaceTracker::Get()->LookupSurfaceForRenderer(
-                             process_->GetID(), routing_id_));
 
   std::pair<RoutingIDWidgetMap::iterator, bool> result =
       g_routing_id_widget_map.Get().insert(std::make_pair(
@@ -224,9 +217,6 @@
     view_weak_->RenderWidgetHostGone();
   SetView(NULL);
 
-  GpuSurfaceTracker::Get()->RemoveSurface(surface_id_);
-  surface_id_ = 0;
-
   process_->RemoveRoute(routing_id_);
   g_routing_id_widget_map.Get().erase(
       RenderWidgetHostID(process_->GetID(), routing_id_));
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h
index 11b99ee..a58e626 100644
--- a/content/browser/renderer_host/render_widget_host_impl.h
+++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -95,7 +95,6 @@
   RenderWidgetHostImpl(RenderWidgetHostDelegate* delegate,
                        RenderProcessHost* process,
                        int32_t routing_id,
-                       int32_t surface_id,
                        bool hidden);
   ~RenderWidgetHostImpl() override;
 
@@ -172,8 +171,6 @@
 
   RenderWidgetHostDelegate* delegate() const { return delegate_; }
 
-  int surface_id() const { return surface_id_; }
-
   bool empty() const { return current_size_.IsEmpty(); }
 
   // Called when a renderer object already been created for this host, and we
@@ -698,9 +695,6 @@
   // The ID of the corresponding object in the Renderer Instance.
   const int routing_id_;
 
-  // The ID of the surface corresponding to this render widget.
-  int surface_id_;
-
   // Indicates whether a page is loading or not.
   bool is_loading_;
 
diff --git a/content/browser/renderer_host/render_widget_host_unittest.cc b/content/browser/renderer_host/render_widget_host_unittest.cc
index b43692a5..0e2557c3 100644
--- a/content/browser/renderer_host/render_widget_host_unittest.cc
+++ b/content/browser/renderer_host/render_widget_host_unittest.cc
@@ -135,8 +135,6 @@
             delegate,
             process,
             routing_id,
-            GpuSurfaceTracker::Get()->AddSurfaceForRenderer(process->GetID(),
-                                                            routing_id),
             false),
         unresponsive_timer_fired_(false),
         new_content_rendering_timeout_fired_(false) {
diff --git a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
index dae4136..afeaa5d 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
@@ -21,7 +21,6 @@
 #include "content/browser/compositor/resize_lock.h"
 #include "content/browser/compositor/test/no_transport_image_transport_factory.h"
 #include "content/browser/frame_host/render_widget_host_view_guest.h"
-#include "content/browser/gpu/gpu_surface_tracker.h"
 #include "content/browser/renderer_host/input/input_router.h"
 #include "content/browser/renderer_host/input/web_input_event_util.h"
 #include "content/browser/renderer_host/overscroll_controller.h"
@@ -389,10 +388,8 @@
     sink_ = &process_host_->sink();
 
     int32 routing_id = process_host_->GetNextRoutingID();
-    int32 surface_id = GpuSurfaceTracker::Get()->AddSurfaceForRenderer(
-        process_host_->GetID(), routing_id);
-    parent_host_ = new RenderWidgetHostImpl(&delegate_, process_host_,
-                                            routing_id, surface_id, false);
+    parent_host_ =
+        new RenderWidgetHostImpl(&delegate_, process_host_, routing_id, false);
     parent_view_ = new RenderWidgetHostViewAura(parent_host_,
                                                 is_guest_view_hack_);
     parent_view_->InitAsChild(NULL);
@@ -401,10 +398,8 @@
                                           gfx::Rect());
 
     routing_id = process_host_->GetNextRoutingID();
-    surface_id = GpuSurfaceTracker::Get()->AddSurfaceForRenderer(
-        process_host_->GetID(), routing_id);
-    widget_host_ = new RenderWidgetHostImpl(&delegate_, process_host_,
-                                            routing_id, surface_id, false);
+    widget_host_ =
+        new RenderWidgetHostImpl(&delegate_, process_host_, routing_id, false);
     widget_host_->Init();
     view_ = new FakeRenderWidgetHostViewAura(widget_host_, is_guest_view_hack_);
   }
@@ -1908,10 +1903,8 @@
   // Create a bunch of renderers.
   for (size_t i = 0; i < renderer_count; ++i) {
     int32 routing_id = process_host_->GetNextRoutingID();
-    int32 surface_id = GpuSurfaceTracker::Get()->AddSurfaceForRenderer(
-        process_host_->GetID(), routing_id);
-    hosts[i] = new RenderWidgetHostImpl(&delegate_, process_host_, routing_id,
-                                        surface_id, false);
+    hosts[i] =
+        new RenderWidgetHostImpl(&delegate_, process_host_, routing_id, false);
     hosts[i]->Init();
     views[i] = new FakeRenderWidgetHostViewAura(hosts[i], false);
     views[i]->InitAsChild(NULL);
@@ -2074,10 +2067,8 @@
   // Create a bunch of renderers.
   for (size_t i = 0; i < renderer_count; ++i) {
     int32 routing_id = process_host_->GetNextRoutingID();
-    int32 surface_id = GpuSurfaceTracker::Get()->AddSurfaceForRenderer(
-        process_host_->GetID(), routing_id);
-    hosts[i] = new RenderWidgetHostImpl(&delegate_, process_host_, routing_id,
-                                        surface_id, false);
+    hosts[i] =
+        new RenderWidgetHostImpl(&delegate_, process_host_, routing_id, false);
     hosts[i]->Init();
     views[i] = new FakeRenderWidgetHostViewAura(hosts[i], false);
     views[i]->InitAsChild(NULL);
@@ -2145,10 +2136,8 @@
   // Create a bunch of renderers.
   for (size_t i = 0; i < renderer_count; ++i) {
     int32 routing_id = process_host_->GetNextRoutingID();
-    int32 surface_id = GpuSurfaceTracker::Get()->AddSurfaceForRenderer(
-        process_host_->GetID(), routing_id);
-    hosts[i] = new RenderWidgetHostImpl(&delegate_, process_host_, routing_id,
-                                        surface_id, false);
+    hosts[i] =
+        new RenderWidgetHostImpl(&delegate_, process_host_, routing_id, false);
     hosts[i]->Init();
     views[i] = new FakeRenderWidgetHostViewAura(hosts[i], false);
     views[i]->InitAsChild(NULL);
diff --git a/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm b/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm
index 98ee45a..a6af135 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm
@@ -10,7 +10,6 @@
 #include "base/message_loop/message_loop.h"
 #include "content/browser/compositor/test/no_transport_image_transport_factory.h"
 #include "content/browser/gpu/compositor_util.h"
-#include "content/browser/gpu/gpu_surface_tracker.h"
 #include "content/browser/renderer_host/render_widget_host_delegate.h"
 #include "content/browser/renderer_host/render_widget_host_impl.h"
 #include "content/common/input_messages.h"
@@ -87,9 +86,8 @@
  public:
   RenderWidgetHostEditCommandCounter(RenderWidgetHostDelegate* delegate,
                                      RenderProcessHost* process,
-                                     int32 routing_id,
-                                     int32 surface_id)
-      : RenderWidgetHostImpl(delegate, process, routing_id, surface_id, false),
+                                     int32 routing_id)
+      : RenderWidgetHostImpl(delegate, process, routing_id, false),
         edit_command_message_count_(0) {}
 
   bool Send(IPC::Message* message) override {
@@ -127,11 +125,9 @@
   ui::test::ScopedSetSupportedScaleFactors scoped_supported(supported_factors);
 
   int32 routing_id = process_host.GetNextRoutingID();
-  int32 surface_id = GpuSurfaceTracker::Get()->AddSurfaceForRenderer(
-      process_host.GetID(), routing_id);
   RenderWidgetHostEditCommandCounter* render_widget =
       new RenderWidgetHostEditCommandCounter(&delegate, &process_host,
-                                             routing_id, surface_id);
+                                             routing_id);
 
   base::mac::ScopedNSAutoreleasePool pool;
 
diff --git a/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm b/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm
index 7db63af9..4a7dad6f 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm
@@ -14,7 +14,6 @@
 #include "content/browser/compositor/test/no_transport_image_transport_factory.h"
 #include "content/browser/frame_host/render_widget_host_view_guest.h"
 #include "content/browser/gpu/compositor_util.h"
-#include "content/browser/gpu/gpu_surface_tracker.h"
 #include "content/browser/renderer_host/render_widget_host_delegate.h"
 #include "content/common/gpu/gpu_messages.h"
 #include "content/common/input_messages.h"
@@ -131,10 +130,8 @@
  public:
   MockRenderWidgetHostImpl(RenderWidgetHostDelegate* delegate,
                            RenderProcessHost* process,
-                           int32 routing_id,
-                           int32 surface_id)
-      : RenderWidgetHostImpl(delegate, process, routing_id, surface_id, false) {
-  }
+                           int32 routing_id)
+      : RenderWidgetHostImpl(delegate, process, routing_id, false) {}
 
   MOCK_METHOD0(Focus, void());
   MOCK_METHOD0(Blur, void());
@@ -279,11 +276,9 @@
   MockRenderProcessHost* process_host =
       new MockRenderProcessHost(&browser_context);
   int32 routing_id = process_host->GetNextRoutingID();
-  int32 surface_id = GpuSurfaceTracker::Get()->AddSurfaceForRenderer(
-      process_host->GetID(), routing_id);
   // Owned by its |cocoa_view()|.
-  RenderWidgetHostImpl* rwh = new RenderWidgetHostImpl(
-      &delegate, process_host, routing_id, surface_id, false);
+  RenderWidgetHostImpl* rwh =
+      new RenderWidgetHostImpl(&delegate, process_host, routing_id, false);
   RenderWidgetHostViewMac* view = new RenderWidgetHostViewMac(rwh, false);
 
   view->InitAsFullscreen(rwhv_mac_);
@@ -315,11 +310,9 @@
   MockRenderProcessHost* process_host =
       new MockRenderProcessHost(&browser_context);
   int32 routing_id = process_host->GetNextRoutingID();
-  int32 surface_id = GpuSurfaceTracker::Get()->AddSurfaceForRenderer(
-      process_host->GetID(), routing_id);
   // Owned by its |cocoa_view()|.
-  RenderWidgetHostImpl* rwh = new RenderWidgetHostImpl(
-      &delegate, process_host, routing_id, surface_id, false);
+  RenderWidgetHostImpl* rwh =
+      new RenderWidgetHostImpl(&delegate, process_host, routing_id, false);
   RenderWidgetHostViewMac* view = new RenderWidgetHostViewMac(rwh, false);
 
   view->InitAsFullscreen(rwhv_mac_);
@@ -698,10 +691,8 @@
 
   // Owned by its |cocoa_view()|.
   int32 routing_id = process_host->GetNextRoutingID();
-  int32 surface_id = GpuSurfaceTracker::Get()->AddSurfaceForRenderer(
-      process_host->GetID(), routing_id);
-  MockRenderWidgetHostImpl* rwh = new MockRenderWidgetHostImpl(
-      &delegate, process_host, routing_id, surface_id);
+  MockRenderWidgetHostImpl* rwh =
+      new MockRenderWidgetHostImpl(&delegate, process_host, routing_id);
   RenderWidgetHostViewMac* view = new RenderWidgetHostViewMac(rwh, false);
 
   base::scoped_nsobject<CocoaTestHelperWindow> window(
@@ -748,10 +739,8 @@
   process_host->Init();
   MockRenderWidgetHostDelegate delegate;
   int32 routing_id = process_host->GetNextRoutingID();
-  int32 surface_id = GpuSurfaceTracker::Get()->AddSurfaceForRenderer(
-      process_host->GetID(), routing_id);
-  MockRenderWidgetHostImpl* host = new MockRenderWidgetHostImpl(
-      &delegate, process_host, routing_id, surface_id);
+  MockRenderWidgetHostImpl* host =
+      new MockRenderWidgetHostImpl(&delegate, process_host, routing_id);
   RenderWidgetHostViewMac* view = new RenderWidgetHostViewMac(host, false);
 
   // Send an initial wheel event with NSEventPhaseBegan to the view.
@@ -791,10 +780,8 @@
   process_host->Init();
   MockRenderWidgetHostDelegate delegate;
   int32 routing_id = process_host->GetNextRoutingID();
-  int32 surface_id = GpuSurfaceTracker::Get()->AddSurfaceForRenderer(
-      process_host->GetID(), routing_id);
-  MockRenderWidgetHostImpl* host = new MockRenderWidgetHostImpl(
-      &delegate, process_host, routing_id, surface_id);
+  MockRenderWidgetHostImpl* host =
+      new MockRenderWidgetHostImpl(&delegate, process_host, routing_id);
   RenderWidgetHostViewMac* view = new RenderWidgetHostViewMac(host, false);
 
   // Add a delegate to the view.
@@ -844,12 +831,10 @@
   MockRenderProcessHost* process_host =
       new MockRenderProcessHost(&browser_context);
   int32 routing_id = process_host->GetNextRoutingID();
-  int32 surface_id = GpuSurfaceTracker::Get()->AddSurfaceForRenderer(
-      process_host->GetID(), routing_id);
 
   // Owned by its |cocoa_view()|.
-  MockRenderWidgetHostImpl* rwh = new MockRenderWidgetHostImpl(
-      &delegate, process_host, routing_id, surface_id);
+  MockRenderWidgetHostImpl* rwh =
+      new MockRenderWidgetHostImpl(&delegate, process_host, routing_id);
   RenderWidgetHostViewMac* view = new RenderWidgetHostViewMac(rwh, true);
 
   // Add a delegate to the view.
@@ -889,10 +874,8 @@
       new MockRenderProcessHost(&browser_context);
   MockRenderWidgetHostDelegate delegate;
   int32 routing_id = process_host->GetNextRoutingID();
-  int32 surface_id = GpuSurfaceTracker::Get()->AddSurfaceForRenderer(
-      process_host->GetID(), routing_id);
-  MockRenderWidgetHostImpl* host = new MockRenderWidgetHostImpl(
-      &delegate, process_host, routing_id, surface_id);
+  MockRenderWidgetHostImpl* host =
+      new MockRenderWidgetHostImpl(&delegate, process_host, routing_id);
   RenderWidgetHostViewMac* view = new RenderWidgetHostViewMac(host, false);
 
   EXPECT_TRUE(view->GetBackgroundOpaque());
@@ -968,10 +951,8 @@
   process_host_->Init();
   MockRenderWidgetHostDelegate delegate;
   int32 routing_id = process_host_->GetNextRoutingID();
-  int32 surface_id = GpuSurfaceTracker::Get()->AddSurfaceForRenderer(
-      process_host_->GetID(), routing_id);
-  MockRenderWidgetHostImpl* host = new MockRenderWidgetHostImpl(
-      &delegate, process_host_, routing_id, surface_id);
+  MockRenderWidgetHostImpl* host =
+      new MockRenderWidgetHostImpl(&delegate, process_host_, routing_id);
   RenderWidgetHostViewMac* view = new RenderWidgetHostViewMac(host, false);
 
   // We'll use this IPC message to ack events.
diff --git a/content/browser/renderer_host/text_input_client_mac_unittest.mm b/content/browser/renderer_host/text_input_client_mac_unittest.mm
index 57caf1d8..6d8652cf 100644
--- a/content/browser/renderer_host/text_input_client_mac_unittest.mm
+++ b/content/browser/renderer_host/text_input_client_mac_unittest.mm
@@ -7,7 +7,6 @@
 #include "base/bind.h"
 #include "base/message_loop/message_loop.h"
 #include "base/threading/thread.h"
-#include "content/browser/gpu/gpu_surface_tracker.h"
 #include "content/browser/renderer_host/render_process_host_impl.h"
 #include "content/browser/renderer_host/render_widget_host_delegate.h"
 #include "content/browser/renderer_host/render_widget_host_impl.h"
@@ -49,10 +48,7 @@
     RenderProcessHost* rph =
         process_factory_.CreateRenderProcessHost(&browser_context_, nullptr);
     int32 routing_id = rph->GetNextRoutingID();
-    int32 surface_id = GpuSurfaceTracker::Get()->AddSurfaceForRenderer(
-        rph->GetID(), routing_id);
-    widget_.reset(new RenderWidgetHostImpl(&delegate_, rph, routing_id,
-                                           surface_id, false));
+    widget_.reset(new RenderWidgetHostImpl(&delegate_, rph, routing_id, false));
   }
 
   // Accessor for the TextInputClientMac instance.
diff --git a/content/browser/security_exploit_browsertest.cc b/content/browser/security_exploit_browsertest.cc
index 128ea53..2c5acc4 100644
--- a/content/browser/security_exploit_browsertest.cc
+++ b/content/browser/security_exploit_browsertest.cc
@@ -236,8 +236,7 @@
   // different timing in the test, let's simulate a CreateNewWidget call coming
   // from the IO thread.  Use the existing window routing id to cause a
   // deliberate collision.
-  pending_rvh->CreateNewWidget(duplicate_routing_id, 0 /* surface_id */,
-                               blink::WebPopupTypePage);
+  pending_rvh->CreateNewWidget(duplicate_routing_id, blink::WebPopupTypePage);
 
   // If the above operation doesn't crash, the test has succeeded!
 }
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index abac8a6..1ee7a7d 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -1352,7 +1352,7 @@
               params.main_frame_routing_id != MSG_ROUTING_NONE));
   GetRenderManager()->Init(params.browser_context, params.site_instance,
                            params.routing_id, params.main_frame_routing_id,
-                           MSG_ROUTING_NONE, 0 /* surface_id */);
+                           MSG_ROUTING_NONE);
   frame_tree_.root()->SetFrameName(params.main_frame_name);
 
   WebContentsViewDelegate* delegate =
@@ -1827,21 +1827,17 @@
 
 void WebContentsImpl::CreateNewWidget(int32 render_process_id,
                                       int32 route_id,
-                                      int32 surface_id,
                                       blink::WebPopupType popup_type) {
-  CreateNewWidget(render_process_id, route_id, surface_id, false, popup_type);
+  CreateNewWidget(render_process_id, route_id, false, popup_type);
 }
 
 void WebContentsImpl::CreateNewFullscreenWidget(int32 render_process_id,
-                                                int32 route_id,
-                                                int32 surface_id) {
-  CreateNewWidget(render_process_id, route_id, surface_id, true,
-                  blink::WebPopupTypeNone);
+                                                int32 route_id) {
+  CreateNewWidget(render_process_id, route_id, true, blink::WebPopupTypeNone);
 }
 
 void WebContentsImpl::CreateNewWidget(int32 render_process_id,
                                       int32 route_id,
-                                      int32 surface_id,
                                       bool is_fullscreen,
                                       blink::WebPopupType popup_type) {
   RenderProcessHost* process = GetRenderProcessHost();
@@ -1860,7 +1856,7 @@
   }
 
   RenderWidgetHostImpl* widget_host =
-      new RenderWidgetHostImpl(this, process, route_id, surface_id, IsHidden());
+      new RenderWidgetHostImpl(this, process, route_id, IsHidden());
   created_widgets_.insert(widget_host);
 
   RenderWidgetHostViewBase* widget_view =
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
index 080fa7e..d606c06 100644
--- a/content/browser/web_contents/web_contents_impl.h
+++ b/content/browser/web_contents/web_contents_impl.h
@@ -491,11 +491,9 @@
       SessionStorageNamespace* session_storage_namespace) override;
   void CreateNewWidget(int32 render_process_id,
                        int32 route_id,
-                       int32 surface_id,
                        blink::WebPopupType popup_type) override;
   void CreateNewFullscreenWidget(int32 render_process_id,
-                                 int32 route_id,
-                                 int32 surface_id) override;
+                                 int32 route_id) override;
   void ShowCreatedWindow(int route_id,
                          WindowOpenDisposition disposition,
                          const gfx::Rect& initial_rect,
@@ -929,7 +927,6 @@
   // Helper for CreateNewWidget/CreateNewFullscreenWidget.
   void CreateNewWidget(int32 render_process_id,
                        int32 route_id,
-                       int32 surface_id,
                        bool is_fullscreen,
                        blink::WebPopupType popup_type);
 
diff --git a/content/common/frame_messages.h b/content/common/frame_messages.h
index d5407ba..5e02c04 100644
--- a/content/common/frame_messages.h
+++ b/content/common/frame_messages.h
@@ -320,9 +320,6 @@
   // is MSG_ROUTING_NONE and the other parameters are not read.
   IPC_STRUCT_MEMBER(int, routing_id)
 
-  // Identifier for the output surface for the new RenderWidget.
-  IPC_STRUCT_MEMBER(int, surface_id)
-
   // Tells the new RenderWidget whether it is initially hidden.
   IPC_STRUCT_MEMBER(bool, hidden)
 IPC_STRUCT_END()
diff --git a/content/common/view_messages.h b/content/common/view_messages.h
index 41593d12..c4d5983e 100644
--- a/content/common/view_messages.h
+++ b/content/common/view_messages.h
@@ -485,9 +485,6 @@
   // The ID of the main frame hosted in the view.
   IPC_STRUCT_MEMBER(int32, main_frame_routing_id)
 
-  // The ID of the rendering surface.
-  IPC_STRUCT_MEMBER(int32, surface_id)
-
   // The session storage namespace ID this view should use.
   IPC_STRUCT_MEMBER(int64, session_storage_namespace_id)
 
@@ -978,28 +975,25 @@
 // Sent by the renderer when it is creating a new window.  The browser creates
 // a tab for it and responds with a ViewMsg_CreatingNew_ACK.  If route_id is
 // MSG_ROUTING_NONE, the view couldn't be created.
-IPC_SYNC_MESSAGE_CONTROL1_4(ViewHostMsg_CreateWindow,
+IPC_SYNC_MESSAGE_CONTROL1_3(ViewHostMsg_CreateWindow,
                             ViewHostMsg_CreateWindow_Params,
                             int /* route_id */,
                             int /* main_frame_route_id */,
-                            int32 /* surface_id */,
                             int64 /* cloned_session_storage_namespace_id */)
 
 // Similar to ViewHostMsg_CreateWindow, except used for sub-widgets, like
 // <select> dropdowns.  This message is sent to the WebContentsImpl that
 // contains the widget being created.
-IPC_SYNC_MESSAGE_CONTROL2_2(ViewHostMsg_CreateWidget,
+IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_CreateWidget,
                             int /* opener_id */,
                             blink::WebPopupType /* popup type */,
-                            int /* route_id */,
-                            int32 /* surface_id */)
+                            int /* route_id */)
 
 // Similar to ViewHostMsg_CreateWidget except the widget is a full screen
 // window.
-IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_CreateFullscreenWidget,
+IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_CreateFullscreenWidget,
                             int /* opener_id */,
-                            int /* route_id */,
-                            int32 /* surface_id */)
+                            int /* route_id */)
 
 // Asks the browser for a unique routing ID.
 IPC_SYNC_MESSAGE_CONTROL0_1(ViewHostMsg_GenerateRoutingID,
diff --git a/content/public/test/mock_render_thread.cc b/content/public/test/mock_render_thread.cc
index 2d6fd6e..a3edec4 100644
--- a/content/public/test/mock_render_thread.cc
+++ b/content/public/test/mock_render_thread.cc
@@ -20,7 +20,6 @@
 
 MockRenderThread::MockRenderThread()
     : routing_id_(0),
-      surface_id_(0),
       opener_id_(0),
       new_window_routing_id_(0),
       new_window_main_frame_routing_id_(0),
@@ -201,11 +200,9 @@
 // The Widget expects to be returned valid route_id.
 void MockRenderThread::OnCreateWidget(int opener_id,
                                       blink::WebPopupType popup_type,
-                                      int* route_id,
-                                      int* surface_id) {
+                                      int* route_id) {
   opener_id_ = opener_id;
   *route_id = routing_id_;
-  *surface_id = surface_id_;
 }
 
 // The View expects to be returned a valid route_id different from its own.
@@ -213,11 +210,9 @@
     const ViewHostMsg_CreateWindow_Params& params,
     int* route_id,
     int* main_frame_route_id,
-    int* surface_id,
     int64* cloned_session_storage_namespace_id) {
   *route_id = new_window_routing_id_;
   *main_frame_route_id = new_window_main_frame_routing_id_;
-  *surface_id = surface_id_;
   *cloned_session_storage_namespace_id = 0;
 }
 
diff --git a/content/public/test/mock_render_thread.h b/content/public/test/mock_render_thread.h
index efcbf759..945dc673 100644
--- a/content/public/test/mock_render_thread.h
+++ b/content/public/test/mock_render_thread.h
@@ -85,10 +85,6 @@
     routing_id_ = id;
   }
 
-  void set_surface_id(int32 id) {
-    surface_id_ = id;
-  }
-
   int32 opener_id() const {
     return opener_id_;
   }
@@ -119,8 +115,7 @@
   // The Widget expects to be returned valid route_id.
   void OnCreateWidget(int opener_id,
                       blink::WebPopupType popup_type,
-                      int* route_id,
-                      int* surface_id);
+                      int* route_id);
 
   // The View expects to be returned a valid route_id different from its own.
   // We do not keep track of the newly created widget in MockRenderThread,
@@ -129,7 +124,6 @@
     const ViewHostMsg_CreateWindow_Params& params,
     int* route_id,
     int* main_frame_route_id,
-    int* surface_id,
     int64* cloned_session_storage_namespace_id);
 
   // The Frame expects to be returned a valid route_id different from its own.
@@ -149,9 +143,6 @@
   // Routing id what will be assigned to the Widget.
   int32 routing_id_;
 
-  // Surface id what will be assigned to the Widget.
-  int32 surface_id_;
-
   // Opener id reported by the Widget.
   int32 opener_id_;
 
diff --git a/content/public/test/render_view_test.cc b/content/public/test/render_view_test.cc
index 3bc31c8..8b440a4e 100644
--- a/content/public/test/render_view_test.cc
+++ b/content/public/test/render_view_test.cc
@@ -63,7 +63,6 @@
 const int32 kMainFrameRouteId = 6;
 const int32 kNewWindowRouteId = 7;
 const int32 kNewFrameRouteId = 10;
-const int32 kSurfaceId = 42;
 
 // Converts |ascii_character| into |key_code| and returns true on success.
 // Handles only the characters needed by tests.
@@ -207,7 +206,6 @@
   if (!render_thread_)
     render_thread_.reset(new MockRenderThread());
   render_thread_->set_routing_id(kRouteId);
-  render_thread_->set_surface_id(kSurfaceId);
   render_thread_->set_new_window_routing_id(kNewWindowRouteId);
   render_thread_->set_new_frame_routing_id(kNewFrameRouteId);
 
@@ -246,7 +244,6 @@
   view_params.web_preferences = WebPreferences();
   view_params.view_id = kRouteId;
   view_params.main_frame_routing_id = kMainFrameRouteId;
-  view_params.surface_id = kSurfaceId;
   view_params.session_storage_namespace_id = kInvalidSessionStorageNamespaceId;
   view_params.swapped_out = false;
   view_params.replicated_frame_state = FrameReplicationState();
diff --git a/content/renderer/android/synchronous_compositor_factory.h b/content/renderer/android/synchronous_compositor_factory.h
index 6564299d..9a41d07 100644
--- a/content/renderer/android/synchronous_compositor_factory.h
+++ b/content/renderer/android/synchronous_compositor_factory.h
@@ -49,7 +49,6 @@
   GetCompositorTaskRunner() = 0;
   virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(
       int routing_id,
-      int surface_id,
       scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue) = 0;
 
   // The factory maintains ownership of the returned interface.
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 1915ee9c..89ea420 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -608,9 +608,8 @@
   if (widget_params.routing_id != MSG_ROUTING_NONE) {
     CHECK(SiteIsolationPolicy::AreCrossProcessFramesPossible());
     render_frame->render_widget_ = RenderWidget::CreateForFrame(
-        widget_params.routing_id, widget_params.surface_id,
-        widget_params.hidden, render_frame->render_view_->screen_info(),
-        compositor_deps, web_frame);
+        widget_params.routing_id, widget_params.hidden,
+        render_frame->render_view_->screen_info(), compositor_deps, web_frame);
     // TODO(kenrb): Observing shouldn't be necessary when we sort out
     // WasShown and WasHidden, separating page-level visibility from
     // frame-level visibility.
diff --git a/content/renderer/render_frame_impl_browsertest.cc b/content/renderer/render_frame_impl_browsertest.cc
index 9646ba1..f8f8727 100644
--- a/content/renderer/render_frame_impl_browsertest.cc
+++ b/content/renderer/render_frame_impl_browsertest.cc
@@ -20,7 +20,6 @@
 const int32 kSubframeRouteId = 20;
 const int32 kSubframeWidgetRouteId = 21;
 const int32 kFrameProxyRouteId = 22;
-const int32 kSubframeSurfaceId = 43;
 }  // namespace
 
 namespace content {
@@ -39,7 +38,6 @@
 
     FrameMsg_NewFrame_WidgetParams widget_params;
     widget_params.routing_id = kSubframeWidgetRouteId;
-    widget_params.surface_id = kSubframeSurfaceId;
     widget_params.hidden = false;
 
     IsolateAllSitesForTesting(base::CommandLine::ForCurrentProcess());
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 5c2a187..c0ef9d4c 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -667,7 +667,6 @@
 void RenderViewImpl::Initialize(const ViewMsg_New_Params& params,
                                 bool was_created_by_renderer) {
   routing_id_ = params.view_id;
-  surface_id_ = params.surface_id;
 
   int opener_view_routing_id;
   WebFrame* opener_frame = RenderFrameImpl::ResolveOpener(
@@ -1594,12 +1593,11 @@
 
   int32 routing_id = MSG_ROUTING_NONE;
   int32 main_frame_routing_id = MSG_ROUTING_NONE;
-  int32 surface_id = 0;
   int64 cloned_session_storage_namespace_id = 0;
 
-  RenderThread::Get()->Send(new ViewHostMsg_CreateWindow(
-      params, &routing_id, &main_frame_routing_id, &surface_id,
-      &cloned_session_storage_namespace_id));
+  RenderThread::Get()->Send(
+      new ViewHostMsg_CreateWindow(params, &routing_id, &main_frame_routing_id,
+                                   &cloned_session_storage_namespace_id));
   if (routing_id == MSG_ROUTING_NONE)
     return NULL;
 
@@ -1630,7 +1628,6 @@
   view_params.web_preferences = webkit_preferences_;
   view_params.view_id = routing_id;
   view_params.main_frame_routing_id = main_frame_routing_id;
-  view_params.surface_id = surface_id;
   view_params.session_storage_namespace_id =
       cloned_session_storage_namespace_id;
   view_params.swapped_out = false;
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index ee9e909f..44d2aaa8 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -482,7 +482,6 @@
                            bool hidden,
                            bool never_visible)
     : routing_id_(MSG_ROUTING_NONE),
-      surface_id_(0),
       compositor_deps_(compositor_deps),
       webwidget_(nullptr),
       opener_id_(MSG_ROUTING_NONE),
@@ -559,7 +558,6 @@
 // static
 RenderWidget* RenderWidget::CreateForFrame(
     int routing_id,
-    int surface_id,
     bool hidden,
     const blink::WebScreenInfo& screen_info,
     CompositorDependencies* compositor_deps,
@@ -569,7 +567,6 @@
       new RenderWidget(compositor_deps, blink::WebPopupTypeNone, screen_info,
                        false, hidden, false));
   widget->routing_id_ = routing_id;
-  widget->surface_id_ = surface_id;
   widget->for_oopif_ = true;
   // DoInit increments the reference count on |widget|, keeping it alive after
   // this function returns.
@@ -607,9 +604,9 @@
 }
 
 bool RenderWidget::Init(int32 opener_id) {
-  return DoInit(opener_id, RenderWidget::CreateWebWidget(this),
-                new ViewHostMsg_CreateWidget(opener_id, popup_type_,
-                                             &routing_id_, &surface_id_));
+  return DoInit(
+      opener_id, RenderWidget::CreateWebWidget(this),
+      new ViewHostMsg_CreateWidget(opener_id, popup_type_, &routing_id_));
 }
 
 bool RenderWidget::DoInit(int32 opener_id,
@@ -999,7 +996,7 @@
 #if defined(OS_ANDROID)
   if (SynchronousCompositorFactory* factory =
       SynchronousCompositorFactory::GetInstance()) {
-    return factory->CreateOutputSurface(routing_id(), surface_id(),
+    return factory->CreateOutputSurface(routing_id(),
                                         frame_swap_message_queue_);
   }
 #endif
@@ -2389,14 +2386,15 @@
     limits.min_transfer_buffer_size = 64 * 1024;
   }
 
+  // TODO(piman): we still need to create a View command buffer until
+  // crbug.com/526196 is fixed. The surface_id doesn't matter, it just needs to
+  // be !0.
+  const int32 kDummySurfaceId = 1;
   scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context(
-      new WebGraphicsContext3DCommandBufferImpl(surface_id(),
-                                                GetURLForGraphicsContext3D(),
-                                                gpu_channel_host.get(),
-                                                attributes,
-                                                lose_context_when_out_of_memory,
-                                                limits,
-                                                NULL));
+      new WebGraphicsContext3DCommandBufferImpl(
+          kDummySurfaceId, GetURLForGraphicsContext3D(),
+          gpu_channel_host.get(), attributes, lose_context_when_out_of_memory,
+          limits, NULL));
   return context.Pass();
 }
 
diff --git a/content/renderer/render_widget.h b/content/renderer/render_widget.h
index 610a0b5f..1e7a3b96 100644
--- a/content/renderer/render_widget.h
+++ b/content/renderer/render_widget.h
@@ -112,7 +112,6 @@
 
   // Creates a new RenderWidget that will be attached to a RenderFrame.
   static RenderWidget* CreateForFrame(int routing_id,
-                                      int surface_id,
                                       bool hidden,
                                       const blink::WebScreenInfo& screen_info,
                                       CompositorDependencies* compositor_deps,
@@ -122,7 +121,6 @@
   void CloseForFrame();
 
   int32 routing_id() const { return routing_id_; }
-  int32 surface_id() const { return surface_id_; }
   CompositorDependencies* compositor_deps() const { return compositor_deps_; }
   blink::WebWidget* webwidget() const { return webwidget_; }
   gfx::Size size() const { return size_; }
@@ -591,8 +589,6 @@
   // RenderWidgetHost. When MSG_ROUTING_NONE, no messages may be sent.
   int32 routing_id_;
 
-  int32 surface_id_;
-
   // Dependencies for initializing a compositor, including flags for optional
   // features.
   CompositorDependencies* const compositor_deps_;
diff --git a/content/renderer/render_widget_fullscreen.cc b/content/renderer/render_widget_fullscreen.cc
index 20d4859..4317324 100644
--- a/content/renderer/render_widget_fullscreen.cc
+++ b/content/renderer/render_widget_fullscreen.cc
@@ -43,9 +43,9 @@
 bool RenderWidgetFullscreen::Init(int32 opener_id) {
   DCHECK(!webwidget_);
 
-  return RenderWidget::DoInit(opener_id, CreateWebWidget(),
-                              new ViewHostMsg_CreateFullscreenWidget(
-                                  opener_id, &routing_id_, &surface_id_));
+  return RenderWidget::DoInit(
+      opener_id, CreateWebWidget(),
+      new ViewHostMsg_CreateFullscreenWidget(opener_id, &routing_id_));
 }
 
 }  // namespace content
diff --git a/content/test/test_render_frame_host.cc b/content/test/test_render_frame_host.cc
index 574ca8f..db0dd6c 100644
--- a/content/test/test_render_frame_host.cc
+++ b/content/test/test_render_frame_host.cc
@@ -48,7 +48,6 @@
                                          FrameTreeNode* frame_tree_node,
                                          int32 routing_id,
                                          int32 widget_routing_id,
-                                         int32 surface_id,
                                          int flags)
     : RenderFrameHostImpl(site_instance,
                           render_view_host,
@@ -58,7 +57,6 @@
                           frame_tree_node,
                           routing_id,
                           widget_routing_id,
-                          surface_id,
                           flags),
       child_creation_observer_(delegate ? delegate->GetAsWebContents() : NULL),
       contents_mime_type_("text/html"),
diff --git a/content/test/test_render_frame_host.h b/content/test/test_render_frame_host.h
index f178117..22a4a8e 100644
--- a/content/test/test_render_frame_host.h
+++ b/content/test/test_render_frame_host.h
@@ -44,7 +44,6 @@
                       FrameTreeNode* frame_tree_node,
                       int32 routing_id,
                       int32 widget_routing_id,
-                      int32 surface_id,
                       int flags);
   ~TestRenderFrameHost() override;
 
diff --git a/content/test/test_render_frame_host_factory.cc b/content/test/test_render_frame_host_factory.cc
index d36234b..c47de863 100644
--- a/content/test/test_render_frame_host_factory.cc
+++ b/content/test/test_render_frame_host_factory.cc
@@ -29,11 +29,10 @@
     FrameTreeNode* frame_tree_node,
     int32 routing_id,
     int32 widget_routing_id,
-    int32 surface_id,
     int flags) {
   return make_scoped_ptr(new TestRenderFrameHost(
       site_instance, render_view_host, delegate, rwh_delegate, frame_tree,
-      frame_tree_node, routing_id, widget_routing_id, surface_id, flags));
+      frame_tree_node, routing_id, widget_routing_id, flags));
 }
 
 }  // namespace content
diff --git a/content/test/test_render_frame_host_factory.h b/content/test/test_render_frame_host_factory.h
index 08d2f3e..716ef1b 100644
--- a/content/test/test_render_frame_host_factory.h
+++ b/content/test/test_render_frame_host_factory.h
@@ -33,7 +33,6 @@
       FrameTreeNode* frame_tree_node,
       int32 routing_id,
       int32 widget_routing_id,
-      int32 surface_id,
       int flags) override;
 
  private:
diff --git a/content/test/test_render_view_host.cc b/content/test/test_render_view_host.cc
index 6e97da1..7965387 100644
--- a/content/test/test_render_view_host.cc
+++ b/content/test/test_render_view_host.cc
@@ -215,14 +215,12 @@
     RenderViewHostDelegate* delegate,
     RenderWidgetHostDelegate* widget_delegate,
     int32 routing_id,
-    int32 surface_id,
     int32 main_frame_routing_id,
     bool swapped_out)
     : RenderViewHostImpl(instance,
                          delegate,
                          widget_delegate,
                          routing_id,
-                         surface_id,
                          main_frame_routing_id,
                          swapped_out,
                          false /* hidden */,
diff --git a/content/test/test_render_view_host.h b/content/test/test_render_view_host.h
index 88655ab..16eb6fc 100644
--- a/content/test/test_render_view_host.h
+++ b/content/test/test_render_view_host.h
@@ -206,7 +206,6 @@
                      RenderViewHostDelegate* delegate,
                      RenderWidgetHostDelegate* widget_delegate,
                      int32 routing_id,
-                     int32 surface_id,
                      int32 main_frame_routing_id,
                      bool swapped_out);
   ~TestRenderViewHost() override;
diff --git a/content/test/test_render_view_host_factory.cc b/content/test/test_render_view_host_factory.cc
index 050ca2e..1169e9f 100644
--- a/content/test/test_render_view_host_factory.cc
+++ b/content/test/test_render_view_host_factory.cc
@@ -31,11 +31,10 @@
     RenderViewHostDelegate* delegate,
     RenderWidgetHostDelegate* widget_delegate,
     int32 routing_id,
-    int32 surface_id,
     int32 main_frame_routing_id,
     bool swapped_out) {
   return new TestRenderViewHost(instance, delegate, widget_delegate, routing_id,
-                                surface_id, main_frame_routing_id, swapped_out);
+                                main_frame_routing_id, swapped_out);
 }
 
 }  // namespace content
diff --git a/content/test/test_render_view_host_factory.h b/content/test/test_render_view_host_factory.h
index cb6757bf4..e17c16f3 100644
--- a/content/test/test_render_view_host_factory.h
+++ b/content/test/test_render_view_host_factory.h
@@ -32,7 +32,6 @@
       RenderViewHostDelegate* delegate,
       RenderWidgetHostDelegate* widget_delegate,
       int32 routing_id,
-      int32 surface_id,
       int32 main_frame_routing_id,
       bool swapped_out) override;
 
diff --git a/content/test/test_web_contents.cc b/content/test/test_web_contents.cc
index 1a75729..b8d0092b 100644
--- a/content/test/test_web_contents.cc
+++ b/content/test/test_web_contents.cc
@@ -309,12 +309,10 @@
 
 void TestWebContents::CreateNewWidget(int32 render_process_id,
                                       int32 route_id,
-                                      int32 surface_id,
                                       blink::WebPopupType popup_type) {}
 
 void TestWebContents::CreateNewFullscreenWidget(int32 render_process_id,
-                                                int32 route_id,
-                                                int32 surface_id) {}
+                                                int32 route_id) {}
 
 void TestWebContents::ShowCreatedWindow(int route_id,
                                         WindowOpenDisposition disposition,
diff --git a/content/test/test_web_contents.h b/content/test/test_web_contents.h
index 79c3d0f..62910198 100644
--- a/content/test/test_web_contents.h
+++ b/content/test/test_web_contents.h
@@ -123,11 +123,9 @@
       SessionStorageNamespace* session_storage_namespace) override;
   void CreateNewWidget(int32 render_process_id,
                        int32 route_id,
-                       int32 surface_id,
                        blink::WebPopupType popup_type) override;
   void CreateNewFullscreenWidget(int32 render_process_id,
-                                 int32 route_id,
-                                 int32 surface_id) override;
+                                 int32 route_id) override;
   void ShowCreatedWindow(int route_id,
                          WindowOpenDisposition disposition,
                          const gfx::Rect& initial_rect,