Commit d76fd852 authored by Alex Clarke's avatar Alex Clarke Committed by Commit Bot

SequenceManager: Remove IsCancelled crash keys

They didn't reveal any leads, and are somewhat expensive.

Bug: 798554, 897751
Change-Id: Id22b59ccd43b823902c48a4b5f324ccea07e9649
Reviewed-on: https://chromium-review.googlesource.com/c/1301463Reviewed-by: default avatarSami Kyöstilä <skyostil@chromium.org>
Reviewed-by: default avatarAlexander Timin <altimin@chromium.org>
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#603082}
parent 5f0760e9
......@@ -723,17 +723,6 @@ WeakPtr<SequenceManagerImpl> SequenceManagerImpl::GetWeakPtr() {
return weak_factory_.GetWeakPtr();
}
bool SequenceManagerImpl::SetCrashKeysAndCheckIsTaskCancelled(
const PendingTask& task) const {
#if !defined(OS_NACL)
debug::SetCrashKeyString(main_thread_only().file_name_crash_key,
task.posted_from.file_name());
debug::SetCrashKeyString(main_thread_only().function_name_crash_key,
task.posted_from.function_name());
#endif // OS_NACL
return task.task.IsCancelled();
}
void SequenceManagerImpl::SetDefaultTaskRunner(
scoped_refptr<SingleThreadTaskRunner> task_runner) {
controller_->SetDefaultTaskRunner(task_runner);
......
......@@ -160,9 +160,6 @@ class BASE_EXPORT SequenceManagerImpl
WeakPtr<SequenceManagerImpl> GetWeakPtr();
// TODO(alexclarke): Remove when possible.
bool SetCrashKeysAndCheckIsTaskCancelled(const PendingTask& task) const;
protected:
// Create a task queue manager where |controller| controls the thread
// on which the tasks are eventually run.
......
......@@ -417,15 +417,10 @@ Optional<TimeTicks> TaskQueueImpl::GetNextScheduledWakeUp() {
void TaskQueueImpl::WakeUpForDelayedWork(LazyNow* lazy_now) {
// Enqueue all delayed tasks that should be running now, skipping any that
// have been canceled.
const SequenceManagerImpl* sequence_manager =
main_thread_only().sequence_manager;
while (!main_thread_only().delayed_incoming_queue.empty()) {
Task& task =
const_cast<Task&>(main_thread_only().delayed_incoming_queue.top());
// TODO(alexclarke): Use IsCancelled once we've understood the bug.
// See http://crbug.com/798554
if (!task.task ||
sequence_manager->SetCrashKeysAndCheckIsTaskCancelled(task)) {
if (!task.task || task.task.IsCancelled()) {
main_thread_only().delayed_incoming_queue.pop();
continue;
}
......@@ -1040,9 +1035,7 @@ void TaskQueueImpl::DelayedIncomingQueue::SweepCancelledTasks(
const SequenceManagerImpl* sequence_manager) {
std::priority_queue<Task> remaining_tasks;
while (!empty()) {
// TODO(alexclarke): Use IsCancelled once we've understood the bug.
// See http://crbug.com/798554
if (!sequence_manager->SetCrashKeysAndCheckIsTaskCancelled(top())) {
if (!top().task.IsCancelled()) {
if (top().is_high_res)
pending_high_res_tasks_++;
remaining_tasks.push(std::move(const_cast<Task&>(top())));
......
......@@ -156,13 +156,8 @@ Task WorkQueue::TakeTaskFromWorkQueue() {
bool WorkQueue::RemoveAllCanceledTasksFromFront() {
DCHECK(work_queue_sets_);
bool task_removed = false;
const SequenceManagerImpl* sequence_manager = task_queue_->sequence_manager();
// TODO(alexclarke): Use IsCancelled once we've understood the bug.
// See http://crbug.com/798554
while (
!tasks_.empty() &&
(!tasks_.front().task ||
sequence_manager->SetCrashKeysAndCheckIsTaskCancelled(tasks_.front()))) {
while (!tasks_.empty() &&
(!tasks_.front().task || tasks_.front().task.IsCancelled())) {
tasks_.pop_front();
task_removed = true;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment