| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/renderer/scheduler/task_queue_manager.h" | 5 #include "content/renderer/scheduler/task_queue_manager.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/debug/trace_event_argument.h" | 9 #include "base/debug/trace_event_argument.h" |
| 10 #include "content/renderer/scheduler/task_queue_selector.h" | 10 #include "content/renderer/scheduler/task_queue_selector.h" |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 | 224 |
| 225 // static | 225 // static |
| 226 void TaskQueue::TaskAsValueInto(const base::PendingTask& task, | 226 void TaskQueue::TaskAsValueInto(const base::PendingTask& task, |
| 227 base::debug::TracedValue* state) { | 227 base::debug::TracedValue* state) { |
| 228 state->BeginDictionary(); | 228 state->BeginDictionary(); |
| 229 state->SetString("posted_from", task.posted_from.ToString()); | 229 state->SetString("posted_from", task.posted_from.ToString()); |
| 230 state->SetInteger("sequence_num", task.sequence_num); | 230 state->SetInteger("sequence_num", task.sequence_num); |
| 231 state->SetBoolean("nestable", task.nestable); | 231 state->SetBoolean("nestable", task.nestable); |
| 232 state->SetBoolean("is_high_res", task.is_high_res); | 232 state->SetBoolean("is_high_res", task.is_high_res); |
| 233 state->SetDouble( | 233 state->SetDouble( |
| 234 "time_posted", | |
| 235 (task.time_posted - base::TimeTicks()).InMicroseconds() / 1000.0L); | |
| 236 state->SetDouble( | |
| 237 "delayed_run_time", | 234 "delayed_run_time", |
| 238 (task.delayed_run_time - base::TimeTicks()).InMicroseconds() / 1000.0L); | 235 (task.delayed_run_time - base::TimeTicks()).InMicroseconds() / 1000.0L); |
| 239 state->EndDictionary(); | 236 state->EndDictionary(); |
| 240 } | 237 } |
| 241 | 238 |
| 242 } // namespace internal | 239 } // namespace internal |
| 243 | 240 |
| 244 TaskQueueManager::TaskQueueManager( | 241 TaskQueueManager::TaskQueueManager( |
| 245 size_t task_queue_count, | 242 size_t task_queue_count, |
| 246 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 243 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 state->EndArray(); | 400 state->EndArray(); |
| 404 state->BeginDictionary("selector"); | 401 state->BeginDictionary("selector"); |
| 405 selector_->AsValueInto(state.get()); | 402 selector_->AsValueInto(state.get()); |
| 406 state->EndDictionary(); | 403 state->EndDictionary(); |
| 407 if (should_run) | 404 if (should_run) |
| 408 state->SetInteger("selected_queue", selected_queue); | 405 state->SetInteger("selected_queue", selected_queue); |
| 409 return state; | 406 return state; |
| 410 } | 407 } |
| 411 | 408 |
| 412 } // namespace content | 409 } // namespace content |
| OLD | NEW |