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

Side by Side Diff: third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc

Issue 2118903002: scheduler: Move the Blink scheduler into Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Another GYP fix Created 4 years, 5 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 "platform/scheduler/base/task_queue_impl.h"
6 6
7 #include "base/trace_event/blame_context.h" 7 #include "base/trace_event/blame_context.h"
8 #include "components/scheduler/base/task_queue_manager.h" 8 #include "platform/scheduler/base/task_queue_manager.h"
9 #include "components/scheduler/base/task_queue_manager_delegate.h" 9 #include "platform/scheduler/base/task_queue_manager_delegate.h"
10 #include "components/scheduler/base/time_domain.h" 10 #include "platform/scheduler/base/time_domain.h"
11 #include "components/scheduler/base/work_queue.h" 11 #include "platform/scheduler/base/work_queue.h"
12 12
13 namespace blink {
13 namespace scheduler { 14 namespace scheduler {
14 namespace internal { 15 namespace internal {
15 16
16 TaskQueueImpl::TaskQueueImpl( 17 TaskQueueImpl::TaskQueueImpl(
17 TaskQueueManager* task_queue_manager, 18 TaskQueueManager* task_queue_manager,
18 TimeDomain* time_domain, 19 TimeDomain* time_domain,
19 const Spec& spec, 20 const Spec& spec,
20 const char* disabled_by_default_tracing_category, 21 const char* disabled_by_default_tracing_category,
21 const char* disabled_by_default_verbose_tracing_category) 22 const char* disabled_by_default_verbose_tracing_category)
22 : thread_id_(base::PlatformThread::CurrentId()), 23 : thread_id_(base::PlatformThread::CurrentId()),
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 main_thread_only().delayed_incoming_queue.size()); 577 main_thread_only().delayed_incoming_queue.size());
577 state->SetInteger("immediate_work_queue_size", 578 state->SetInteger("immediate_work_queue_size",
578 main_thread_only().immediate_work_queue->Size()); 579 main_thread_only().immediate_work_queue->Size());
579 state->SetInteger("delayed_work_queue_size", 580 state->SetInteger("delayed_work_queue_size",
580 main_thread_only().delayed_work_queue->Size()); 581 main_thread_only().delayed_work_queue->Size());
581 if (!main_thread_only().delayed_incoming_queue.empty()) { 582 if (!main_thread_only().delayed_incoming_queue.empty()) {
582 base::TimeDelta delay_to_next_task = 583 base::TimeDelta delay_to_next_task =
583 (main_thread_only().delayed_incoming_queue.top().delayed_run_time - 584 (main_thread_only().delayed_incoming_queue.top().delayed_run_time -
584 main_thread_only().time_domain->CreateLazyNow().Now()); 585 main_thread_only().time_domain->CreateLazyNow().Now());
585 state->SetDouble("delay_to_next_task_ms", 586 state->SetDouble("delay_to_next_task_ms",
586 delay_to_next_task.InMillisecondsF()); 587 delay_to_next_task.InMillisecondsF());
587 } 588 }
588 if (verbose_tracing_enabled) { 589 if (verbose_tracing_enabled) {
589 state->BeginArray("immediate_incoming_queue"); 590 state->BeginArray("immediate_incoming_queue");
590 QueueAsValueInto(any_thread().immediate_incoming_queue, state); 591 QueueAsValueInto(any_thread().immediate_incoming_queue, state);
591 state->EndArray(); 592 state->EndArray();
592 state->BeginArray("delayed_work_queue"); 593 state->BeginArray("delayed_work_queue");
593 main_thread_only().delayed_work_queue->AsValueInto(state); 594 main_thread_only().delayed_work_queue->AsValueInto(state);
594 state->EndArray(); 595 state->EndArray();
595 state->BeginArray("immediate_work_queue"); 596 state->BeginArray("immediate_work_queue");
596 main_thread_only().immediate_work_queue->AsValueInto(state); 597 main_thread_only().immediate_work_queue->AsValueInto(state);
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 state->SetBoolean("nestable", task.nestable); 712 state->SetBoolean("nestable", task.nestable);
712 state->SetBoolean("is_high_res", task.is_high_res); 713 state->SetBoolean("is_high_res", task.is_high_res);
713 state->SetDouble( 714 state->SetDouble(
714 "delayed_run_time", 715 "delayed_run_time",
715 (task.delayed_run_time - base::TimeTicks()).InMicroseconds() / 1000.0L); 716 (task.delayed_run_time - base::TimeTicks()).InMicroseconds() / 1000.0L);
716 state->EndDictionary(); 717 state->EndDictionary();
717 } 718 }
718 719
719 } // namespace internal 720 } // namespace internal
720 } // namespace scheduler 721 } // namespace scheduler
722 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698