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

Unified Diff: third_party/WebKit/Source/platform/scheduler/CancellableTaskFactoryTest.cpp

Issue 1915153004: [K5] Replace bind() + non-GC pointers with unretained() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Kuroneko_4
Patch Set: Rebase 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: third_party/WebKit/Source/platform/scheduler/CancellableTaskFactoryTest.cpp
diff --git a/third_party/WebKit/Source/platform/scheduler/CancellableTaskFactoryTest.cpp b/third_party/WebKit/Source/platform/scheduler/CancellableTaskFactoryTest.cpp
index 905ae12655c3851f25df9111ed9d9cc62726209d..294f50d9d6a88d84bf6d90f983d464887413e211 100644
--- a/third_party/WebKit/Source/platform/scheduler/CancellableTaskFactoryTest.cpp
+++ b/third_party/WebKit/Source/platform/scheduler/CancellableTaskFactoryTest.cpp
@@ -99,7 +99,7 @@ void AddOne(int* ptr)
TEST_F(CancellableTaskFactoryTest, Run_ClosureIsExecuted)
{
int executionCount = 0;
- TestCancellableTaskFactory factory(WTF::bind(&AddOne, &executionCount));
+ TestCancellableTaskFactory factory(WTF::bind(&AddOne, unretained(&executionCount)));
OwnPtr<WebTaskRunner::Task> task = adoptPtr(factory.cancelAndCreate());
task->run();
@@ -109,7 +109,7 @@ TEST_F(CancellableTaskFactoryTest, Run_ClosureIsExecuted)
TEST_F(CancellableTaskFactoryTest, Run_ClosureIsExecutedOnlyOnce)
{
int executionCount = 0;
- TestCancellableTaskFactory factory(WTF::bind(&AddOne, &executionCount));
+ TestCancellableTaskFactory factory(WTF::bind(&AddOne, unretained(&executionCount)));
OwnPtr<WebTaskRunner::Task> task = adoptPtr(factory.cancelAndCreate());
task->run();
task->run();
@@ -124,7 +124,7 @@ TEST_F(CancellableTaskFactoryTest, Run_FactoryDestructionPreventsExecution)
int executionCount = 0;
OwnPtr<WebTaskRunner::Task> task;
{
- TestCancellableTaskFactory factory(WTF::bind(&AddOne, &executionCount));
+ TestCancellableTaskFactory factory(WTF::bind(&AddOne, unretained(&executionCount)));
task = adoptPtr(factory.cancelAndCreate());
}
task->run();
@@ -135,7 +135,7 @@ TEST_F(CancellableTaskFactoryTest, Run_FactoryDestructionPreventsExecution)
TEST_F(CancellableTaskFactoryTest, Run_TasksInSequence)
{
int executionCount = 0;
- TestCancellableTaskFactory factory(WTF::bind(&AddOne, &executionCount));
+ TestCancellableTaskFactory factory(WTF::bind(&AddOne, unretained(&executionCount)));
OwnPtr<WebTaskRunner::Task> taskA = adoptPtr(factory.cancelAndCreate());
taskA->run();
@@ -153,7 +153,7 @@ TEST_F(CancellableTaskFactoryTest, Run_TasksInSequence)
TEST_F(CancellableTaskFactoryTest, Cancel)
{
int executionCount = 0;
- TestCancellableTaskFactory factory(WTF::bind(&AddOne, &executionCount));
+ TestCancellableTaskFactory factory(WTF::bind(&AddOne, unretained(&executionCount)));
OwnPtr<WebTaskRunner::Task> task = adoptPtr(factory.cancelAndCreate());
factory.cancel();
task->run();
@@ -164,7 +164,7 @@ TEST_F(CancellableTaskFactoryTest, Cancel)
TEST_F(CancellableTaskFactoryTest, CreatingANewTaskCancelsPreviousOnes)
{
int executionCount = 0;
- TestCancellableTaskFactory factory(WTF::bind(&AddOne, &executionCount));
+ TestCancellableTaskFactory factory(WTF::bind(&AddOne, unretained(&executionCount)));
OwnPtr<WebTaskRunner::Task> taskA = adoptPtr(factory.cancelAndCreate());
OwnPtr<WebTaskRunner::Task> taskB = adoptPtr(factory.cancelAndCreate());

Powered by Google App Engine
This is Rietveld 408576698