| Index: cc/surfaces/surface_aggregator.cc
 | 
| diff --git a/cc/surfaces/surface_aggregator.cc b/cc/surfaces/surface_aggregator.cc
 | 
| index 935b9f7c243217079afe0e7d7ee5b382dd02f22f..46b158450de7198f88169501d4fc8ad3b8d7cc98 100644
 | 
| --- a/cc/surfaces/surface_aggregator.cc
 | 
| +++ b/cc/surfaces/surface_aggregator.cc
 | 
| @@ -25,6 +25,7 @@
 | 
|  #include "cc/quads/surface_draw_quad.h"
 | 
|  #include "cc/quads/texture_draw_quad.h"
 | 
|  #include "cc/resources/resource_provider.h"
 | 
| +#include "cc/surfaces/compositor_frame_sink_support.h"
 | 
|  #include "cc/surfaces/surface.h"
 | 
|  #include "cc/surfaces/surface_manager.h"
 | 
|  #include "cc/trees/blocking_task_runner.h"
 | 
| @@ -120,11 +121,12 @@ SurfaceAggregator::ClipData SurfaceAggregator::CalculateClipRect(
 | 
|    return out_clip;
 | 
|  }
 | 
|  
 | 
| -static void UnrefHelper(base::WeakPtr<SurfaceFactory> surface_factory,
 | 
| -                        const ReturnedResourceArray& resources,
 | 
| -                        BlockingTaskRunner* main_thread_task_runner) {
 | 
| -  if (surface_factory)
 | 
| -    surface_factory->UnrefResources(resources);
 | 
| +static void UnrefHelper(
 | 
| +    base::WeakPtr<CompositorFrameSinkSupport> compositor_frame_sink_support,
 | 
| +    const ReturnedResourceArray& resources,
 | 
| +    BlockingTaskRunner* main_thread_task_runner) {
 | 
| +  if (compositor_frame_sink_support)
 | 
| +    compositor_frame_sink_support->UnrefResources(resources);
 | 
|  }
 | 
|  
 | 
|  int SurfaceAggregator::RemapPassId(int surface_local_pass_id,
 | 
| @@ -145,11 +147,12 @@ int SurfaceAggregator::RemapPassId(int surface_local_pass_id,
 | 
|  int SurfaceAggregator::ChildIdForSurface(Surface* surface) {
 | 
|    auto it = surface_id_to_resource_child_id_.find(surface->surface_id());
 | 
|    if (it == surface_id_to_resource_child_id_.end()) {
 | 
| -    int child_id =
 | 
| -        provider_->CreateChild(base::Bind(&UnrefHelper, surface->factory()));
 | 
| -    if (surface->factory()) {
 | 
| +    int child_id = provider_->CreateChild(
 | 
| +        base::Bind(&UnrefHelper, surface->compositor_frame_sink_support()));
 | 
| +    if (surface->compositor_frame_sink_support()) {
 | 
|        provider_->SetChildNeedsSyncTokens(
 | 
| -          child_id, surface->factory()->needs_sync_points());
 | 
| +          child_id,
 | 
| +          surface->compositor_frame_sink_support()->needs_sync_points());
 | 
|      }
 | 
|      surface_id_to_resource_child_id_[surface->surface_id()] = child_id;
 | 
|      return child_id;
 | 
| @@ -609,8 +612,9 @@ gfx::Rect SurfaceAggregator::PrewalkTree(const SurfaceId& surface_id,
 | 
|    // TODO(jbauman): hack for unit tests that don't set up rp
 | 
|    if (provider_) {
 | 
|      child_id = ChildIdForSurface(surface);
 | 
| -    if (surface->factory())
 | 
| -      surface->factory()->RefResources(frame.resource_list);
 | 
| +    if (surface->compositor_frame_sink_support())
 | 
| +      surface->compositor_frame_sink_support()->RefResources(
 | 
| +          frame.resource_list);
 | 
|      provider_->ReceiveFromChild(child_id, frame.resource_list);
 | 
|    }
 | 
|    CHECK(debug_weak_this.get());
 | 
| 
 |