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

Unified Diff: third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_perftest.cc

Issue 2326313003: Revert of Make canceling Timers fast. (Closed)
Patch Set: Created 4 years, 3 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/base/task_queue_manager_perftest.cc
diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_perftest.cc b/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_perftest.cc
index b059acc0d8fd45a64df64823cdd2ec519e763d7d..28c4d48a7d7d028912ab5a6cbd6ef73d002f134f 100644
--- a/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_perftest.cc
+++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_perftest.cc
@@ -38,9 +38,11 @@
void Initialize(size_t num_queues) {
num_queues_ = num_queues;
+ message_loop_.reset(new base::MessageLoop());
+ run_loop_.reset(new base::RunLoop());
manager_ = base::MakeUnique<TaskQueueManager>(
TaskQueueManagerDelegateForTest::Create(
- base::MessageLoop::current()->task_runner(),
+ message_loop_->task_runner(),
base::WrapUnique(new base::DefaultTickClock())),
"fake.category", "fake.category", "fake.category.debug");
manager_->AddTaskTimeObserver(&test_task_time_observer_);
@@ -96,7 +98,6 @@
unsigned long long num_iterations = 0;
do {
test_task.Run();
- run_loop_.reset(new base::RunLoop());
run_loop_->Run();
now = base::ThreadTicks::Now();
num_iterations++;
@@ -113,6 +114,7 @@
unsigned int num_tasks_to_post_;
unsigned int num_tasks_to_run_;
std::unique_ptr<TaskQueueManager> manager_;
+ std::unique_ptr<base::MessageLoop> message_loop_;
std::unique_ptr<base::RunLoop> run_loop_;
std::vector<scoped_refptr<base::SingleThreadTaskRunner>> queues_;
// TODO(alexclarke): parameterize so we can measure with and without a

Powered by Google App Engine
This is Rietveld 408576698