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

Unified Diff: cc/test/fake_tile_manager.cc

Issue 1854723002: cc: Simplify task and its derived classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Corrected scope of dependencies. Created 4 years, 8 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/test/fake_tile_manager.cc
diff --git a/cc/test/fake_tile_manager.cc b/cc/test/fake_tile_manager.cc
index 77b9b0dfbcf2d46359d3ad824ee22dc280a5e615..40e376804e2bb16f4a95ec0355a2aad08286538e 100644
--- a/cc/test/fake_tile_manager.cc
+++ b/cc/test/fake_tile_manager.cc
@@ -12,36 +12,43 @@
#include "base/lazy_instance.h"
#include "base/thread_task_runner_handle.h"
-#include "cc/raster/raster_buffer.h"
#include "cc/raster/tile_task_runner.h"
namespace cc {
namespace {
-class FakeTileTaskRunnerImpl : public TileTaskRunner, public TileTaskClient {
+class FakeTileTaskRunnerImpl : public TileTaskRunner {
public:
+ // Overridden from RasterBufferProvider:
+ scoped_ptr<RasterBuffer> AcquireBufferForRaster(
+ const Resource* resource,
+ uint64_t resource_content_id,
+ uint64_t previous_content_id) override {
+ return nullptr;
+ }
+ void ReleaseBufferForRaster(scoped_ptr<RasterBuffer> buffer) override {}
+
// Overridden from TileTaskRunner:
void Shutdown() override {}
void ScheduleTasks(TaskGraph* graph) override {
for (const auto& node : graph->nodes) {
- RasterTask* task = static_cast<RasterTask*>(node.task);
+ Task* task = node.task;
task->WillSchedule();
- task->ScheduleOnOriginThread(this);
+ task->ScheduleOnOriginThread();
task->DidSchedule();
completed_tasks_.push_back(task);
}
}
void CheckForCompletedTasks() override {
- for (RasterTask::Vector::iterator it = completed_tasks_.begin();
- it != completed_tasks_.end();
- ++it) {
- RasterTask* task = it->get();
+ for (Task::Vector::iterator it = completed_tasks_.begin();
+ it != completed_tasks_.end(); ++it) {
+ Task* task = it->get();
task->WillComplete();
- task->CompleteOnOriginThread(this);
+ task->CompleteOnOriginThread();
task->DidComplete();
}
completed_tasks_.clear();
@@ -53,17 +60,8 @@ class FakeTileTaskRunnerImpl : public TileTaskRunner, public TileTaskClient {
return ResourceFormatRequiresSwizzle(GetResourceFormat(must_support_alpha));
}
- // Overridden from TileTaskClient:
- scoped_ptr<RasterBuffer> AcquireBufferForRaster(
- const Resource* resource,
- uint64_t resource_content_id,
- uint64_t previous_content_id) override {
- return nullptr;
- }
- void ReleaseBufferForRaster(scoped_ptr<RasterBuffer> buffer) override {}
-
private:
- RasterTask::Vector completed_tasks_;
+ Task::Vector completed_tasks_;
};
base::LazyInstance<FakeTileTaskRunnerImpl> g_fake_tile_task_runner =
LAZY_INSTANCE_INITIALIZER;

Powered by Google App Engine
This is Rietveld 408576698