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

Unified Diff: cc/tiles/software_image_decode_controller_unittest.cc

Issue 1866043006: cc: Remove ScheduleOnOriginThread() and CompleteOnOriginThread(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: wip 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/tiles/software_image_decode_controller_unittest.cc
diff --git a/cc/tiles/software_image_decode_controller_unittest.cc b/cc/tiles/software_image_decode_controller_unittest.cc
index 38246b38398a20307d639ee76bde98d8a204badd..35f8e3fc4a770303d6a076f2d1d6bfcd62a8c3f1 100644
--- a/cc/tiles/software_image_decode_controller_unittest.cc
+++ b/cc/tiles/software_image_decode_controller_unittest.cc
@@ -504,9 +504,6 @@ TEST(SoftwareImageDecodeControllerTest, GetTaskForImageAlreadyDecoded) {
EXPECT_TRUE(need_unref);
EXPECT_TRUE(task);
- task->WillSchedule();
- task->ScheduleOnOriginThread(nullptr);
- task->DidSchedule();
task->RunOnWorkerThread();
scoped_refptr<ImageDecodeTask> another_task;
@@ -515,8 +512,6 @@ TEST(SoftwareImageDecodeControllerTest, GetTaskForImageAlreadyDecoded) {
EXPECT_TRUE(need_unref);
EXPECT_FALSE(another_task);
- task->WillComplete();
- task->CompleteOnOriginThread(nullptr);
task->DidComplete();
controller.UnrefImage(draw_image);
@@ -539,9 +534,6 @@ TEST(SoftwareImageDecodeControllerTest, GetTaskForImageAlreadyPrerolled) {
EXPECT_TRUE(need_unref);
EXPECT_TRUE(task);
- task->WillSchedule();
- task->ScheduleOnOriginThread(nullptr);
- task->DidSchedule();
task->RunOnWorkerThread();
scoped_refptr<ImageDecodeTask> another_task;
@@ -550,8 +542,6 @@ TEST(SoftwareImageDecodeControllerTest, GetTaskForImageAlreadyPrerolled) {
EXPECT_TRUE(need_unref);
EXPECT_FALSE(another_task);
- task->WillComplete();
- task->CompleteOnOriginThread(nullptr);
task->DidComplete();
scoped_refptr<ImageDecodeTask> third_task;
@@ -576,15 +566,12 @@ TEST(SoftwareImageDecodeControllerTest, GetTaskForImageCanceledGetsNewTask) {
image.get(), SkIRect::MakeWH(image->width(), image->height()), quality,
CreateMatrix(SkSize::Make(0.5f, 0.5f), is_decomposable));
scoped_refptr<ImageDecodeTask> task;
+ LOG(INFO) << "PRAS1::" << __FUNCTION__;
bool need_unref =
controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &task);
EXPECT_TRUE(need_unref);
EXPECT_TRUE(task);
-
- task->WillSchedule();
- task->ScheduleOnOriginThread(nullptr);
- task->DidSchedule();
-
+ LOG(INFO) << "PRAS2::" << __FUNCTION__;
scoped_refptr<ImageDecodeTask> another_task;
need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id,
&another_task);
@@ -592,14 +579,13 @@ TEST(SoftwareImageDecodeControllerTest, GetTaskForImageCanceledGetsNewTask) {
EXPECT_TRUE(another_task.get() == task.get());
// Didn't run the task, complete it (it was canceled).
- task->WillComplete();
- task->CompleteOnOriginThread(nullptr);
task->DidComplete();
+ task->Release();
// Fully cancel everything (so the raster would unref things).
controller.UnrefImage(draw_image);
controller.UnrefImage(draw_image);
-
+ LOG(INFO) << "PRAS3::" << __FUNCTION__;
// Here a new task is created.
scoped_refptr<ImageDecodeTask> third_task;
need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id,
@@ -628,10 +614,6 @@ TEST(SoftwareImageDecodeControllerTest,
EXPECT_TRUE(need_unref);
EXPECT_TRUE(task);
- task->WillSchedule();
- task->ScheduleOnOriginThread(nullptr);
- task->DidSchedule();
-
scoped_refptr<ImageDecodeTask> another_task;
need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id,
&another_task);
@@ -639,8 +621,6 @@ TEST(SoftwareImageDecodeControllerTest,
EXPECT_TRUE(another_task.get() == task.get());
// Didn't run the task, complete it (it was canceled).
- task->WillComplete();
- task->CompleteOnOriginThread(nullptr);
task->DidComplete();
// Note that here, everything is reffed, but a new task is created. This is
@@ -674,14 +654,8 @@ TEST(SoftwareImageDecodeControllerTest, GetDecodedImageForDraw) {
EXPECT_TRUE(need_unref);
EXPECT_TRUE(task);
- task->WillSchedule();
- task->ScheduleOnOriginThread(nullptr);
- task->DidSchedule();
-
task->RunOnWorkerThread();
- task->WillComplete();
- task->CompleteOnOriginThread(nullptr);
task->DidComplete();
DecodedDrawImage decoded_draw_image =
@@ -716,14 +690,8 @@ TEST(SoftwareImageDecodeControllerTest,
EXPECT_TRUE(need_unref);
EXPECT_TRUE(task);
- task->WillSchedule();
- task->ScheduleOnOriginThread(nullptr);
- task->DidSchedule();
-
task->RunOnWorkerThread();
- task->WillComplete();
- task->CompleteOnOriginThread(nullptr);
task->DidComplete();
DecodedDrawImage decoded_draw_image =
@@ -825,14 +793,8 @@ TEST(SoftwareImageDecodeControllerTest,
EXPECT_TRUE(need_unref);
EXPECT_TRUE(task);
- task->WillSchedule();
- task->ScheduleOnOriginThread(nullptr);
- task->DidSchedule();
-
task->RunOnWorkerThread();
- task->WillComplete();
- task->CompleteOnOriginThread(nullptr);
task->DidComplete();
DecodedDrawImage another_decoded_draw_image =
@@ -879,18 +841,12 @@ TEST(SoftwareImageDecodeControllerTest,
EXPECT_TRUE(need_unref);
EXPECT_TRUE(task);
- task->WillSchedule();
- task->ScheduleOnOriginThread(nullptr);
- task->DidSchedule();
-
// If we finish the draw here, then we will use it for the locked decode
// instead of decoding again.
controller.DrawWithImageFinished(draw_image, decoded_draw_image);
task->RunOnWorkerThread();
- task->WillComplete();
- task->CompleteOnOriginThread(nullptr);
task->DidComplete();
DecodedDrawImage another_decoded_draw_image =

Powered by Google App Engine
This is Rietveld 408576698