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

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

Issue 1033643004: Add a WorkerScheduler and a WebThreadImplForWorker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: InitOnThread needed to call Init() Created 5 years, 8 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 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/child/scheduler/task_queue_manager.h" 5 #include "content/child/scheduler/task_queue_manager.h"
6 6
7 #include <queue> 7 #include <queue>
8 #include <set> 8 #include <set>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 bool TaskQueue::UpdateWorkQueue(LazyNow* lazy_now, 299 bool TaskQueue::UpdateWorkQueue(LazyNow* lazy_now,
300 const base::PendingTask* previous_task) { 300 const base::PendingTask* previous_task) {
301 if (!work_queue_.empty()) 301 if (!work_queue_.empty())
302 return true; 302 return true;
303 303
304 { 304 {
305 base::AutoLock lock(lock_); 305 base::AutoLock lock(lock_);
306 MoveReadyDelayedTasksToIncomingQueueLocked(lazy_now); 306 MoveReadyDelayedTasksToIncomingQueueLocked(lazy_now);
307 if (!ShouldAutoPumpQueueLocked(previous_task)) 307 if (!ShouldAutoPumpQueueLocked(previous_task))
308 return false; 308 return false;
309 MoveReadyDelayedTasksToIncomingQueueLocked(lazy_now);
Sami 2015/04/02 10:19:45 Did you mean to make this change? If so, probably
alex clarke (OOO till 29th) 2015/04/02 15:19:28 Done.
310 work_queue_.Swap(&incoming_queue_); 309 work_queue_.Swap(&incoming_queue_);
311 TraceQueueSize(true); 310 TraceQueueSize(true);
312 return true; 311 return true;
313 } 312 }
314 } 313 }
315 314
316 base::PendingTask TaskQueue::TakeTaskFromWorkQueue() { 315 base::PendingTask TaskQueue::TakeTaskFromWorkQueue() {
317 base::PendingTask pending_task = work_queue_.front(); 316 base::PendingTask pending_task = work_queue_.front();
318 work_queue_.pop(); 317 work_queue_.pop();
319 TraceQueueSize(false); 318 TraceQueueSize(false);
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 state->EndArray(); 704 state->EndArray();
706 state->BeginDictionary("selector"); 705 state->BeginDictionary("selector");
707 selector_->AsValueInto(state.get()); 706 selector_->AsValueInto(state.get());
708 state->EndDictionary(); 707 state->EndDictionary();
709 if (should_run) 708 if (should_run)
710 state->SetInteger("selected_queue", selected_queue); 709 state->SetInteger("selected_queue", selected_queue);
711 return state; 710 return state;
712 } 711 }
713 712
714 } // namespace content 713 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698