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

Side by Side Diff: content/renderer/scheduler/task_queue_manager.cc

Issue 959713002: [content]: Don't use task's from_here when posting delayed EnqueueTask on Task Queue Manager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add single thread idle task runner. Created 5 years, 9 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
« no previous file with comments | « content/renderer/scheduler/single_thread_idle_task_runner.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <queue> 7 #include <queue>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 return false; 130 return false;
131 131
132 base::PendingTask pending_task(from_here, task, base::TimeTicks(), 132 base::PendingTask pending_task(from_here, task, base::TimeTicks(),
133 task_type != NON_NESTABLE_TASK_TYPE); 133 task_type != NON_NESTABLE_TASK_TYPE);
134 task_queue_manager_->DidQueueTask(&pending_task); 134 task_queue_manager_->DidQueueTask(&pending_task);
135 135
136 if (delay > base::TimeDelta()) { 136 if (delay > base::TimeDelta()) {
137 pending_task.delayed_run_time = task_queue_manager_->Now() + delay; 137 pending_task.delayed_run_time = task_queue_manager_->Now() + delay;
138 delayed_task_run_times_.push(pending_task.delayed_run_time); 138 delayed_task_run_times_.push(pending_task.delayed_run_time);
139 return task_queue_manager_->PostDelayedTask( 139 return task_queue_manager_->PostDelayedTask(
140 from_here, Bind(&TaskQueue::EnqueueTask, this, pending_task), delay); 140 FROM_HERE, Bind(&TaskQueue::EnqueueTask, this, pending_task), delay);
141 } 141 }
142 EnqueueTaskLocked(pending_task); 142 EnqueueTaskLocked(pending_task);
143 return true; 143 return true;
144 } 144 }
145 145
146 bool TaskQueue::IsQueueEmpty() const { 146 bool TaskQueue::IsQueueEmpty() const {
147 if (!work_queue_.empty()) 147 if (!work_queue_.empty())
148 return false; 148 return false;
149 149
150 { 150 {
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 state->EndArray(); 552 state->EndArray();
553 state->BeginDictionary("selector"); 553 state->BeginDictionary("selector");
554 selector_->AsValueInto(state.get()); 554 selector_->AsValueInto(state.get());
555 state->EndDictionary(); 555 state->EndDictionary();
556 if (should_run) 556 if (should_run)
557 state->SetInteger("selected_queue", selected_queue); 557 state->SetInteger("selected_queue", selected_queue);
558 return state; 558 return state;
559 } 559 }
560 560
561 } // namespace content 561 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/scheduler/single_thread_idle_task_runner.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698