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

Side by Side Diff: components/scheduler/base/task_queue_impl.cc

Issue 1646583002: [Reland] Per WebViewScheduler virtual time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: WebViewSchedulerImpl to unregister the virtual_time_domain_ in the destructor Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/scheduler/base/task_queue_impl.h" 5 #include "components/scheduler/base/task_queue_impl.h"
6 6
7 #include "components/scheduler/base/task_queue_manager.h" 7 #include "components/scheduler/base/task_queue_manager.h"
8 #include "components/scheduler/base/task_queue_manager_delegate.h" 8 #include "components/scheduler/base/task_queue_manager_delegate.h"
9 #include "components/scheduler/base/time_domain.h" 9 #include "components/scheduler/base/time_domain.h"
10 #include "components/scheduler/base/work_queue.h" 10 #include "components/scheduler/base/work_queue.h"
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 DCHECK(main_thread_checker_.CalledOnValidThread()); 610 DCHECK(main_thread_checker_.CalledOnValidThread());
611 if (time_domain == main_thread_only().time_domain) 611 if (time_domain == main_thread_only().time_domain)
612 return; 612 return;
613 613
614 if (time_domain) 614 if (time_domain)
615 main_thread_only().time_domain->MigrateQueue(this, time_domain); 615 main_thread_only().time_domain->MigrateQueue(this, time_domain);
616 main_thread_only().time_domain = time_domain; 616 main_thread_only().time_domain = time_domain;
617 any_thread().time_domain = time_domain; 617 any_thread().time_domain = time_domain;
618 } 618 }
619 619
620 TimeDomain* TaskQueueImpl::GetTimeDomain() const {
621 return main_thread_only().time_domain;
622 }
623
620 // static 624 // static
621 void TaskQueueImpl::QueueAsValueInto(const std::queue<Task>& queue, 625 void TaskQueueImpl::QueueAsValueInto(const std::queue<Task>& queue,
622 base::trace_event::TracedValue* state) { 626 base::trace_event::TracedValue* state) {
623 std::queue<Task> queue_copy(queue); 627 std::queue<Task> queue_copy(queue);
624 while (!queue_copy.empty()) { 628 while (!queue_copy.empty()) {
625 TaskAsValueInto(queue_copy.front(), state); 629 TaskAsValueInto(queue_copy.front(), state);
626 queue_copy.pop(); 630 queue_copy.pop();
627 } 631 }
628 } 632 }
629 633
(...skipping 22 matching lines...) Expand all
652 state->SetBoolean("nestable", task.nestable); 656 state->SetBoolean("nestable", task.nestable);
653 state->SetBoolean("is_high_res", task.is_high_res); 657 state->SetBoolean("is_high_res", task.is_high_res);
654 state->SetDouble( 658 state->SetDouble(
655 "delayed_run_time", 659 "delayed_run_time",
656 (task.delayed_run_time - base::TimeTicks()).InMicroseconds() / 1000.0L); 660 (task.delayed_run_time - base::TimeTicks()).InMicroseconds() / 1000.0L);
657 state->EndDictionary(); 661 state->EndDictionary();
658 } 662 }
659 663
660 } // namespace internal 664 } // namespace internal
661 } // namespace scheduler 665 } // namespace scheduler
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698