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

Side by Side Diff: third_party/WebKit/Source/platform/scheduler/test/fake_web_task_runner.cc

Issue 2487493004: Support external task cancellation mechanisms in base::Callback::IsCancelled (Closed)
Patch Set: . Created 4 years, 1 month 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "platform/scheduler/test/fake_web_task_runner.h" 5 #include "platform/scheduler/test/fake_web_task_runner.h"
6 6
7 #include <deque> 7 #include <deque>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 void FakeWebTaskRunner::runUntilIdle() { 108 void FakeWebTaskRunner::runUntilIdle() {
109 while (!data_->task_queue_.empty()) { 109 while (!data_->task_queue_.empty()) {
110 // Move the task to run into a local variable in case it touches the 110 // Move the task to run into a local variable in case it touches the
111 // task queue by posting a new task. 111 // task queue by posting a new task.
112 base::Closure task = std::move(data_->task_queue_.front()); 112 base::Closure task = std::move(data_->task_queue_.front());
113 data_->task_queue_.pop_front(); 113 data_->task_queue_.pop_front();
114 task.Run(); 114 task.Run();
115 } 115 }
116 } 116 }
117 117
118 std::deque<base::Closure> FakeWebTaskRunner::takePendingTasks() {
haraken 2016/11/10 04:20:10 takePendingTasksForTesting ?
tzik 2016/11/10 07:21:14 Done. ... but is it useful to add "ForTesting" to
119 return std::move(data_->task_queue_);
120 }
121
118 } // namespace scheduler 122 } // namespace scheduler
119 } // namespace blink 123 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698