Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(577)

Unified Diff: cc/surfaces/surface_aggregator.cc

Issue 485043003: cc: Use correct message loop proxy in BlockingTaskRunner (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Help gn deal with it. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/surfaces/surface_aggregator.cc
diff --git a/cc/surfaces/surface_aggregator.cc b/cc/surfaces/surface_aggregator.cc
index 5ddd832d09a6b31fb813559819f624d011fb65c8..7c42fdcf544ed1a458845dbfd4b9fed2ef5a3fa3 100644
--- a/cc/surfaces/surface_aggregator.cc
+++ b/cc/surfaces/surface_aggregator.cc
@@ -18,6 +18,7 @@
#include "cc/surfaces/surface.h"
#include "cc/surfaces/surface_factory.h"
#include "cc/surfaces/surface_manager.h"
+#include "cc/trees/blocking_task_runner.h"
namespace cc {
@@ -54,6 +55,13 @@ class SurfaceAggregator::RenderPassIdAllocator {
DISALLOW_COPY_AND_ASSIGN(RenderPassIdAllocator);
};
+static void UnrefHelper(
+ base::WeakPtr<SurfaceFactory> surface_factory,
+ const ReturnedResourceArray& resources,
+ scoped_refptr<BlockingTaskRunner> main_thread_task_runner) {
+ surface_factory->UnrefResources(resources);
+}
+
RenderPassId SurfaceAggregator::RemapPassId(RenderPassId surface_local_pass_id,
SurfaceId surface_id) {
RenderPassIdAllocator* allocator = render_pass_allocator_map_.get(surface_id);
@@ -69,8 +77,8 @@ int SurfaceAggregator::ChildIdForSurface(Surface* surface) {
SurfaceToResourceChildIdMap::iterator 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(
- &SurfaceFactory::UnrefResources, surface->factory()->AsWeakPtr()));
+ int child_id = provider_->CreateChild(
+ base::Bind(&UnrefHelper, surface->factory()->AsWeakPtr()));
surface_id_to_resource_child_id_[surface->surface_id()] = child_id;
return child_id;
} else {

Powered by Google App Engine
This is Rietveld 408576698